Skip to content
On this page

Response Format

Encoding

All responses returned from the API are encoded in JSON, unless otherwise noted.

Response Envelope

All responses are returned in a data envelope:

FieldTypeDescription
metaobjectRequest Metadata
dataanyResponse data. Can be any valid JSON value, as documented
errorarrayError Object, if an error occurred

Request Metadata

FieldTypeDescription
idstringRequest ID
nodestringServer node name
msintRequest duration, in milliseconds

Error Object

FieldTypeDescription
codeintError code
msgstringError message
refstring?Error location reference

Error Code

CodeError
0Internal error
1Malformed request
2Unauthorized
100No billing information
101Insufficient credit
200Summarize failed

Examples

Successful response object

From the Execute Search endpoint:

json
{
  "meta": {
    "id": "2a5b8993-d1bf-468b-9766-5afa50727bd4",
    "node": "us-east",
    "ms": 500
  },
  "data": [
    {
      "t": 0,
      "rank": 1,
      "url": "https://kagi.com",
      "title": "Kagi Search",
      "snippet": "Let's fetch!",
    },
    {
      "t": 0,
      "rank": 2,
      "url": "https://browser.kagi.com",
      "title": "Orion Browser by Kagi",
      "snippet": "Incredible performance. Total Protection.",
    }
  ]
}
Error response object

From the Execute Search endpoint:

json
{
  "meta": {
    "id": "bcbf11d2-1afa-4e72-a0ee-2d9079d1d332",
    "node": "us-east",
    "ms": 0
  },
  "data": null,
  "error": [
    {
      "code": 1,
      "msg": "Missing q parameter",
      "ref": null
    }
  ]
}