Keys, limits and errors
How to send your key, which APIs your plan includes, how requests are counted and what errors mean.
On this page
Keys
Send the key in the Authorization header as Bearer <key>. The X-Api-Key header also works. Never put the key in the URL.
Authorization: Bearer tsm_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- Every plan allows one unrevoked API key per account. Expired keys still occupy the slot until revoked. Revoking or replacing a key does not reset your account’s daily usage.
- Copy the secret when creating the key; it cannot be viewed again.
Key lifetime and changes
- Your key expires on the date shown in the dashboard. Access always follows your account’s current plan, regardless of the key’s tsm_test_ or tsm_live_ prefix.
- Plan and allowlist changes may take up to 60 seconds. Revoking a key takes effect immediately.
Response language
All public football endpoints accept locale=zh-HK, locale=zh-CN or locale=en. An explicit locale takes priority over a supported Accept-Language header. If neither selects a supported language, the API uses zh-HK. Empty, repeated or unsupported locale values return 400 invalid_parameter. The website language does not select the Playground response language.
GET /v1/football/matches/live
GET /v1/football/matches/live?locale=zh-CN
GET /v1/football/matches/live?locale=enHuman-readable names and labels, including nested raw JSON, follow the requested language. English responses omit untranslated Chinese fields or use an English unavailable label where a value is required. Original/name_ch fields containing Chinese text and private provider metadata are omitted. Public IDs, numeric values and fixed codes remain stable. AI reports require a published version in the requested language; otherwise the API returns 404.
Content-Language identifies the selected language, including exchange and HKJC responses. Numeric corner analysis and plan/limit metadata remain language neutral. For caching, keep locale in the URL cache key and honor Cache-Control and Vary, including Accept-Language and protected credential headers.
Daily quota and per-minute limit
Your account has a daily quota: the number of requests you can make each day. It resets at 00:00 Hong Kong time (16:00 UTC). Each key also has a per-minute limit. Replacing a key does not reset the daily count.
A rate limit returns 429 and Retry-After. Wait before retrying; refused requests do not use the daily allowance.
Free fixture-list requests each day
Every plan includes free daily requests to GET /v1/football/matches: Free 50, Plus 500, Pro 2000. These are used before your daily quota. /matches/live and match details use the daily quota. Both daily allowances reset at midnight Hong Kong time. Replacing a key does not reset usage, and per-minute limits still apply. X-Matches-Bonus-* headers show the free fixture-list allowance on that endpoint.
Response headers
| Header | Meaning |
|---|---|
| X-RateLimit-Limit | Requests allowed this minute. |
| X-RateLimit-Remaining | How many are left this minute. |
| X-RateLimit-Reset | Seconds until the minute rolls over. |
| X-Quota-Limit | Requests per day allowed for the account; excludes the separate fixture-list allowance. |
| X-Quota-Remaining | Requests left in the account’s daily quota. Usage with revoked keys still counts. |
| X-Quota-Reset | Seconds until 00:00 Hong Kong time (16:00 UTC). |
| X-Matches-Bonus-Limit | Free fixture-list requests per day for the account (GET /v1/football/matches). Present on that endpoint only. |
| X-Matches-Bonus-Remaining | Free fixture-list requests left for the account today. Used before the daily quota. |
| X-Matches-Bonus-Reset | Seconds until the fixture-list allowance resets at 00:00 Hong Kong time. |
Need more requests? Compare the plans on pricing page.
IP allowlisting
An IP allowlist restricts a key to the addresses you add. It is optional: an empty list allows requests from any IP. To restrict access, add the public IP addresses your server uses to send requests.
- Single addresses or CIDR blocks, no broader than /24 (IPv4) or /48 (IPv6).
- Private and loopback ranges are rejected — this API never sees them.
- If an IP restriction blocks a request, the response shows the public IP address the API received. Use it to check which address your server is sending from.
Responses and pagination
Most endpoints return JSON under data. /matches also includes pagination meta; /matches/live is not paginated. /odds/exchange returns its stored JSON directly. kickoffUtc is ISO-8601 UTC, while historical analysis dates retain their stored format. Missing optional properties are omitted. Follow the response schema for each endpoint.
"meta": { "page": 1, "pageSize": 300, "total": 650, "totalPages": 3 }For /matches and /odds/betfairmatchids, page starts at 1; pageSize defaults to 300 and is capped at 400.
Errors
Errors come back as JSON with a code field. Check code in your program; the message text may change.
Example error response
{
"type": "https://tipsme.hk/developers/docs/errors#quota_exceeded",
"title": "Daily quota exceeded",
"status": 429,
"detail": "This account allows 5000 plan requests per day. The quota resets at 00:00 Hong Kong time (16:00 UTC).",
"code": "quota_exceeded"
}| Status | code | Meaning |
|---|---|---|
| 400 | invalid_parameter | A parameter failed validation; the body names which. |
| 401 | unauthorized | No key was sent. |
| 401 | key_invalid | Unknown or revoked key. |
| 403 | key_expired | The key has passed its expiry date. |
| 403 | tier_insufficient | Analysis and structured Betfair summaries require a Plus or Pro API key. Free keys receive 403 without spending daily quota. Existing common odds APIs and Betfair match-ID discovery remain available on all plans. |
| 403 | historical_access_required | The match is older than the last 30 Hong Kong calendar days including today. An active historical-access grant is required, in addition to the endpoint’s usual plan requirements. The refusal does not spend daily quota but counts toward the rate limit. |
| 403 | ip_not_allowed | The calling address is not on this key’s allowlist. |
| 404 | not_found | No such resource. |
| 409 | key_limit_reached | This account already has its one allowed API key. Revoke it before creating another. |
| 409 | allowlist_limit_reached | This key already has the maximum allowlist entries. |
| 429 | rate_limited | Per-minute limit exceeded. See Retry-After. |
| 429 | quota_exceeded | The account’s daily quota is spent. It resets at midnight Hong Kong time (16:00 UTC). |
| 502 | upstream_malformed | Upstream answered but the payload could not be parsed. |
| 503 | upstream_unavailable | A data source is temporarily unreachable. Retry. |
Start on the free tier
One API key, 30 requests per day per account, plus 50 free fixture-list requests per day. Real data, no card required.
