← Results API

API documentation

Everything /v1 answers: endpoints, parameters, objects and errors, taken from the API's OpenAPI document.

Introduction

Base address
$RC_API/v1/… Every request goes to that address followed by the path. The address is published with sign-up.
Authentication Soon
Authorization: Bearer <token> Every request carries your token in that header. Tokens come with sign-up.
Dates and times
A date (YYYY-MM-DD) is each draw's local day: you never convert time zones. Times, like drawAt, are in UTC, as ISO 8601.
Responses
JSON in UTF-8. Only successful (2xx) answers are billed.

Endpoints

GET /v1/results

Every official draw of one day.

Parameters

datedate· query · requiredThe day, as the draws' local date.

Returns V1DayPossible statuses 200400401403429500

GET /v1/lotteries

The available lotteries, with the days they draw.

Parameters

No parameters.

Returns V1LotteriesPossible statuses 200401429500

GET /v1/lotteries/{id}/results

One lottery's history between two dates, one day per date.

Parameters

idinteger· path · requiredThe lottery's id, from /v1/lotteries.
fromdate· query · requiredFirst day of the range, included.
todate· query · requiredLast day of the range, included. Up to 400 days after from, within your plan's history.

Returns V1LotteryResultsPossible statuses 200400401403404429500

GET /v1/coverage

The first and the last day with official results.

Parameters

No parameters.

Returns V1CoveragePossible statuses 200401404429500

Objects

V1Day

One day's official draws.

FieldTypeDescription
datedateThe day, as the draws' local date.
generatedAtUTC date and timeWhen the answer was generated.
drawslist of V1DrawThe official draws your plan already sees.

V1Draw

An official draw.

FieldTypeDescription
idstringThe draw's id on that day.
lotteryIdintegerIts lottery's id.
lotterystringThe lottery's name.
sortitionstringThe draw's name.
countryone of unitedStates, dominicanRepublic, haiti, anguilla, sintMaarten, honduras, elSalvador, bonaire, panamaThe lottery's country.
datedateThe draw's local day.
drawAtUTC date and timeWhen it was drawn, in UTC.
numberslist of V1NumberThe numbers drawn, in order.

V1Number

One number of the result.

FieldTypeDescription
fieldone of first, second, third, pickTwo, pickThree, pickFour, pickFive, pickFourSecond, pickFourThirdWhich position or game it is: first, second and third in Dominican lotteries; pickTwo to pickFive in American ones.
displaystringThe number as published, zero-padded.

V1Lotteries

The API's lotteries.

FieldTypeDescription
lotterieslist of V1LotteryEach available lottery.

V1Lottery

A lottery.

FieldTypeDescription
idintegerIts id, the one the other paths use.
namestringIts name.
slugstringIts URL name.
schedulelist of integerThe days of the week it draws: 0 is Sunday, 6 is Saturday.

V1LotteryResults

A lottery's history.

FieldTypeDescription
lotteryV1LotteryThe lottery asked for.
dayslist of V1DayEach day of the range, with its draws.

V1Coverage

The range of dates with official results.

FieldTypeDescription
earliestdateThe first day with results.
latestdateThe last day with results.

ErrorResponse

The body of every error answer.

FieldTypeDescription
erroroptionalone of internal, method.not_allowed, not_found, request.invalid, request.param.invalid, request.too_large, v1.plan_history, v1.quota_exceeded, v1.rate_limited, v1.unauthorizedThe error code.
paramsoptionalobject of stringsDetails, like the parameter that failed.

Errors

Every error answers with an ErrorResponse object and the matching HTTP status.

CodeDescription
internal500 · Server error. Try again.
method.not_allowed405 · That path only accepts GET.
not_found404 · The lottery or the path does not exist.
request.invalid400 · The request could not be read.
request.param.invalid400 · A parameter is not valid; params.name says which.
request.too_large413 · The request is too large.
v1.plan_history403 · The date is outside your plan's history.
v1.quota_exceeded429 · You reached your plan's monthly limit.
v1.rate_limited429 · You reached your plan's per-minute limit.
v1.unauthorized401 · The token is missing or not valid.

429 answers carry a Retry-After header: the seconds to wait before calling again, at least 1.

Limits by plan

PlanPer minutePer monthDelayHistory
Basic101,00015 min delay30 days
Pro6050,0005 min delay400 days
Ultra300500,000Real time400 days
Mega1,0003,000,000Real time400 days

OpenAPI

The full /v1 contract, to generate your client.

Download openapi.yaml