Utility API

Decode Compound ID API

Available

Decode Compound ID searches compound identifiers by name and returns IDs that can be used in compound-level filters and advanced nutrition workflows.

Endpoint

GET/functions/v1/get_decode_compound_id?q=caffeine&limit=20

Contract

Send mymolecules-api-version with 2026-07-10 to use the documented response contract.

{
  "data": {},
  "meta": {
    "request_id": "req_...",
    "api_version": "2026-07-10"
  }
}

Headers

Request

  • x-api-key required - Server-side API key for your integration.
  • mymolecules-api-version required 2026-07-10 - Use the latest stable API version: 2026-07-10.

Response

  • x-request-id required - Request identifier. Log this value when contacting support.
  • mymolecules-api-version required 2026-07-10 - The API contract version used for the response.
  • x-ratelimit-limit optional - Quota limit for the current key and window when quota data is available.
  • x-ratelimit-remaining optional - Remaining requests in the current quota window when quota data is available.
  • x-ratelimit-reset optional - ISO timestamp for the current quota window reset when quota data is available.
  • retry-after optional - Seconds to wait before retrying when the request is rate-limited or temporarily unavailable.

Inputs

  • Optional q query parameter for compound name search
  • Optional limit query parameter from 1 to 100

Returns

  • items[] array
  • compound_id
  • compound_name and compound_identifier_value

Error codes

  • missing_api_key
  • invalid_api_key
  • scope_not_allowed
  • quota_exceeded
  • invalid_json
  • invalid_request
  • validation_error
  • method_not_allowed
  • unsupported_api_version
  • job_not_found
  • backlog_high
  • upstream_timeout
  • upstream_error
  • internal_error

Request details

  • q performs a case-insensitive name search.
  • limit defaults to 20 and is clamped to the range 1 through 100.
  • Omitting q returns the first page ordered by compound name.

Response details

  • This is a synchronous GET endpoint.
  • The response always wraps matches in items[].
  • Empty searches return an empty items array rather than an error.

Operational notes

  • Requires x-api-key with the edge:get_decode_compound_id scope.
  • Usage is counted and rate-limit headers are returned when quota data is available.
  • Use returned compound IDs in supported compound filters instead of hard-coding names.

Examples

Request

GET /functions/v1/get_decode_compound_id?q=caffeine&limit=20

Response JSON

{
  "data": {
    "items": [
      {
        "compound_id": "cmp_123",
        "compound_name": "Caffeine",
        "compound_identifier_value": "C8H10N4O2"
      }
    ]
  },
  "meta": {
    "request_id": "req_...",
    "api_version": "2026-07-10"
  }
}

Code examples

curl 'https://api.mymolecules.de/functions/v1/get_decode_compound_id?q=caffeine&limit=20' \
  -H 'x-api-key: $MYMOLECULES_API_KEY' \
  -H 'mymolecules-api-version: 2026-07-10'