Getting started

Errors

Use this page to handle a failed request. Every error is built the same way, so one handler covers every endpoint.

1. Read the error

An error is JSON with an error object. code is stable, so branch on it. message is for people. A 400 also carries fields, a list of problems for each parameter.

curl "https://odds-feed.on-forge.com/api/v2/matches?cup=maybe&limit=0" \
  -H "Authorization: Bearer YOUR_KEY"
Response
{
  "error": {
    "status": 400,
    "code": "bad_request",
    "message": "The request was invalid.",
    "fields": {
      "limit": ["The limit field must be at least 1."],
      "cup": ["The cup field must be 1, 0, true or false."]
    }
  }
}

2. Handle a missing ability

A key without the ability an endpoint needs, or a plan without the markets you asked for, gets a 403 with the code not_entitled. Here the key only has fixtures:read.

curl "https://odds-feed.on-forge.com/api/v2/odds?matches=0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70" \
  -H "Authorization: Bearer LIMITED_KEY"
Response
{
  "error": {
    "status": 403,
    "code": "not_entitled",
    "message": "This key lacks the markets:read ability."
  }
}

3. Handle a missing record

An unknown id, or one that is not a UUID, gets a 404. The code says what was not found.

curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-0000-7000-8000-00000000dead" \
  -H "Authorization: Bearer YOUR_KEY"
Response
{
  "error": {
    "status": 404,
    "code": "match_not_found",
    "message": "No match has this id."
  }
}

4. Decide whether to retry

Status Retry
400, 401, 403, 404 No. Change the request, the key or the plan.
429 Yes, after the seconds in Retry-After. See Rate limits.
500 Yes, after a short wait.

Every code is listed in Error codes.

Odds Yorkie

Prices are shown as bet365 offers them. OddsYorkie supplies data only and does not take bets. 18+ only. BeGambleAware.org