cfy ChemOnt classifier

Classify chemical structures given as SMILES into the ChemOnt taxonomy (ClassyFire-style). JSON over HTTP, no authentication, no rate limit.

Try it

One SMILES per line. One line sends a single request; several lines send a batch.



Endpoints

MethodPathPurpose
POST/classifyClassify one SMILES or a batch
GET/versionService, engine and rule versions, and the live limits
GET/healthzLiveness: {"status": "ok"}
GET/openapi.jsonOpenAPI 3.1 description of this API
GET/llms.txtShort Markdown guide for LLM agents

POST /classify

Send Content-Type: application/json and a body with exactly one field, smiles: a string for one compound, or an array of 1 to 1000 strings for a batch.

Single

curl -s https://HOST/classify -H 'Content-Type: application/json' \
  -d '{"smiles": "CN1C=NC2=C1C(=O)N(C)C(=O)N2C"}'

Returns one classification object:

{
  "smiles": "CN1C=NC2=C1C(=O)N(C)C(=O)N2C",
  "inchikey": null,
  "kingdom": {"name": "Organic compounds", "chemont_id": "CHEMONTID:0000000"},
  "superclass": {"name": "Organoheterocyclic compounds", "chemont_id": "CHEMONTID:0000002"},
  "class": {"name": "Imidazopyrimidines", "chemont_id": "CHEMONTID:0001797"},
  "subclass": {"name": "Purines and purine derivatives", "chemont_id": "CHEMONTID:0000245"},
  "intermediate_nodes": [],
  "direct_parent": {"name": "Xanthines", "chemont_id": "CHEMONTID:0000247"},
  "alternative_parents": [ ... ]
}

Batch

curl -s https://HOST/classify -H 'Content-Type: application/json' \
  -d '{"smiles": ["CCO", "not a smiles", "c1ccccc1O"]}'
{"count": 3, "results": [
  {"smiles": "CCO", "inchikey": null, "kingdom": {...}, ...},
  {"smiles": "not a smiles", "error": {"code": "invalid_smiles", "message": "the SMILES could not be parsed"}},
  {"smiles": "c1ccccc1O", ...}
]}

results has one entry per input, in input order. A bad SMILES becomes an item error and never fails the batch, so check each entry for an error key.

Classification fields

FieldTypeMeaning
smilesstringThe input, echoed as sent
inchikeynullReserved; always null in this build
kingdom, superclass, class, subclassnode or nullChemOnt levels 1 to 4 of the direct parent's lineage
intermediate_nodesnode[]Lineage nodes between subclass and direct parent
direct_parentnode or nullThe most specific category chosen
alternative_parentsnode[]Other most-specific categories the compound matches

A node is {"name": "Xanthines", "chemont_id": "CHEMONTID:0000247"}. Levels are null when the lineage is shorter; all are null when nothing matched.

Limits

LimitDefaultWhen exceeded
Request body1 MiB413 body_too_large
SMILES per request1000413 batch_too_large
SMILES length2000 bytesitem error smiles_too_long
Atoms per molecule1000item error molecule_too_large
Request deadline30 s504 request_timeout, no partial results

Live values are in /version.

Errors

Every error has the body {"error": {"code": "...", "message": "..."}}. Match on code; the message text may change.

StatusCodeMeaning
400invalid_jsonBody is not JSON
404not_foundUnknown path
405method_not_allowedWrong method for the path
413body_too_large, batch_too_largeOver a size limit
415unsupported_media_typeNot application/json, or compressed
422invalid_requestWrong JSON shape (missing smiles, unknown field, empty list)
422invalid_smiles, smiles_too_long, molecule_too_largeSingle request: the SMILES was refused
500internal_errorUnexpected failure
503overloadedBusy; retry after about 1 s
504request_timeoutPast the deadline; send smaller batches

For agents and tools

Versioning

This is API version 1. Within version 1, fields and error codes may be added but not removed or changed in meaning, so ignore unknown fields. A breaking change would be served under /v2/.