Skip to content

Start building

Your first call, from your own language.

Thin PHP, JavaScript and Python libraries, a Postman collection and a free sandbox key — a first result in minutes.

1. Get a sandbox key

A sandbox key is free and needs no plan: create one from API keys in your workspace. It starts with lv_test_, reads one game — EuroMillions (EU-002), the one every example below calls — and its real results: the latest 50, each once it is seven days old. It has its own allowance of 1,000 requests a day and 60 a minute, so it never spends your plan's quota.

Sandbox keyPlan key
GamesEU-002 onlyper plan
Catalogue, schedule, complianceyesyes
Results, the latest result, the ticket checkeronce 7 days oldas soon as they land
Historythe latest 50 resultsas far back as the plan includes
Announced jackpot (upcoming.jackpot)null, jackpot_status: delayedyes
Statistics, freshness, data quality, stream, webhooks403 insufficient_scopeper plan

Another game answers 403 lottery_not_entitled. A result newer than the delay, or older than the latest 50, is refused by id with 403 history_not_included; listings simply stop before it. GET /v1/account gives the boundaries as key.lottery_codes, key.history_until and plan.history_draws.

2. Install a library

Each one is a thin client with no dependencies: every endpoint is a method, the response is the decoded JSON, and a refusal raises an error carrying the stable code.

Code example
composer require lottevo/lottevo-php   # PHP 8.1+
npm install lottevo                    # Node 18+, Deno, Bun; typed for TypeScript
pip install lottevo                    # Python 3.8+

3. Make the call

Set the key in LOTTEVO_API_KEY, then read EuroMillions' latest results.

Code example
$lottevo = new Lottevo\Client(); // reads LOTTEVO_API_KEY

foreach ($lottevo->lotteries->draws('EU-002', ['per_page' => 5])['data'] as $draw) {
    echo $draw['drawn_at'], ' ', implode(' ', $draw['numbers']), PHP_EOL;
}
Code example
import { Client } from 'lottevo'

const lottevo = new Client() // reads LOTTEVO_API_KEY
const { data } = await lottevo.lotteries.draws('EU-002', { per_page: 5 })
Code example
from lottevo import Client

lottevo = Client()  # reads LOTTEVO_API_KEY
draws = lottevo.lotteries.draws("EU-002", {"per_page": 5})["data"]

The methods follow the API: lotteries.list, lotteries.get, lotteries.draws, draws.list, draws.latest, lotteries.check, webhooks.create, and so on — the reference lists them all. Filters go in the query as they do on the wire: { filter: { lottery: ['EU-002', 'RO-001'] } } is sent as filter[lottery]=EU-002,RO-001.

Pagination and errors

paginate() walks a listing to its end from the first page, following links.next:

Code example
for await (const lottery of lottevo.paginate(await lottevo.lotteries.list())) {
  console.log(lottery.code)
}

A refused call raises LottevoException (PHP) or LottevoError (JavaScript, Python) with status, the stable code ($e->apiCode in PHP, since PHP's own getCode() is the HTTP status), the request ID and, on a 429, how long to wait. Branch on code — see Errors.

Postman and OpenAPI

Fork the collection from our public Postman workspace, or import the file, then set its apiKey variable to your key and send. Every request of the API is there, grouped like the reference, with lottery preset to EU-002.