Guide

Errors

Every error is JSON with a code you can branch on and a message that says what to do.

Errors carry an HTTP status and a body like this:

{
  "error": "allowance_used",
  "message": "This month's 50000 requests are used. Add credit at https://thelobbynews.com/account/api to keep going."
}

Codes

400 bad_requestA parameter is missing, unknown or out of range.
400 bad_cursorThe cursor is from another list or was altered.
401 invalid_keyA malformed key, or one that was revoked.
402 payment_requiredNo key at all. The body says how to get one, and agents get the ways to pay per request.
402 no_planThe key’s account has no live plan.
402 allowance_usedThe month’s allowance is used and there is no credit account yet.
402 insufficient_creditsThe allowance is used and the credit balance is below the price of the request.
403 plan_upgrade_requiredThe endpoint is on a plan the key’s account does not have.
403 suspendedAPI access on the account is suspended.
404 not_foundNo such record, or no such endpoint. Never charged.
429 rate_limitedOver the per-minute limit. Wait Retry-After seconds.
503 unavailableSearch is briefly unavailable. Never charged; retry after Retry-After.
500 internal_errorOur fault. Never charged.