# Pubchem Database

Query PubChem, search by name/CID/SMILES, retrieve properties, similarity/substructure...

- Repository: https://github.com/google-deepmind/science-skills (3377 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-10-23
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add google-deepmind/science-skills --skill pubchem-database -g -a claude-code -y`
Codex: `npx skills add google-deepmind/science-skills --skill pubchem-database -g -a codex -y`
Cursor: `npx skills add google-deepmind/science-skills --skill pubchem-database -g -a cursor -y`
Gemini CLI: `npx skills add google-deepmind/science-skills --skill pubchem-database -g -a gemini-cli -y`

## Description

Query PubChem, search by name/CID/SMILES, retrieve properties, similarity/substructure searches, bioactivity, for cheminformatics. Use when a user asks about a specific chemical, drug, or molecule.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# PubChem Database

## Prerequisites

1.  **`uv`**: Read the `uv` skill and follow its Setup instructions to ensure
    `uv` is installed and on PATH.
2.  **User Notification**: If .licenses/pubchem_database_LICENSE.txt does not
    already exist in the workspace root directory then (1) prominently notify
    the user to check the terms at
    https://pubchem.ncbi.nlm.nih.gov/docs/citation-guidelines and
    https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest, then (2) create the file
    recording the notification text and timestamp.

## Quick Start

PubChem queries are executed via a robust Python wrapper script to respect
terms-of-service and handle complex JSON parsing. This script allows safe
multi-agent use of APIs.

Example: Resolve a chemical name to its Compound ID (CID)

```bash
uv run scripts/pubchem_api.py resolve --name "aspirin" --output result.json
```

## Core Rules

-   **Use the Wrapper**: ALWAYS execute the provided helper scripts to query the
    database rather than accessing the database directly. The scripts
    automatically enforce the required rate limit gracefully.
-   Read the generated JSON output file, and process it with jq or code.
-   **Verify Facts**: ALWAYS verify information retrieved from memory with a
    database query if the user asks for a specific fact that can be checked in
    PubChem. Do not rely solely on internal knowledge.
-   **Notification**: If this skill is used, ensure this is mentioned in the
    output.

## Core Capabilities

**1. Compound Resolution (Name or InChI to Identifiers)** Convert chemical/trade
names or InChI strings into PubChem CIDs, SMILES, and InChIKeys.

```bash
uv run scripts/pubchem_api.py resolve --name "ibuprofen" --output result.json
# OR
uv run scripts/pubchem_api.py resolve --inchi "InChI=1S/C3/c1-3-2/i1+1" --output result.json
```

**2. Physical & Chemical Property Retrieval** Fetch computed properties (e.g.,
MolecularWeight, XLogP, TPSA).

The rest: https://github.com/google-deepmind/science-skills/blob/HEAD/skills/pubchem_database/SKILL.md
