Skip to main content
Docs

Search guides and API endpoints, for example “Idempotency-Key” or “submit job”.

    API reference

    Structure drawings

    On this page

    Draw 2D structures from SMILES

    POST/api/v1/depict

    API key or token

    Request body

    application/json · DepictRequest

    Request fields
    FieldTypeDescription
    heightinteger

    Default: 220Limits: ≥ 100, ≤ 600

    smiles[]requiredstring[]

    Limits: min items 1, max items 20

    widthinteger

    Default: 300Limits: ≥ 100, ≤ 600

    Example request

    curl -X POST "https://api.cognichem.com/api/v1/depict" \
      -H "X-Api-Key: $COGNICHEM_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "height": 220,
      "smiles": [
        "CC(=O)Oc1ccccc1C(=O)O"
      ],
      "width": 300
    }'

    Responses

    Successful Response · application/json · DepictResponse

    Response fields
    FieldTypeDescription
    items[]requiredDepiction[]
    items.errorstring | null

    One of: "unparseable", "too_large", "render_failed"

    items.svgstring | null
    Example 200 response
    {
      "items": [
        {
          "svg": "<?xml version='1.0' encoding='iso-8859-1'?>\n<svg version='1.1' …</svg>"
        },
        {
          "error": "unparseable"
        }
      ]
    }

    Draw reactions from reaction SMILES

    POST/api/v1/depict/reactions

    API key or token

    Request body

    application/json · DepictReactionsRequest

    Request fields
    FieldTypeDescription
    heightinteger

    Default: 220Limits: ≥ 100, ≤ 600

    reactions[]requiredstring[]

    Limits: min items 1, max items 20

    widthinteger

    Default: 600Limits: ≥ 200, ≤ 900

    Example request

    curl -X POST "https://api.cognichem.com/api/v1/depict/reactions" \
      -H "X-Api-Key: $COGNICHEM_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "height": 220,
      "reactions": [
        "CC(=O)O.OCC>>CC(=O)OCC.O"
      ],
      "width": 600
    }'

    Responses

    Successful Response · application/json · DepictResponse

    Response fields
    FieldTypeDescription
    items[]requiredDepiction[]
    items.errorstring | null

    One of: "unparseable", "too_large", "render_failed"

    items.svgstring | null
    Example 200 response
    {
      "items": [
        {
          "svg": "<?xml version='1.0' encoding='iso-8859-1'?>\n<svg version='1.1' …</svg>"
        },
        {
          "error": "unparseable"
        }
      ]
    }