[Integrations](https://spiral.ai/integrations) › [VS Code](https://spiral.ai/integrations/vscode) › [PubChem similar compounds](https://spiral.ai/integrations/vscode/pubchem-similar-compounds)

# How to Use PubChem similar compounds in VS Code

Finds compounds with similar structural features or a specified structural containment relationship. Use it to assemble an analogue shortlist; PubChem's 2D fingerprint similarity ignores stereochemical and isotopic differences.

|  |  |
| --- | --- |
| Model | PubChem similar compounds |
| Available through | Alexandria |
| Category | Health |
| Price | $0.00873 per call. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with PubChem similar compounds in VS Code

- Use PubChem similar compounds to retrieve 20 structures resembling imatinib at 95% similarity or higher, then create a CID-based shortlist in this project's research notebook.
- Use PubChem similar compounds to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from PubChem similar compounds and tell me what changed since last week.
- Check PubChem similar compounds and summarize what you find in three bullet points.
- Pull the newest data from PubChem similar compounds and give me the result as a table.

## How to set up PubChem similar compounds in VS Code

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the hosted server**: Use Add to VS Code on the console's Agents & MCP page, or run:

```bash
code --add-mcp '{"name":"spiral","type":"http","url":"https://api.spiral.ai/mcp"}'
```

2. **Sign in**: VS Code asks you to sign in when it first starts the server: sign in to Spiral and click Authorize. No API key. Run MCP: List Servers from the Command Palette to check that Spiral is running.

### Use the Spiral skill

1. **Send VS Code this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run PubChem similar compounds**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "pubchem-ncbi-nlm-nih-gov/compounds/similar",
    "input": {
      "compound": "<compound>"
    }
  }'
