Snipget.ai

Convert between chemical structure formats

Exact
chemistry_structure_convert

Deterministic and authoritative — the canonical answer for this input.

Convert a chemical structure given as SMILES or InChI into all the common canonical text forms — canonical SMILES, InChI, InChIKey, and molecular formula — fully locally via RDKit, so it works on any valid structure including novel/unregistered ones. A name or InChIKey is a reverse lookup (not offline-convertible) — use chemistry_compound_lookup for those. Unparseable structure -> confidence 0.0; a bad or unsupported input_format is a request-shape error, rejected unbilled (INVALID_INPUT). Batch via chemistry_structure_convert_batch. Charges 1 cost_unit.

Parameters

valuestringrequired

The structure to convert, as a SMILES or InChI string.

input_formatstringoptional

Input structure format: auto (default — detects InChI by its 'InChI=' prefix, else SMILES), smiles, or inchi.

Call it

curl -X POST https://api.snipget.ai/v1/chemistry/structure/convert \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"CCO"}'

The Batch tab sends up to 1000 inputs in one call via /v1/chemistry/structure/convert/batch.

Example response

{
  "input": "CCO",
  "input_format": "smiles",
  "is_valid": true,
  "canonical_smiles": "CCO",
  "inchi": "InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3",
  "inchikey": "LFQSCWFLJHTTHZ-UHFFFAOYSA-N",
  "formula": "C2H6O"
}

FAQ

What does this do?

It takes a structure written as SMILES or InChI and returns all the common canonical forms: canonical SMILES, InChI, InChIKey, and molecular formula. It is the reliable way to get a single canonical representation for matching or de-duplicating structures.

Does it work on compounds that are not in any database?

Yes. It runs locally with RDKit, so it works offline on any valid structure, including novel or unregistered ones that no lookup service has ever seen.

Is the conversion exact?

Yes. Canonicalization is deterministic, so the same input always yields the same canonical SMILES, InChI, and InChIKey.

Can I convert a name or an InChIKey into a structure?

No. An InChIKey is a one-way hash and a name is not parseable, so neither can be turned back into a structure offline. For those, use chemistry_compound_lookup, which resolves names, InChIKeys, CAS, and CID through PubChem.

What if my structure string is malformed?

An unparseable structure value returns confidence 0 with a why_invalid reason (not an error). A bad or unsupported input_format (including name or inchikey, which are reverse lookups) is a request-shape error: it returns INVALID_INPUT (HTTP 400, unbilled), with the message pointing you to chemistry_compound_lookup.

Related tools