# Chemical & Drug Safety Lookup - PubChem + FDA (`callmefaka/chemical-drug-safety`) Actor

Look up chemicals and drugs by name or CAS number: molecular properties, SMILES, synonyms, GHS hazard statements (PubChem) plus FDA drug labels, adverse events and recalls (openFDA). No API key needed.

- **URL**: https://apify.com/callmefaka/chemical-drug-safety.md
- **Developed by:** [Fakih](https://apify.com/callmefaka) (community)
- **Categories:** Other, E-commerce, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 record returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Chemical & Drug Safety Lookup — PubChem + FDA

Look up any chemical or drug by **name or CAS number** and get molecular properties, GHS hazard classification and (optionally) FDA label, adverse events and recalls — no API key required.

### What it returns

One item per compound (`type: "compound"`):

| field | meaning |
|---|---|
| `cid`, `title`, `iupacName` | PubChem identity |
| `molecularFormula`, `molecularWeight` | composition |
| `smiles` | canonical / connectivity SMILES |
| `xlogp`, `tpsa`, `hBondDonors`, `hBondAcceptors`, `rotatableBonds`, `heavyAtoms` | cheminformatics descriptors |
| `casNumbers` | CAS registry numbers (auto-detected from synonyms) |
| `synonyms` | up to 30 alternative names |
| `ghs.signalWords` | GHS signal word(s) — Danger / Warning |
| `ghs.pictograms` | GHS pictogram labels (Flammable, Irritant, Health Hazard, ...) |
| `ghs.hazardStatements` | H-statements, e.g. `H350: May cause cancer [Danger Carcinogenicity]` |
| `ghs.precautionaryCodes` | P-codes, e.g. `P210`, `P280` |
| `description` | free-text summary (often includes toxicity notes) |

Optional FDA records (one item each):

- `type: "drug-label"` — indications, warnings, dosage, adverse reactions
- `type: "adverse-event"` — FAERS adverse event reports (reactions, seriousness, country)
- `type: "recall"` — drug recall / enforcement reports (reason, classification, firm)

### Input

```json
{
  "queries": ["aspirin", "benzene", "71-43-2"],
  "includeGhs": true,
  "includeDescription": true,
  "includeDrugLabel": false,
  "includeAdverseEvents": false,
  "includeRecalls": false,
  "maxReports": 20
}
```

`queries` accepts **names** (`aspirin`) and **CAS numbers** (`71-43-2`).

### Example output

```json
{
  "type": "compound",
  "query": "benzene",
  "cid": 241,
  "title": "Benzene",
  "molecularFormula": "C6H6",
  "molecularWeight": 78.11,
  "smiles": "C1=CC=CC=C1",
  "casNumbers": ["71-43-2"],
  "ghs": {
    "signalWords": ["Danger"],
    "pictograms": ["Flammable", "Irritant", "Health Hazard"],
    "hazardStatements": ["H225: Highly Flammable liquid and vapor [Danger Flammable liquids]", "H350: May cause cancer [Danger Carcinogenicity]"],
    "precautionaryCodes": ["P203", "P210", "P280"]
  }
}
```

### Use cases

- **EH\&S / SDS automation** — build safety data sheets and GHS labels from structured data.
- **Chemical e-commerce** — enrich product catalogues with CAS, formula, SMILES and hazards.
- **Lab / R\&D** — resolve a CAS number to a structure, formula and hazard profile in bulk.
- **Regulatory & compliance** — pull FDA labels, adverse events and recalls for a drug.
- **Toxicology / pharmacovigilance** — aggregate FAERS reports for signal detection.

### Sources

- PubChem PUG-REST + PUG-View — `https://pubchem.ncbi.nlm.nih.gov/rest/`
- openFDA — `https://api.fda.gov`

Both are public, key-free, and served by US government agencies (NIH / FDA). No proxies needed.

# Actor input Schema

## `queries` (type: `array`):

Compound names (aspirin, benzene) or CAS registry numbers (50-78-2). One record per entry.

## `includeGhs` (type: `boolean`):

Fetch GHS hazard classification (safety warnings) from PubChem.

## `includeDescription` (type: `boolean`):

Include the free-text compound description (often contains safety/toxicity notes).

## `includeDrugLabel` (type: `boolean`):

Also fetch the FDA label (indications, warnings, dosage) via openFDA.

## `includeAdverseEvents` (type: `boolean`):

Also fetch FDA adverse event reports mentioning the drug.

## `includeRecalls` (type: `boolean`):

Also fetch FDA drug recall / enforcement reports.

## `maxReports` (type: `integer`):

Cap for adverse events and recalls per drug.

## Actor input object example

```json
{
  "queries": [
    "aspirin",
    "benzene"
  ],
  "includeGhs": true,
  "includeDescription": true,
  "includeDrugLabel": false,
  "includeAdverseEvents": false,
  "includeRecalls": false,
  "maxReports": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset of compound, label, adverse event and recall records.

## `overview` (type: `string`):

Compact view of the records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "aspirin",
        "benzene"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("callmefaka/chemical-drug-safety").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "queries": [
        "aspirin",
        "benzene",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("callmefaka/chemical-drug-safety").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "aspirin",
    "benzene"
  ]
}' |
apify call callmefaka/chemical-drug-safety --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,callmefaka/chemical-drug-safety"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/K8m9ILGnzJQPuemMJ/builds/UIbXEfKTzQcRUmC66/openapi.json
