# PubChem on Onekey > 4 endpoints for PubChem (4 stable, 0 beta), 1 to 5 credits each. Category: Science & research. One key, one JSON shape. Base URL: https://api.onekey.dev Auth: header `x-api-key: `. Call shape: `GET /v1/{platform}/{endpoint}?{params}`. Every response is `{success, data, metadata, error}`; check `success` first. Cost is in `metadata.credits_charged`. Free when served from cache (0.2 credit for a cached response over 100 KB). Failed and not-found calls are refunded. Status: stable = verified against the live source; beta = not yet verified, fields may be missing. Page: https://onekey.dev/platforms/pubchem Reference (Markdown): https://onekey.dev/docs/api/pubchem.md All docs: https://onekey.dev/llms.txt ## Canonical fields returned Unified-schema fields (same names on every platform), with how many of the 4 mapped PubChem endpoints return each: - `entity.id` (string): 3 - `entity.name` (string): 3 - `entity.description` (string): 1 - plus 5 platform-specific fields under `ext.` ## Endpoints ### pubchem.compound_by_cid Chemical compound properties by PubChem CID. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/pubchem/compound_by_cid?cid=2244` with header `x-api-key: YOUR_API_KEY` - Parameters: - `cid` (string, required): PubChem compound id - Fields returned: `entity.id`, `entity.name`, `ext.formula`, `ext.molecularWeight`, `ext.inchiKey`, `ext.smiles` - Reference: https://onekey.dev/docs/api/pubchem/compound_by_cid.md ### pubchem.compound_by_name Chemical compound properties by name (PubChem). - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/pubchem/compound_by_name?name=aspirin` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): Compound name, e.g. aspirin - Fields returned: `entity.id`, `entity.name`, `ext.formula`, `ext.molecularWeight`, `ext.inchiKey`, `ext.smiles` - Reference: https://onekey.dev/docs/api/pubchem/compound_by_name.md ### pubchem.description Textual description of a compound (PubChem). - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/pubchem/description?name=aspirin` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): Compound name - Fields returned: `entity.id`, `entity.description`, `ext.source` - Reference: https://onekey.dev/docs/api/pubchem/description.md ### pubchem.synonyms Synonyms of a chemical compound (PubChem). - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/pubchem/synonyms?name=aspirin` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): Compound name - Fields returned: `entity.name` - Reference: https://onekey.dev/docs/api/pubchem/synonyms.md ## Sample request ```bash curl "https://api.onekey.dev/v1/pubchem/compound_by_cid?cid=2244" \ -H "x-api-key: YOUR_API_KEY" ```