OngLai4D · 旺来

Developer API

A free, read-only JSON API for Malaysia 4D results — latest draws, history by date, per-number records, and jackpot growth. Build a bot, a widget, or your own analysis.

Quick start

No key needed to try it — just call an endpoint. Base URL:

curl https://onglai4d.com/api/v1/results/latest

Plans

The API is free to try with no key at all. Keys raise the limits; paid plans are for sites and apps in production.

No key

Free

Try it right now — no signup, nothing to configure.

  • All five endpoints
  • ~30 request burst, about 1 request every 2 seconds
  • No daily quota tracking
  • Fine for testing and hobby scripts
Request a key

Free key

Most popular
Free

For a personal site, a bot, or a weekend project.

1,000 requests / day
  • 1,000 requests a day
  • 4 requests per second sustained
  • Usage headers on every response
  • Email support, best effort
Request a key

Starter

RM 39 /month

For one commercial site or app that people actually use.

25,000 requests / day
  • 25,000 requests a day
  • 4 requests per second sustained
  • Commercial use permitted
  • Draw-night priority — we watch the pipeline every draw
Request a key

Business

RM 149 /month

For multiple properties, or an app with real traffic.

250,000 requests / day
  • 250,000 requests a day
  • Multiple keys, one per property
  • Full historical archive access
  • Direct line for incidents
Request a key

White-label site

Let's talk

We build and run the whole site under your brand and domain.

  • Your brand, your domain, your audience
  • Same data pipeline as OngLai4D
  • We handle scraping, hosting and draw nights
  • You do not touch a scraper, ever
Talk to us

Keys are issued by hand — email hello@onglai4d.com and you will normally have one within a day. No card, no signup form, no subscription you have to cancel.

Authentication & rate limits

Anonymous — works with no key, but is burst-limited and best-effort. Fine for trying the API and light use.

With an API key — an authoritative daily quota (default 10,000 req/day) and a higher burst allowance. Send it as a bearer token:

curl -H "Authorization: Bearer ol_live_xxx" \
     https://onglai4d.com/api/v1/results/latest

# or as a query param:
curl "https://onglai4d.com/api/v1/results/latest?key=ol_live_xxx"

Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Tier headers. Over quota returns 429 with Retry-After. Quotas reset at 00:00 UTC.

Want a key? Email hello@onglai4d.com with a one-line description of your use case.

Endpoints

GET/api/v1/results/latest

Most recent draw for every operator.

curl https://onglai4d.com/api/v1/results/latest

{
  "results": [
    { "operator": "magnum", "operatorName": "Magnum 4D",
      "drawDate": "2026-07-15", "first": "1234",
      "second": "5678", "third": "9012",
      "special": ["..."], "consolation": ["..."] }
  ]
}
GET/api/v1/results/date/{YYYY-MM-DD}

All operators' results for a specific draw date.

curl https://onglai4d.com/api/v1/results/date/2026-07-15
GET/api/v1/numbers/{4-digits}

Full win history and breakdowns for one 4-digit number, across 40+ years.

curl https://onglai4d.com/api/v1/numbers/8004

{
  "number": "8004", "total": 49,
  "lastDrawn": "2026-06-30", "firstDrawn": "1986-...",
  "byOperator": [ { "operator": "magnum", "count": 9 } ],
  "byPrize":    [ { "prize": "1st Prize", "count": 3 } ],
  "history":    [ { "date": "...", "operator": "...",
                    "prize": "..." } ]
}
GET/api/v1/jackpots/{operator}?limit=120

Jackpot growth series for an operator, oldest → newest (Magnum has the deepest history).

curl https://onglai4d.com/api/v1/jackpots/magnum?limit=30

{
  "operator": "magnum",
  "series": [ { "date": "2026-07-15",
                "jackpot1": 5637289.82,
                "jackpot2": 326086.40 } ]
}
GET/api/v1/operators

The operator vocabulary used across the API.

curl https://onglai4d.com/api/v1/operators

Errors

Errors are JSON with a stable code field. Statuses: 400 bad input, 401 unknown key, 403 revoked key, 429 rate/quota.

{ "error": { "code": "quota_exceeded",
             "message": "Daily quota of 10000 requests reached. Resets at 00:00 UTC." } }

Embeddable widget

Show live Malaysia 4D results on your own site with one line — no API key, no JavaScript. Just an iframe:

<iframe src="https://onglai4d.com/widget"
        width="420" height="360" style="border:0"
        title="Malaysia 4D Results"
        loading="lazy"></iframe>

Options via query string: ?theme=dark and ?operators=magnum,toto,damacai (any of magnum, toto, damacai, sabah88, stc, cashsweep, singapore).

The widget is read-only and self-contained; it's the only page we allow to be framed.

Fair use

Results are aggregated from public sources and provided as-is, with no warranty — verify against the official operator before acting on them. Cache where you can, don't hammer, and a link back to onglai4d.com is appreciated.