GET STARTED

Errors

An error answers with an HTTP status and a JSON body that names it.

The error body

Every error has the same body: a code to match on and a message for people.

{
  "error": {
    "code": "not_found",
    "message": "No medicine has ID MED-999999"
  }
}

Error codes

Each error has a code and a message.
  • 400 bad_requestA bad parameter, such as limit=0, a time in another form, or a missing q.
  • 401 unauthorizedNo key, an unknown key or a revoked key. The answer never says which.
  • 403 plan_expiredThe key's account has no active plan.
  • 404 not_foundNo medicine has that ID or UUID.
  • 429 rate_limitedMore requests in a minute than the key's plan allows.
  • 429 quota_exceededThe plan's requests for this month are used up.
  • 500 internalA fault on our side. The details go to our log, not the answer.

Handling errors

Match on error.code, not on message: the message is for people and may change.

After a 429, wait the seconds in the Retry-After header. A 400, 401, 403 or 404 gives the same answer if you send the same request again.