```

Then paste one of the prompts above: VS Code finds PubChem similar compounds on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/vscode

## PubChem similar compounds tools and prices

- [PubChem: chemical compounds, bioassays, targets and patents · Similar](https://spiral.ai/tools/alexandria/pubchem-ncbi-nlm-nih-gov/compounds/similar) (Alexandria): $0.00873 per call.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| cid | 1 to … | — | A PubChem CID, instead of compound. Pass exactly one of compound or cid. |
| kind | auto, cid, name, smiles, inchikey, inchi | auto | How to read compound; auto guesses from its shape. Set smiles for short SMILES that read as formulas or names ("CO"). |
| mode | similarity, substructure, superstructure | similarity | similarity: Tanimoto at or above threshold; substructure: compounds containing the query; superstructure: compounds contained in the query. |
| limit | 1 to 100 | 20 | Hits to return. |
| compound |  | — | The compound: a CID ("5291", "CID 5291"), a name or synonym PubChem knows exactly ("imatinib", "Ozempic", a CAS number "152459-95-5", "CHEMBL941"), an InChIKey, a SMILES, an InChI, or a pubchem.ncbi.nlm.nih.gov/compound/ URL. A name naming several compounds takes PubChem's first and warns with the others. |
| threshold | 70 to 100 | 90 | Minimum Tanimoto similarity in percent, similarity mode only. |

## What can you do with PubChem similar compounds in VS Code?

Build a compound research view in your project that connects chemical identities with properties and research evidence. Use PubChem CIDs to keep structural matches, assay results, targets, and patent links attached to the intended chemical.

### Triage structural analogues

Find structures resembling a seed compound, confirm their identities, and compare available properties, assay evidence, targets, and patent links before selecting candidates for closer study.

### Compare compound target profiles

Start from imatinib and structurally related compounds. Match identities and properties, organize their reported targets, and inspect the assay results behind shared or differing associations.

### Build a patent reading list around a structure

Confirm a seed compound, find related structures, and collect their linked patent publication identifiers. Organize documents for reading without treating chemical mentions as proof of claim coverage.

### Review a research watchlist each week

Repeat identity, property, structural-neighbor, assay, target, and patent queries for a fixed compound watchlist. Compare retrieved results with earlier snapshots to flag changes for a researcher.

### Teach chemical identity and structural similarity

Use aspirin and caffeine to demonstrate name resolution, computed properties, and structural searches. Show students why a molecular formula or fingerprint match does not establish complete structural identity.

### Investigate a reported screening hit

Confirm the hit's chemical identity, inspect its deposited activity outcomes and associated targets, and find related structures to include in a follow-up evidence review.

## Overview

- [Alexandria](https://spiral.ai/providers/alexandria)
- [All VS Code guides](https://spiral.ai/integrations/vscode)

## PubChem similar compounds in other agents

- [Amp](https://spiral.ai/integrations/amp/pubchem-similar-compounds)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/pubchem-similar-compounds)
- [Claude](https://spiral.ai/integrations/claude-desktop/pubchem-similar-compounds)
- [Claude Code](https://spiral.ai/integrations/claude-code/pubchem-similar-compounds)
- [Cline](https://spiral.ai/integrations/cline/pubchem-similar-compounds)
- [Codex](https://spiral.ai/integrations/codex/pubchem-similar-compounds)
- [Cursor](https://spiral.ai/integrations/cursor/pubchem-similar-compounds)
- [Devin](https://spiral.ai/integrations/devin/pubchem-similar-compounds)
- [dots](https://spiral.ai/integrations/dots/pubchem-similar-compounds)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/pubchem-similar-compounds)
- [Gemini](https://spiral.ai/integrations/gemini/pubchem-similar-compounds)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/pubchem-similar-compounds)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/pubchem-similar-compounds)
- [goose](https://spiral.ai/integrations/goose/pubchem-similar-compounds)
- [Grok](https://spiral.ai/integrations/grok/pubchem-similar-compounds)
- [Grok Build](https://spiral.ai/integrations/grok-build/pubchem-similar-compounds)
- [Hermes](https://spiral.ai/integrations/hermes/pubchem-similar-compounds)
- [Instinct](https://spiral.ai/integrations/instinct/pubchem-similar-compounds)
- [Manus](https://spiral.ai/integrations/manus/pubchem-similar-compounds)
- [Muse](https://spiral.ai/integrations/muse/pubchem-similar-compounds)
- [Muse Code](https://spiral.ai/integrations/muse-code/pubchem-similar-compounds)
- [n8n](https://spiral.ai/integrations/n8n/pubchem-similar-compounds)
- [Notion](https://spiral.ai/integrations/notion/pubchem-similar-compounds)
- [OpenClaw](https://spiral.ai/integrations/openclaw/pubchem-similar-compounds)
- [opencode](https://spiral.ai/integrations/opencode/pubchem-similar-compounds)
- [Perplexity](https://spiral.ai/integrations/perplexity/pubchem-similar-compounds)
- [Raycast](https://spiral.ai/integrations/raycast/pubchem-similar-compounds)
- [Windsurf](https://spiral.ai/integrations/windsurf/pubchem-similar-compounds)
- [Zapier](https://spiral.ai/integrations/zapier/pubchem-similar-compounds)

## More VS Code guides

- [PubChem compound targets](https://spiral.ai/integrations/vscode/pubchem-compound-targets)
- [PubMed and PMC article ID lookup](https://spiral.ai/integrations/vscode/pubmed-and-pmc-article-id-lookup)
- [PubChem compound search](https://spiral.ai/integrations/vscode/pubchem-compound-search)
- [PubMed and PMC citation summaries](https://spiral.ai/integrations/vscode/pubmed-and-pmc-citation-summaries)
- [PubChem compound patents](https://spiral.ai/integrations/vscode/pubchem-compound-patents)
- [PubMed and PMC literature search](https://spiral.ai/integrations/vscode/pubmed-and-pmc-literature-search)

## Questions about PubChem similar compounds in VS Code

**Can VS Code use PubChem similar compounds?**

Yes. Add Spiral to VS Code as an MCP server, and VS Code can find and run PubChem similar compounds like any built-in tool.

**How much does PubChem similar compounds cost in VS Code?**

$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your VS Code plan is separate.

**Do I need an Alexandria account to use PubChem similar compounds in VS Code?**

No. Spiral runs PubChem similar compounds on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up PubChem similar compounds in VS Code?**

About two minutes: add the hosted server, then sign in.

**Does VS Code wait while PubChem similar compounds runs?**

PubChem similar compounds runs in the background. VS Code starts the run, checks on it and gives you the json when it's ready.

**Does PubChem cover only small molecules?**

Small molecules make up most of PubChem, but it also includes nucleotides, carbohydrates, lipids, peptides, and chemically modified macromolecules.

**Why can several submitted records lead to one CID?**

PubChem combines submitted Substance records that standardize to the same chemical structure into one Compound record. The CID identifies that structure, while the original submissions retain their Substance identifiers.

**Are PubChem CAS-number matches authoritative?**

PubChem does not verify or manually curate CAS numbers supplied by third parties. Its documentation explicitly warns that CAS-to-CID assignments can contain errors or inconsistencies.

**Does PubChem publish new data on a guaranteed daily schedule?**

PubChem says a daily processing cycle is not a publication guarantee. Submission size, processing, reviews, revision requests, and service workload affect when contributed data becomes public.

**Can a PubChem structure search miss matching compounds?**

Yes. A formula or structure search can stop at an operational time or result limit before examining every candidate, leaving a valid but incomplete result list whose count is a lower bound.

