Chemical Compound Properties API

PubChem identity and properties for each compound name, CAS number, CID, InChIKey or SMILES you give: CID, name, CAS number, formula, molecular weight, exact mass, IUPAC name, SMILES, InChI, InChIKey, XLogP, polar surface area, charge and atom and bond counts. One clean row per compound.

$2 per 1,000 records

You pay only for the records you get. Zero records cost zero. 2,500 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.

Try it
Ready-made, maintained by usRecords, 21 fieldsv1.0

Data from pubchem.ncbi.nlm.nih.gov/docs/pug-rest

Get this data

Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.

Try it

Namesoptional
Compounds to look up, one per item: names (caffeine), CAS numbers (58-08-2), PubChem CIDs (2519) or InChIKeys. Up to 1,000 per run, together with smiles. One per line, or separated by commas.
Example: caffeine, 50-78-2, 2519
Smilesoptional
Compounds given as SMILES structures, one per item, such as CC(=O)OC1=CC=CC=C1C(=O)O for aspirin. One per line, or separated by commas.
Example: CCO
Include casoptional
Also look up each compound's CAS Registry Number. It takes one more request per compound, so turn it off for faster runs.

Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 2,500 records of this API, no card. Create a free key

For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
Endpoint
POSThttps://pullrow.dev/v1/apis/pubchem-compounds/run
  • Small runs answer in the same request; longer ones answer 202 with a run to poll.
  • fields returns only the fields you name. The examples send the ones picked on this page.
  • Idempotency-Key is optional. A retry with it is never charged twice.
  • You pay for records returned. Zero records cost zero.

Every run option, explained

Calling it needs a key
2,500 free records of this API to start. No card.
curl
curl -X POST "https://pullrow.dev/v1/apis/pubchem-compounds/run" \
  -H "Authorization: Bearer $PULLROW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"names":["caffeine","50-78-2","2519"]},"max_items":50}'

Inputs

Send them as input in the request body. Leave one out to use its default.

nameslist
Compounds to look up, one per item: names (caffeine), CAS numbers (58-08-2), PubChem CIDs (2519) or InChIKeys. Up to 1,000 per run, together with smiles.
example: caffeine, 50-78-2, 2519
smileslist
Compounds given as SMILES structures, one per item, such as CC(=O)OC1=CC=CC=C1C(=O)O for aspirin.
example: CCO
include_casyes/no
Also look up each compound's CAS Registry Number. It takes one more request per compound, so turn it off for faster runs.
default: trueexample: true

What's in each record

21 fields: 19 here, 2 technical ones under Technical details.

Basics

  • Title

    PubChem's name for the compound, such as Caffeine.

    Example Caffeine

  • Cas number

    CAS Registry Number most often cited for the compound, such as 58-08-2; empty when include_cas is off or PubChem has none.

    Example 58-08-2

  • Molecular formula

    Molecular formula in Hill order, such as C8H10N4O2.

    Example C8H10N4O2

  • Molecular weight

    Molecular weight in grams per mole.

    Example 194.19

  • Exact mass

    Exact mass in daltons of the most common isotopes.

    Example 194.080376

  • Iupac name

    Systematic IUPAC name as PubChem computes it.

    Example 1,3,7-trimethylpurine-2,6-dione

  • Smiles

    SMILES with stereochemistry and isotopes.

    Example CN1C=NC2=C1C(=O)N(C(=O)N2C)C

  • Connectivity smiles

    SMILES of the bonds only, without stereochemistry or isotopes.

    Example CN1C=NC2=C1C(=O)N(C(=O)N2C)C

  • Inchi

    Standard InChI identifier.

    Example InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3

  • Inchikey

    Standard InChIKey, the 27-character hashed InChI, such as RYYVLZVUVIJVGH-UHFFFAOYSA-N.

    Example RYYVLZVUVIJVGH-UHFFFAOYSA-N

  • Xlogp

    Computed octanol-water partition coefficient (XLogP3): higher means more fat-soluble.

    Example -0.1

  • Tpsa

    Topological polar surface area in square angstroms.

    Example 58.4

  • Complexity

    PubChem's structural complexity score.

    Example 293

  • Total formal charge

    Example 0

  • H bond donor count

    Number of hydrogen bond donors.

    Example 0

  • H bond acceptor count

    Number of hydrogen bond acceptors.

    Example 3

  • Rotatable bond count

    Number of rotatable bonds.

    Example 0

  • Heavy atom count

    Number of atoms other than hydrogen.

    Example 14

