Python SDK

Install and start using the Python SDK.

Intro

The Chemical Insights APIs - CI-API SDK provides access to the Chemical Insights APIs - CI-API REST APIs.

The CI API provides programmatic access to public chemical safety data from UL Research Institutes' Chemical Insights Research Institute: chemical identifiers and details, hazard, exposure and toxicokinetic data.

Installation

Add the SDK to your project from its folder, with whichever package manager your project uses. Give each tool a path containing a slash, such as ../chemical-insights-apis-ci-api — a bare folder name is looked up on PyPI instead, and resolves to whatever project holds that name there:

Terminal
pip install <path-to-sdk>
Terminal
uv add <path-to-sdk>
Terminal
poetry add <path-to-sdk>

Quick Start

Synchronous client

Construct ChemicalInsightsApisCiApiClient with keyword arguments, and call close() when you are done. Every argument is optional.

Python
from chemical_insights_apis_ci_api import ChemicalInsightsApisCiApiClient

client = ChemicalInsightsApisCiApiClient()

client.close()

Alternatively, scope it — with ChemicalInsightsApisCiApiClient(...) as client: closes the pool on exit.

Asynchronous client

AsyncChemicalInsightsApisCiApiClient mirrors ChemicalInsightsApisCiApiClient with identical method names, and every endpoint method is a coroutine. It takes the same arguments, with some differences — for example, the transport argument is custom_async_http_client.

Python
from asyncio import run

from chemical_insights_apis_ci_api import AsyncChemicalInsightsApisCiApiClient


async def main() -> None:
    client = AsyncChemicalInsightsApisCiApiClient()
    await client.aclose()


run(main())

Alternatively, scope it — async with AsyncChemicalInsightsApisCiApiClient(...) as client: closes the pool on exit.

On this page