Skip to content
substring

API

Quick start

curl 'https://api.substring.app/search/?q=bst&limit=3'
{
  "query": "bst",
  "total_matches": 343,
  "page": 1,
  "total_pages": 115,
  "results": [
    "abstain",
    "abstained",
    "abstainer"
  ],
  "rarities": null,
  "sections": [
    {
      "key": "a",
      "count": 73,
      "offset": 0
    },
    "…"
  ],
  "suggestions": null
}

Base URL

  • https://api.substring.app

Authentication

Most requests need none. A session token (Authorization: Bearer …) raises your limits, and exports and regex searches need one (401 without).

Browsers can call it only from substring.app.

Response headers

  • X-Request-IDIdentifies the request. Quote it when reporting a problem.
  • Server-TimingTime spent in the API, in milliseconds.
  • X-FastAPI-CacheHIT when the answer came from the API's cache.
  • Retry-AfterOn a 429: seconds until the limit resets.

Errors

  • 400The query can't run, such as an invalid regular expression.
  • 401Needs a token: exports and regular-expression searches, or a token that expired.
  • 403Premium only.
  • 422A parameter is out of range; detail names it.
  • 429Rate limited. Wait for Retry-After seconds.

Errors are JSON with a "detail" field.

Schema