Technical detailsField names and types for developers, and the 2 fields hidden above

Hidden by default

These 2 fields come with each record too. They are internal codes, notes about how the record was read or a copy of what was searched for, so the lists above leave them out.

  • Search words queryThe name, CAS number, CID, InChIKey or SMILES as you gave it.
  • Cid cidPubChem compound id (CID), such as 2519.

Field names and types

The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.

Field nameTypeShown on this page asFilled
querytextSearch words (hidden)3 of 3
cidtextCid (hidden)3 of 3
urllinkLink3 of 3
titletextTitle3 of 3
cas_numbertextCas number3 of 3
molecular_formulatextMolecular formula3 of 3
molecular_weightnumberMolecular weight3 of 3
exact_massnumberExact mass3 of 3
iupac_nametextIupac name3 of 3
smilestextSmiles3 of 3
connectivity_smilestextConnectivity smiles3 of 3
inchitextInchi3 of 3
inchikeytextInchikey3 of 3
xlogpnumberXlogp3 of 3
tpsanumberTpsa3 of 3
complexitynumberComplexity3 of 3
chargenumberTotal formal charge3 of 3
h_bond_donor_countnumberH bond donor count3 of 3
h_bond_acceptor_countnumberH bond acceptor count3 of 3
rotatable_bond_countnumberRotatable bond count3 of 3
heavy_atom_countnumberHeavy atom count3 of 3

How it reads the site

Runs on a reader we built and maintain by hand for this site.

Sample records

Sample records
RecordTitleCas numberMolecular formulaMolecular weightExact massIupac nameSmilesConnectivity smilesInchiInchikeyXlogpTpsaComplexityTotal formal chargeH bond donor countH bond acceptor countRotatable bond countHeavy atom countLink
1Caffeine58-08-2C8H10N4O2194.19194.0803761,3,7-trimethylpurine-2,6-dioneCN1C=NC2=C1C(=O)N(C(=O)N2C)CCN1C=NC2=C1C(=O)N(C(=O)N2C)CInChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3RYYVLZVUVIJVGH-UHFFFAOYSA-N-0.158.4293003014pubchem.ncbi.nlm.nih.gov/compound/2519
2Formaldehyde50-00-0CH2O30.02630.010565formaldehydeC=OC=OInChI=1S/CH2O/c1-2/h1H2WSFSSNUMVMOOMR-UHFFFAOYSA-N1.217.1200102pubchem.ncbi.nlm.nih.gov/compound/712
3Aspirin50-78-2C9H8O4180.16180.0422592-acetyloxybenzoic acidCC(=O)OC1=CC=CC=C1C(=O)OCC(=O)OC1=CC=CC=C1C(=O)OInChI=1S/C9H8O4/c1-6(10)13-8-5-3-2-4-7(8)9(11)12/h2-5H,1H3,(H,11,12)BSYNRYMUTXBXSQ-UHFFFAOYSA-N1.263.6212014313pubchem.ncbi.nlm.nih.gov/compound/2244

Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.

Reliability

Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.

Incidents and repairs

How it is kept working What a repair can't do

A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.

  • You pay only for records returned. A run that returns none costs nothing.
Known limits
  • Data from PubChem at the U.S. National Library of Medicine, mostly in the public domain. XLogP, polar surface area, complexity and the atom and bond counts are PubChem's own calculations, not measured values. NLM does not endorse this API.
  • A name, CAS number or structure PubChem cannot match returns no row, so compare query with your list to find them. Names are matched as whole names, case aside, not as partial words; misspellings and some trade names do not match.
  • A name usually matches one compound; the few that match several come back as one row each. Digits alone are read as a PubChem CID.
  • cas_number is the CAS Registry Number that PubChem's sources cite most often for the compound, checked by its check digit. PubChem is not the official CAS registry, and salts, mixtures and newer compounds often have none.
  • Up to 1,000 lookups per run. PubChem allows at most five requests a second, so requests go one at a time and long lists take a while: each name or structure takes one request and its CAS number another. CIDs are read 100 at a time.
  • For a salt, hydrate or mixture the formula and weights cover the whole PubChem record, every part included.

Version history

A run uses the live version unless the request names another one with version.