S SNRL · API

SNRL API

A REST API over the free chemical database — search chemicals, fetch products and their GHS hazards. Read-only, JSON.

Authentication

Every request needs an API key in the X-API-Key header. Create a key (free) in the Developer Console — it's shown once at creation.

curl -H "X-API-Key: cpd_live_your_key" "https://snrl.in/v1/search?q=acetone"
Get an API key → Try it live →

Base URL & format

Base URL: https://snrl.in/v1. All responses are JSON. Errors return an HTTP status with a {"detail": "..."} body.

StatusMeaning
401Missing / invalid / revoked key
403Key lacks the required scope
429Rate limit or daily quota exceeded (see Retry-After)

Rate limits

Endpoints

GET/v1/searchread:search

Full-text search over products. A CAS number, UN number, or H-code routes to an exact match; free text is fuzzy over names, synonyms, and ingredients.

Query paramDescription
qSearch text, CAS (67-64-1), or hazard code (H225)
hazard_codeFilter to a GHS H-code (e.g. H350)
signal_wordFilter by Danger or Warning
manufacturer_id, category, country, languageAdditional filters
sortrelevance (default), name, revision_date, manufacturer
page, sizePagination (defaults 1, 20; max size 100)

Returns {total, page, size, items, facets}.

curl -H "X-API-Key: KEY" "https://snrl.in/v1/search?q=toluene"
GET/v1/search/suggestread:search

Type-ahead suggestions. Params: q (partial text, required) and size (1–25, default 10). Returns a JSON array of strings.

curl -H "X-API-Key: KEY" "https://snrl.in/v1/search/suggest?q=aceto"
GET/v1/substancesread:search

Search the authoritative chemical registry (~20k substances, ECHA Annex VI + PubChem) — this is the identity + GHS data behind the site, far larger than the product catalog. Fuzzy name/synonym, exact CAS/H-code, with filters and facets. Each hit carries a provenance badge (harmonised vs. aggregated).

Query paramDescription
qName, synonym, CAS (108-88-3), or H-code
hazard_codeFilter to an H-code (e.g. H350)
pictogramFilter to a GHS pictogram (e.g. GHS08)
useFilter by EPA CDR use tag
hpvtrue → only High Production Volume substances
size1–100 (default 20)
curl -H "X-API-Key: KEY" "https://snrl.in/v1/substances?q=toluene"
GET/v1/substances/{cas}read:search

One substance's authoritative identity + GHS classification and provenance, by CAS number.

curl -H "X-API-Key: KEY" "https://snrl.in/v1/substances/108-88-3"
GET/v1/productsread:products

List products, newest first, cursor-paginated. Returns {items, next_cursor}.

Query paramDescription
limit1–200 (default 50)
cursorOpaque cursor from a prior next_cursor
curl -H "X-API-Key: KEY" "https://snrl.in/v1/products?limit=5"
GET/v1/products/{id}read:products

A product and its active version — identity, GHS signal word / pictograms / H-statements, composition (CAS + concentration), and the source SDS link.

curl -H "X-API-Key: KEY" "https://snrl.in/v1/products/<uuid>"
GET/v1/products/{id}/versionsread:products

Every SDS revision we've captured for a product (append-only version history).

Tools & client examples

Python

import requests

r = requests.get(
    "https://snrl.in/v1/search",
    params={"q": "toluene", "size": 5},
    headers={"X-API-Key": "cpd_live_your_key"},
)
for hit in r.json()["items"]:
    print(hit["name"], hit.get("signal_word"))

JavaScript (fetch)

const res = await fetch(
  "https://snrl.in/v1/search?" + new URLSearchParams({ q: "toluene", size: "5" }),
  { headers: { "X-API-Key": "cpd_live_your_key" } },
);
const { items } = await res.json();
console.log(items.map((h) => h.name));

No-key endpoints

The free web search is also directly callable without a key (IP rate-limited): /v1/public/search?q=, /v1/public/substances/{cas}, and /v1/public/stats. The keyed API above adds product detail, version history, suggestions, and higher limits.