Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
google-deepmind avatar

Pubchem Database

  • 1.2k installs
  • 2.6k repo stars
  • Updated July 7, 2026
  • google-deepmind/science-skills

pubchem-database is a skill that queries PubChem compound properties, structures, bioassays, and synonyms via PUG-REST and PUG-View APIs for developers who need authoritative chemical identifiers inside agent workflows.

About

pubchem-database is a science skill from google-deepmind/science-skills for querying NCBI PubChem through PUG-REST computed-property search and PUG-View record APIs. It documents URL paths across domains including compound, substance, assay, gene, protein, pathway, taxonomy, and cell, with namespaces for CID, chemical name, SMILES, and InChI identifiers. Developers use pubchem-database when building cheminformatics pipelines, drug-discovery agents, or lab tooling that must fetch structures, synonyms, and bioassay metadata without hand-crafting REST paths. The skill also references a pubchem_api.py wrapper and raw API fallbacks when wrapper coverage is insufficient.

  • Full PUG-REST and PUG-View API reference for compound, substance, assay, gene, protein, pathway, taxonomy and cell domai
  • Supports exact lookups by CID, name, SMILES, InChIKey, formula plus fast substructure, similarity and identity searches
  • Extracts specific properties, synonyms, CIDs, assay summaries, cross-references and full records
  • Returns data in JSON, XML, CSV, TXT or PNG formats
  • Enables precise chemical data retrieval when the pubchem_api.py wrapper is insufficient

Pubchem Database by the numbers

  • 1,186 all-time installs (skills.sh)
  • +57 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #261 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/google-deepmind/science-skills --skill pubchem-database

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.2k
repo stars2.6k
Security audit2 / 3 scanners passed
Last updatedJuly 7, 2026
Repositorygoogle-deepmind/science-skills

How do you query PubChem compound data programmatically?

Query chemical compound properties, structures, bioassays and synonyms directly from PubChem inside agentic workflows.

Who is it for?

Developers building cheminformatics tools or science agents that need PubChem compound and bioassay data via REST.

Skip if: General web scraping tasks unrelated to chemical databases or projects that only need non-chemical public datasets.

When should I use this skill?

User mentions PubChem, PUG-REST, chemical structures, SMILES lookup, bioassay data, or compound properties.

What you get

Structured PubChem API responses with compound properties, SMILES/InChI structures, bioassay hits, and synonym lists.

  • API query results
  • compound metadata JSON

Files

SKILL.mdMarkdownGitHub ↗

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 LICENSE_NOTIFICATION.txt does not already exist in this skill 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)

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.

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).

uv run scripts/pubchem_api.py properties --cid 2244 --output result.json

3. Synonyms and Trade Names Find alternative names and brand names.

uv run scripts/pubchem_api.py synonyms --cid 2244 --output result.json

Advanced Context

4. Safety and Hazard Information (GHS) Retrieve Global Harmonized System hazard statements and handling precautions (uses PUG-View).

uv run scripts/pubchem_api.py safety --cid 2244 --output result.json

5. Drug and Medication Information Fetch FDA pharmacology data, mechanism of action, and therapeutic uses (uses PUG-View).

uv run scripts/pubchem_api.py pharmacology --cid 2244 --output result.json

6. Custom Heading (PUG-View) Retrieve any specific heading from the PUG-View system (e.g., 'Geometry', 'Crystal Structures').

uv run scripts/pubchem_api.py view --cid 3939 --heading "Crystal Structures" --output result.json

7. Image Generation Retrieve 2D chemical structure images. The script returns a Markdown-formatted image link.

uv run scripts/pubchem_api.py image --cid 2244 --output result.json

Complex Search & Biology

8. Structure-Based Searching (Similarity & Substructure) Find molecules similar to a SMILES string or containing a specific substructure.

uv run scripts/pubchem_api.py similarity --smiles "CC(=O)OC1=CC=CC=C1C(=O)O" --output result.json

and

uv run scripts/pubchem_api.py substructure --smiles "C1=CC=CC=C1" --output result.json

9. BioAssay & Target Interactions Identify genes or proteins a chemical interacts with.

uv run scripts/pubchem_api.py assays --cid 2244 --output result.json

Advanced Usage & Workflows

10. Cross-references (Xrefs) Fetch identifiers cross-referenced with a CID (e.g., PatentID, PubMedID).

uv run scripts/pubchem_api.py xrefs --cid 2244 --type "PatentID" --output result.json

11. Property Range Search Find CIDs within a specific property range. Supported features include: molecular_weight, heavy_atom_count, xlogp, tpsa, h_bond_donor_count, h_bond_acceptor_count, rotatable_bond_count, exact_mass, monoisotopic_mass, and complexity.

uv run scripts/pubchem_api.py range --feature molecular_weight --min 400.0 --max 400.05 --output result.json

12. Custom PUG-REST Query Execute a raw path against the PUG-REST API.

uv run scripts/pubchem_api.py query --path "compound/cid/2244/xrefs/PatentID/JSON" --output result.json

Fallback Search Strategies

If direct resolution by name or formula fails (e.g., for complex compounds or specific ions):

  • Search for parent/neutral molecule: If searching for an ion or salt, try

searching for the neutral parent compound.

  • Deconstruct complex formulas: If a complex formula returns no results,

try searching for major components or ligands.

  • Use substructure or similarity search: If you have a SMILES string or

can generate one for a component, use it to find related compounds.

Complex Queries and Multi-Step Tasks

  • Custom/Complex Queries: For more details, read

references/endpoints.md to construct raw PUG-REST URLs.

  • Multi-Step Tasks: For complex tasks like drug discovery pipelines,

follow the checklists in references/workflows.md.

Related skills

How it compares

Use pubchem-database for authoritative NCBI chemical records; use general HTTP skills only for non-chemistry public APIs.

FAQ

What PubChem API does pubchem-database use?

pubchem-database documents PUG-REST for computed properties and search plus PUG-View for detailed record views. Base REST paths follow /domain/namespace/identifiers/operation/output structure against pubchem.ncbi.nlm.nih.gov.

Which identifiers can pubchem-database search by?

pubchem-database supports PubChem namespaces including cid, exact chemical name, SMILES, and InChI keys. Paths target domains such as compound, substance, assay, gene, protein, pathway, taxonomy, and cell.

Is Pubchem Database safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Data Science & MLresearchautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.