Błędy
Treść błędu, każdy status i kod z komunikatami oraz które niepowodzenia ponawiać.
Treść błędu
Każdy błąd ma te same trzy pola.
curl -s -G "https://api.dino.markets/v2/odds" \ -d league=nba -d limit=0 \ -H "Authorization: Bearer $DINO_API_KEY"
{
"error": "invalid_request",
"message": "limit must be an integer from 1 to 100; the default is 25.",
"request_id": "req_d2fc23deaa31bd58aff76f3c"
}error to stały kod, według którego można rozgałęziać kod. message jest dla ludzi i może się zmienić. request_id jest też w nagłówku X-Request-Id; podaj go, pisząc do pomocy. Błąd nie kosztuje kredytu.
Kody
| Status | error |
Kiedy | Ponowić |
|---|---|---|---|
| 400 | invalid_request |
Brakuje parametru, jest nieznany lub poza zakresem | Nie, popraw zapytanie |
| 401 | unauthorized |
Brak klucza, klucz błędny lub wyłączony | Nie |
| 404 | not_found |
Nie ma takiej trasy lub meczu o tym id | Nie |
| 405 | method_not_allowed |
Metoda inna niż GET |
Nie |
| 429 | rate_limited |
Za dużo zapytań | Tak, po Retry-After |
| 429 | quota_exceeded |
Na kluczu jest mniej kredytów, niż kosztuje wywołanie | Po odnowieniu kredytów lub zmianie planu |
| 500 | internal_error |
Błąd po naszej stronie | Tak |
| 503 | unavailable |
Usługa się uruchamia, konta są chwilowo niedostępne albo zbyt wiele dużych żądań jest obsługiwanych naraz | Tak, po Retry-After |
Sprawdzenia idą w tej kolejności: gotowość usługi, metoda, trasa, klucz, parametry, mecz, a potem kredyty.
Błędne parametry
Początek message |
Przyczyna |
|---|---|
league is required unless event_ids is given. |
Nie wysłano żadnego z nich |
Unknown league value "xx". |
Dalej w komunikacie są poprawne ligi |
Unknown markets value "foo". lub markets is empty. |
Dalej są poprawne rynki |
Unknown period value "h3". |
Dalej są poprawne okresy |
alternates is not valid: "yes". |
Wyślij true lub false |
Unknown books value "zz". |
Dalej są poprawni bukmacherzy |
Unknown region value "zz". |
Dalej są poprawne regiony |
Unknown status value "done". |
Dalej są poprawne statusy: scheduled, live, finished, all |
start_after is not valid: "...". lub start_before is not valid: "...". |
Wartość nie jest czasem RFC 3339. Wyślij 2026-11-30T00:00:00Z, a przesunięcie + zapisz jako %2B. |
limit must be an integer from 1 to 100 |
limit jest poza zakresem |
cursor is not valid. |
Wyślij next_cursor bez zmian |
Event id "abc" is not valid; ids are 32 characters. |
Błędna wartość w event_ids |
Event id must be 32 characters. |
Błędne id na trasie jednego meczu |
event_ids takes at most 100 ids. |
Za dużo id |
Brak klucza lub błędny klucz
curl -s "https://api.dino.markets/v2/odds?league=nba"
{
"error": "unauthorized",
"message": "API key is missing. Send it as Authorization: Bearer <key> or in the x-api-key header; the apiKey query parameter is not accepted on /v2.",
"request_id": "req_d3d432806099cab5a336380e"
}message |
Przyczyna |
|---|---|
API key is missing. Send it as ... |
Brak klucza lub klucz w adresie URL |
API key is invalid or not tied to a subscription. |
Błędny klucz |
API key has been deactivated. |
Unieważniony klucz |
Nie znaleziono
Nieznana trasa:
curl -s "https://api.dino.markets/v2/nothing" \ -H "Authorization: Bearer $DINO_API_KEY"
{
"error": "not_found",
"message": "No such route.",
"request_id": "req_1b9452db27085ca9a02a0977"
}Mecz zakończony ponad 72 godziny po swoim starcie albo id, którego nigdy nie mieliśmy:
curl -s "https://api.dino.markets/v2/events/00000000000000000000000000000000/odds" \ -H "Authorization: Bearer $DINO_API_KEY"
{
"error": "not_found",
"message": "Event not found. It may have concluded; get current ids from /v2/events.",
"request_id": "req_50075f7ad136112fd6ed700e"
}Błędna metoda
Obsługiwane jest tylko GET. Mówi o tym nagłówek Allow.
curl -s -D - -X POST "https://api.dino.markets/v2/leagues" \ -H "Authorization: Bearer $DINO_API_KEY"
allow: GET
cache-control: no-store
content-type: application/json; charset=utf-8
x-request-id: req_c04acfc031018c7809b5593d
{
"error": "method_not_allowed",
"message": "Only GET is supported.",
"request_id": "req_c04acfc031018c7809b5593d"
}Limity i błędy serwera
| Status | message |
Nagłówek |
|---|---|---|
| 429 | Rate limited. Space requests out over several seconds and try again. |
Retry-After: 1 |
| 429 | This call costs 1 credit and the key has 0 left. ... |
|
| 429 | Usage quota has been reached. Upgrade the plan or wait for the quota to reset. |
|
| 500 | Something went wrong on our side. Try again in a moment. |
|
| 503 | The service is starting up. Try again in a few seconds. |
Retry-After: 10 |
| 503 | Accounts are unavailable. Try again in a few seconds. |
Retry-After: 5 |
| 503 | Too many large requests are being answered right now. Try again in a few seconds, or ask for less: fewer markets, no alternates, one period. |
Retry-After: 2 |
Ostatni 503 pochodzi z wywołań /v2/odds, które proszą o alternates=true, o period inny niż game albo o rynek zawodnika. Na każdym serwerze budowane są naraz trzy takie wywołania; czwarte w tej samej chwili jest odrzucane i nie kosztuje żadnego kredytu. Spróbuj ponownie po odczekaniu albo poproś o mniej rynków lub jeden okres.
Ponawianie
Ponawiaj 429 rate_limited, 500 i 503 z rosnącym, losowym opóźnieniem i limitem prób, a gdy jest Retry-After, czekaj co najmniej tyle. Najpierw napraw 400, 401, 404 i 405. Nie ponawiaj quota_exceeded. Udane ponowienie znów kosztuje kredyt, a jeśli odpowiedź zaginęła, pierwsze wywołanie mogło już zostać policzone.