Developer API Β· REST Β· Real-Time
Betloy Conversion API β Integrate Bet Code Conversion into Your Platform
A powerful, reliable API for businesses and developers to convert bet codes programmatically across 100+ bookmakers
# Convert a bet code from Bet9ja to Sportybet curl -X POST https://test-dev.betloy.com/api/v1/convert \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "booking_code": "B3US96U", "from_bookie_id": 1, "to_bookie_id": 2 }'
// Any HTTP client works; Node 18+ has fetch built in. const res = await fetch('https://test-dev.betloy.com/api/v1/convert', { method: 'POST', headers: { 'X-API-Key': process.env.BETLOY_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ booking_code: 'B3US96U', from_bookie_id: 1, to_bookie_id: 2, }), }); const { data } = await res.json(); console.log(data.status); // β "completed" console.log(data.converted_code); // β "SP9KQM2"
# pip install requests import os, requests res = requests.post( 'https://test-dev.betloy.com/api/v1/convert', headers={'X-API-Key': os.environ['BETLOY_API_KEY']}, json={ 'booking_code': 'B3US96U', 'from_bookie_id': 1, 'to_bookie_id': 2, }, ) data = res.json()['data'] print(data['status']) # β "completed" print(data['converted_code']) # β "SP9KQM2"
$ch = curl_init('https://test-dev.betloy.com/api/v1/convert'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'X-API-Key: ' . getenv('BETLOY_API_KEY'), 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'booking_code' => 'B3US96U', 'from_bookie_id' => 1, 'to_bookie_id' => 2, ]), CURLOPT_RETURNTRANSFER => true, ]); $data = json_decode(curl_exec($ch), true)['data']; echo $data['converted_code']; // β "SP9KQM2"
Request body
{
"booking_code": "B3US96U",
"from_bookie_id": 1,
"to_bookie_id": 2
}
Response (201 Created)
{
"success": true,
"data": {
"id": 12345,
"status": "completed",
"booking_code": "B3US96U",
"converted_code": "SP9KQM2",
"error_message": null
}
}
Reference
Endpoints
All endpoints are under https://test-dev.betloy.com/api/v1 and require an X-API-Key header. JSON in, JSON out. Read endpoints are free; chargeable calls only spend a credit when they succeed.
| Method | Endpoint | Purpose | Credits |
|---|---|---|---|
| GET | /bookmakers | List the live bookmaker catalogue. Use the returned id for conversions. | Free |
| GET | /bookmakers/{id} | Get one bookmaker by its database id. | Free |
| GET | /tools | Tool discovery: every tools endpoint with its credit cost. | Free |
| GET | /tools/bookmakers | Bookmakers the tools engine supports. Use the bookie_id from this list in every tools call. | Free |
| POST | /tools/decode | Decode a code into legs, markets, selections and odds (Bet Viewer). | Free |
| POST | /tools/rebuild | Apply leg edits and rebuild a code, optionally for another bookmaker (Bet Editor). | 1 |
| POST | /tools/trim | Drop or soften legs until the slip fits the destination and stake (Bet Slip Saver). | 1 |
| POST | /tools/scan | Scan one code across destination bookmakers and rank the payouts (Odds Scanner). | 1 |
| GET | /tools/scan/{scan_id} | Poll an asynchronous scan until it reports done. | Free |
| POST | /tools/leg-options | List alternative markets and lines for one leg before editing it. | Free |
| POST | /convert | Convert a booking code and return the new code, status and error message. | 1 |
| GET | /convert/{id} | Get the status and result of one of your conversions. | Free |
| GET | /conversions | Paginated conversion history for your business, newest first. | Free |
| GET | /usage | Current tier, credit balance, monthly requests and conversion totals. | Free |
| GET | /usage/summary | Daily request counts for the last 30 days. | Free |
| GET | /webhooks | List your webhook subscriptions. | Free |
| POST | /webhooks | Subscribe a URL to conversion.completed and conversion.failed events. | Free |
| PUT | /webhooks/{id} | Update a webhook's URL, events or active status. | Free |
| DELETE | /webhooks/{id} | Delete a webhook. | Free |
| POST | /webhooks/{id}/test | Deliver a signed ping event to verify your endpoint. | Free |
| GET | /api-keys | List your key metadata. Secret values are never returned. | Free |
| POST | /api-keys | Create a key and return the plain value once. | Free |
| DELETE | /api-keys/{id} | Revoke a key. | Free |
Authentication
Send Your Key in the X-API-Key Header
All endpoints expect an X-API-Key header containing your key. An Authorization: Bearer YOUR_API_KEY header is also accepted. Create and manage keys in the business API keys page β keys are scoped to your business and inherit its tier, credit balance and rate limits.
Never expose your key in client-side code (browser JavaScript, mobile app bundles). For public-facing apps, use the Conversion Widget or proxy requests through your own backend so the key stays server-side.
What To Expect
Rate Limits & Status Codes
When to Use the API
Six developer scenarios where direct API access beats the website or widget.
You run a tipster site at volume
Posting 50+ codes a day across multiple bookmakers? The API converts in bulk via your CMS pipeline β no manual rework, no widget clicks.
For lower volume β use the widgetYou're building a mobile app
Native iOS/Android apps can't easily embed a web widget. Hit the API directly from your backend, render results in your own UI components.
Talk to us about your integrationYou're running a betting bot
Discord bots, Telegram bots, custom Slack integrations β the API is the right surface. Get JSON, render to your platform's message format.
Or use our Telegram botYou're doing analytics on bet codes
Need to decode hundreds of codes? POST /tools/decode returns every leg, market and price as structured JSON, and GET /conversions returns your own conversion history β enough to build your own backtest tooling.
You're an affiliate marketing platform
Use POST /tools/scan to programmatically surface the best-odds bookmaker per fixture for your affiliates β drive higher commissions on each conversion.
You need full UX control
The widget is fast but opinionated. The API is stateless β you decide everything: layout, branding, error handling, and what to do with legs the engine could not price.
Get an enterprise quoteBookmakers Your API Calls Can Convert To
Recommended Bookmakers
Every bookmaker accessible via the API also has a Betloy affiliate offer your end users can claim.
Bookmaker availability changes; use GET /bookmakers for the live list. Find the full list of bonuses on our promo codes hub.
All 100+ Bookmakers the Betloy API Supports
The /convert endpoint supports every bookmaker on this list β pass from_bookie_id and to_bookie_id in the JSON body and we return a ready-to-stake code. Use GET /bookmakers for the live list and ids.
π³π¬ Nigeria & West Africa
π°πͺ East Africa
πΏπ¦ South & Southern Africa
π International & Global
Don't see your bookmaker? Request it β
Why Build On The API
The Same Engine That Powers The Whole Site
Every Betloy product β the website converter, the Telegram bot, the conversion widget, the embeddable Bet Slip Saver and AI Analyzer β runs on the same backend. The API is that backend, exposed for direct access. When we improve the conversion accuracy or add a new bookmaker, every API consumer gets the upgrade automatically.
That includes the 88.72% conversion success rate across supported bookmaker pairs, the multi-sport accumulator handling, the leg-flagging behaviour (when a market can't be matched, we tell you instead of silently substituting), and the per-bookmaker market mapping that we update whenever a supported book changes its code format.
If you're building anything that touches African bet codes β tipster sites, mobile apps, analytics pipelines, custom bots, affiliate platforms β the API is the most direct path. The widget wraps it for no-code embeds; the Telegram bot wraps it for chat. The API itself gives you everything else.
API FAQs
Everything we get asked about the Betloy REST API. If your question isn't here, drop us a line.