Skip to content

NIH API: Get chemical facts by name or CAS number

Looks up a chemical on PubChem by common name or CAS number and returns its formula, molecular weight, names, description, SMILES, InChIKey and 2D structure image link.

pubchem.ncbi.nlm.nih.gov (opens in a new tab)Version 1ReadNo sign-inVerified Nov 2, 2026

Unofficial. Not affiliated with or endorsed by NIH.

Inputs

Values from the run on Oct 23, 2026, shown under Output.

Chemical, requiredchemical

Common chemical name or CAS number, for example caffeine or 58-08-2.

caffeine

Output

From a run on Oct 23, 2026, shortened for this page.
{  "name": "Caffeine",  "smiles": "CN1C=NC2=C1C(=O)N(C(=O)N2C)C",  "inchikey": "RYYVLZVUVIJVGH-UHFFFAOYSA-N",  "cas_number": "58-08-2",  "iupac_name": "1,3,7-trimethylpurine-2,6-dione",  "description": "Caffeine is a trimethylxanthine in which the three methyl groups are located at positions 1, 3, and 7.",  "pubchem_cid": 2519,  "pubchem_url": "https://pubchem.ncbi.nlm.nih.gov/compound/2519",  "common_synonyms": [    "Guaranine",    "1,3,7-Trimethylxanthine",    "Methyltheobromine"  ],  "molecular_formula": "C8H10N4O2",  "structure_image_url": "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2519/PNG?record_type=2d",  "molecular_weight_g_per_mol": 194.19}
Price
1 credit per completed run (1¢ with pay as you go); failed runs are free.
Method
pubchem.ncbi.nlm.nih.gov/get_chemical
Returns
name, molecular formula and weight, IUPAC name, CAS number, synonyms, description, structure image URL, PubChem URL, CID, SMILES, InChIKey

Use it from your agent

Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method pubchem.ncbi.nlm.nih.gov/get_chemical with the inputs above.

Ask your agent

  • What is the molecular formula and molecular weight of caffeine?
  • Look up CAS 50-78-2 and give me its SMILES and InChIKey.
  • Can you find the IUPAC name and synonyms for aspirin on PubChem?
  • I need the structure image link and PubChem CID for nicotine, please.
  • Which chemical has CAS number 64-17-5, and what is its description on nih.gov?
  • Looks up a chemical on PubChem by name or CAS number and returns its GHS hazard labels, route-specific first aid, flash point and workplace exposure limits.

    pubchem.ncbi.nlm.nih.gov/get_chemical_safety
  • Finds PubMed medical and life-science articles by topic, with publication details and free full-text links when PubMed confirms them.

    pubmed.ncbi.nlm.nih.gov/search_articles
  • Gets the full PubMed abstract and publication details for one article by title, PubMed link, or PubMed number (PMID). A title is searched in PubMed titles first and must closely match a found article. Some articles have no abstract or free full text.

    pubmed.ncbi.nlm.nih.gov/get_article
  • Finds NIH research grants by topic, organisation, or researcher name. Searches the last five fiscal years by default.

    reporter.nih.gov/search_grants
  • Finds ICD-10-CM diagnosis codes and official names from a plain-language condition description, retrying with simplified wording when the first search finds nothing.

    clinicaltables.nlm.nih.gov/search_diagnosis_codes
  • Explains an ICD-10-CM diagnosis code with its official name, category, chapter, and whether it is billable, using the NLM Clinical Tables diagnosis table.

    clinicaltables.nlm.nih.gov/explain_diagnosis_code
  • Finds possible pill matches on the Drugs.com pill identifier by imprint, optionally narrowed by color and shape, with each pill's labeler.

    drugs.com/identify_pill
  • Looks up a medicine by brand or generic name on Drugs.com and returns a plain-language overview: class, uses, availability, schedule, dosage forms, side effects, and pregnancy and breastfeeding notes.

    drugs.com/get_drug