De5 APIi49.de5.net ↗
Fetch latest and historical Mark Six draw results for Hong Kong, New Macau, and Old Macau lotteries, plus picture gallery listings, via the i49.de5.net API.
What is the De5 API?
The i49.de5.net API exposes 3 endpoints covering Mark Six-style lottery draw data from Hong Kong, New Macau, and Old Macau sources. The get_latest_draw endpoint returns the most recent draw for any supported lottery, including all 7 ball numbers with colour, zodiac sign, and five-element attributes, as well as the scheduled next draw time. Historical results and a paginated picture gallery round out the available data.
curl -X GET 'https://api.parse.bot/scraper/60ddf69e-dd7a-4e23-994c-9a0933982a2b/get_latest_draw?lottery=hk' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace i49-de5-net-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: i49 Lottery Results SDK — bounded, re-runnable."""
from parse_apis.i49_de5_net_api import I49Lottery, Lottery, PictureGallery, InputFormatInvalid
client = I49Lottery()
# Fetch the latest Hong Kong draw and inspect the winning numbers.
try:
latest = client.draws.latest(lottery=Lottery.HK)
except InputFormatInvalid as e:
print(f"Invalid lottery input: {e.message}")
raise
print(f"Period {latest.period} drawn {latest.draw_time}")
for ball in latest.numbers:
print(f" #{ball.number} {ball.color} {ball.zodiac} {ball.element}")
print(f" Special: #{latest.special_number.number} {latest.special_number.color}")
print(f" Next draw: {latest.next_draw_time}")
# Browse recent historical draws for New Macau, capped at 5.
for draw in client.historical_draws.list(lottery=Lottery.NEW_MACAU, limit=5):
nums = ", ".join(str(b.number) for b in draw.numbers)
print(f"{draw.period} ({draw.draw_date}): {nums} + {draw.special_number.number}")
# Page through the HK picture gallery, taking the first 3 images.
for pic in client.pictures.list(gallery=PictureGallery.HK, limit=3):
print(f"{pic.name} ({pic.year}) {pic.width}x{pic.height} — {pic.image_url}")
print("exercised: draws.latest / historical_draws.list / pictures.list")
Returns the most recent draw for one lottery: period number, draw time, the six main numbers and the special number (each with ball colour, zodiac and five-element attribute), and the scheduled next draw time. One request per call. Times are site-local (Asia/Shanghai) formatted as YYYY-MM-DD HH:MM:SS; next_draw_time_raw keeps the site's original Chinese text including the weekday. An unrecognised lottery code is rejected with a stale_input error.
| Param | Type | Description |
|---|---|---|
| lottery | string | Which lottery to read. |
{
"type": "object",
"fields": {
"period": "draw period number string, e.g. 2026105",
"lottery": "lottery code as passed (hk, new_macau, old_macau)",
"numbers": "array of 6 main balls, each {number (integer), color (red|blue|green), zodiac (Chinese zodiac), element (five-element attribute)}",
"draw_time": "draw timestamp YYYY-MM-DD HH:MM:SS (site local time)",
"lottery_name": "site's Chinese display name of the lottery",
"next_draw_time": "scheduled next draw YYYY-MM-DD HH:MM:SS (seconds are 00 as the site gives minutes only)",
"special_number": "the special (7th) ball in the same shape as numbers[*]",
"next_draw_time_raw": "site's original next-draw text including weekday"
},
"sample": {
"data": {
"period": "2026105",
"lottery": "hk",
"numbers": [
{
"color": "blue",
"number": 31,
"zodiac": "鼠",
"element": "水"
},
{
"color": "red",
"number": 23,
"zodiac": "猴",
"element": "水"
},
{
"color": "red",
"number": 34,
"zodiac": "鸡",
"element": "金"
},
{
"color": "green",
"number": 43,
"zodiac": "鼠",
"element": "金"
},
{
"color": "red",
"number": 29,
"zodiac": "虎",
"element": "土"
},
{
"color": "red",
"number": 8,
"zodiac": "猪",
"element": "木"
}
],
"draw_time": "2026-10-03 21:35:55",
"lottery_name": "香港彩",
"next_draw_time": "2026-10-06 21:35:00",
"special_number": {
"color": "blue",
"number": 48,
"zodiac": "羊",
"element": "火"
},
"next_draw_time_raw": "2026年10月06日 21:35(星期二)"
},
"status": "success"
}
}About the De5 API
Draw Data Coverage
The API supports three lotteries via a shared lottery parameter: hk (Hong Kong), new_macau, and old_macau. The get_latest_draw endpoint returns the most recent draw's period number, draw_time in Asia/Shanghai local time, six main numbers and one special_number. Each ball object includes number (integer), color (red, blue, or green), zodiac (Chinese zodiac animal), and element (one of the five traditional elements). The response also includes next_draw_time and next_draw_time_raw, the latter preserving the site's original weekday text.
Historical Results
The list_draw_history endpoint returns all draws the site lists for the current year in a single response, ordered newest first. At the time this API was built, that represented 105 draws for the Hong Kong lottery and 277 draws each for the two Macau lotteries. Each draw in the draws array carries period, draw_date (YYYY-MM-DD), six numbered balls with color and zodiac, and the special_number. The total field tells you the count of draws returned without needing to count the array yourself. History is scoped to the current year; prior years are not listed on the source site.
Picture Gallery
The list_pictures endpoint pages through the site's image gallery — categories include 跑狗图 and 四不像 tip-sheet images. Pass lottery as either hk or macau and a 1-based page integer. The site fixes page size at 10 pictures regardless of any size request; iterate while has_more is true. Each picture record includes picture_id, name, picture_type_id, classify_id, year, image_url, and big_image_url, giving you both thumbnail and full-size URLs.
The De5 API is a managed, monitored endpoint for i49.de5.net — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when i49.de5.net changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official i49.de5.net API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track the most recent Hong Kong Mark Six draw numbers and ball colours in real time using get_latest_draw.
- Build a results archive for any supported lottery by ingesting all draws from list_draw_history.
- Display Chinese zodiac and five-element annotations alongside each drawn ball for astrological lottery analysis.
- Show countdown or scheduling data using next_draw_time from the latest draw response.
- Aggregate win-frequency statistics across the current year's 105 Hong Kong or 277 Macau draw records.
- Sync tip-sheet images (跑狗图) from the picture gallery by iterating list_pictures with the hk or macau lottery parameter.
- Compare special_number distributions across hk, new_macau, and old_macau for cross-lottery analysis.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.