PubChem rate limits
Pace PubChem at 3-5 requests per second, 1-2 for structure searches, and back off from 1-2 seconds to 30 on a 429 while honouring Retry-After.
PubChem rate limits
Stay within PubChem’s throttling while keeping results responsive. Inside chat, Ivy paces PubChem requests for you; the guidance below is for scripts that call PubChem directly, on your own machine or in the chat's code workspace.
Recommended pacing
- Page requests: 3–5 requests per second per client is typically safe.
- Structure searches: treat as heavier; pace at 1–2 requests per second.
- Large exports: split into pages and download sequentially.
Backoff strategy
- Use exponential backoff starting at 1–2 seconds, doubling to a max of ~30 seconds.
- On HTTP 429, respect
Retry-Afterif provided; otherwise wait at least 5 seconds. - Avoid concurrent exports for the same query; reuse cached results instead.
Caching behavior
- The platform may cache recent queries; cached responses return immediately with a timestamp.
- Re-run the same query only when you need fresher data; otherwise reuse the cached export.
- Log whether a response came from cache to interpret latency.
Monitoring tips
- Track error rates and 429s per client to tune pacing.
- Record query type (text/identifier/structure), filters, and page size to correlate with throttling.
- Keep request IDs in logs so support can trace failures.
If you’re repeatedly throttled
- Lower concurrency and increase delay between requests.
- Narrow queries (add filters) to reduce result size.
- Prefer identifier or InChIKey searches over broad synonym queries for heavy workloads.
Was this page helpful?
PubChem fields and properties
Which PubChem fields come back: CID, InChIKey and SMILES — the old CanonicalSMILES name returns null — plus TPSA, XLogP, stereo counts and 10 synonyms.
PubChem advanced search: molecular weight, heavy atoms, HBA
Search PubChem by name, CID, InChIKey or SMILES, then narrow by molecular weight, LogP, TPSA, hydrogen bond donors and acceptors, heavy atoms and ring count.