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
api_balancefloatRemaining API Balance, in dollars

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": "ec420bfd904acf489f741494c87a50e7",
    "node": "us-central1",
    "ms": 231,
    "api_balance": 123.456
  },
  "data": [
    {
      "t": 0,
      "url": "https://kagi.com/",
      "title": "Kagi Search - A Premium Search Engine",
      "snippet": "Better search results with no ads. Welcome to Kagi (pronounced kah-gee), a paid search engine that gives power back to the user."
    },
    {
      "t": 0,
      "url": "https://kagi.com/orion",
      "title": "Orion Browser by Kagi",
      "snippet": "Orion offers native support for many Firefox and Chrome browser extensions allowing access to the world's largest eco-system of browser extensions. ",
    }
  ]
}
Error response object

From the Execute Search endpoint:

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