# PubChem PUG REST API

Category: [Science and space](https://free-web-services.com/web-services/science/)  
Page: https://free-web-services.com/web-services/science/pubchem-pug-rest-api.html  
Documentation: https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest

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 key: Not needed
- 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

Example request:

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

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

