> ## Documentation Index
> Fetch the complete documentation index at: https://lava.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PubChem

> NIH chemical compound database providing detailed molecular data, properties, biological activities, and safety information for millions of substances.

NIH chemical compound database providing detailed molecular data, properties, biological activities, and safety information for millions of substances. Best for chemistry research, drug interaction lookups, and identifying compound properties by name, formula, or structure. The authoritative source for chemical data — unlike general reference sources (Wikipedia), PubChem provides structured scientific data with safety and bioactivity annotations.

2 example endpoints available through Lava's AI Gateway. See the [PubChem API docs](https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest) for full documentation.

<Info>This provider is **managed** — no additional setup required.</Info>

<Info>This is a **catch-all provider** — any valid URL under `https://pubchem.ncbi.nlm.nih.gov/rest/pug` is supported. Chemical compound database. Construct URL as [https://pubchem.ncbi.nlm.nih.gov/rest/pug/\&#123;domain\&#125;/\&#123;identifier\&#125;/\&#123;operation\&#125;/\&#123;output\&#125](https://pubchem.ncbi.nlm.nih.gov/rest/pug/\&#123;domain\&#125;/\&#123;identifier\&#125;/\&#123;operation\&#125;/\&#123;output\&#125);. Common: /compound/name/\{name}/JSON, /compound/cid/\{cid}/property/\{PropertyList}/JSON. The endpoints below are curated examples.</Info>

## Endpoints

### Look up compound by name

**GET** `https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/aspirin/JSON` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/aspirin/JSON', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fpubchem.ncbi.nlm.nih.gov%2Frest%2Fpug%2Fcompound%2Fname%2Faspirin%2FJSON" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Batch look up compounds by name

**POST** `https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/JSON` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/JSON', { method: 'POST' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fpubchem.ncbi.nlm.nih.gov%2Frest%2Fpug%2Fcompound%2Fname%2FJSON" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
