Science and space

PubChem PUG REST API

by pubchem.ncbi.nlm.nih.gov

Science and space Added on December 1st, 2026
Visit pubchem.ncbi.nlm.nih.gov →

What it does

PubChem's PUG REST API gives data about chemical compounds from the US National Library of Medicine, such as names, molecular formulas, weights, structures and properties, for example to look up a molecule by name in a study app. Build the request in the URL and get JSON, XML, CSV or other formats. Free, no key needed, with no more than 5 requests per second. Data comes from many contributors, so check the licence of the source you reuse.
  • API
  • CSV
  • HTTP-GET
  • JSON
  • REST
  • XML

At a glance

API key
Not needed · More APIs with no key
Pricing
Free, no key needed, with no more than 5 requests per second.
From the browser
Yes (CORS)
Formats
JSON, XML, CSV
Interface
REST, HTTP-GET
Provider
pubchem.ncbi.nlm.nih.gov

More information: https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest

Is this your service? Show that it is listed

Put this badge on your website or in your README; it links to this page. About the badge

Listed on Free Web Services

pubchem.ncbi.nlm.nih.gov
PubChem PUG REST API

Example request

curl

curl 'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/aspirin/property/MolecularFormula,MolecularWeight,IUPACName/JSON'

JavaScript

const response = await fetch("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/aspirin/property/MolecularFormula,MolecularWeight,IUPACName/JSON");
const data = await response.json();
console.log(data);

Python

import requests

response = requests.get(
    "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/aspirin/property/MolecularFormula,MolecularWeight,IUPACName/JSON",
    timeout=30,
)
print(response.json())

The JavaScript works in a web page as well as in Node.js 18 or newer.

Did it work for you?

Tell us what you found when you tried PubChem PUG REST API.