# Pubchem

> Search PubChem for chemical compounds, properties, and identifiers

- Skill: `lamm-mit/pubchem` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add lamm-mit/pubchem`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lamm-mit/pubchem/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: lamm-mit (https://skillmd.com/u/lamm-mit)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/lamm-mit/pubchem

---


# PubChem Compound Lookup

Query the PubChem database for chemical compounds, molecular properties, SMILES, InChI, and related data. PubChem is NCBI's open chemistry database.

## Overview

- Search compounds by name or identifier
- Retrieve molecular formula, weight, SMILES, InChI, InChIKey
- Find related compounds and synonyms
- No API key required (rate limit: 5 requests/second)

## Usage

### Search by compound name:
```bash
python3 {baseDir}/scripts/pubchem_search.py --query "aspirin"
```

### Get compound by CID:
```bash
python3 {baseDir}/scripts/pubchem_search.py --cid 2244
```

### Get detailed properties:
```bash
python3 {baseDir}/scripts/pubchem_search.py --cid 2244 --format detailed
```

### Search with max results:
```bash
python3 {baseDir}/scripts/pubchem_search.py --query "caffeine" --max-results 5
```

## Parameters

| Parameter | Description | Default |
|-----------|-------------|---------|
| `--query` | Compound name or search term | - |
| `--cid` | PubChem Compound ID | - |
| `--max-results` | Max results for search | 10 |
| `--format` | Output: summary, detailed, json | summary |

## Output

- **Summary:** CID, name, molecular formula, molecular weight, SMILES
- **Detailed:** Adds InChI, InChIKey, synonyms, related CIDs
- **JSON:** Full API response

## Notes

- Rate limit: 5 requests per second (no API key)
- Use --cid for exact compound when you know the ID
- Use --query for name or text search

