Developers
Public API and widget
Clubs want fixtures and tables on their own websites, and other tools need to read the data. The public API is read-only JSON, and the widget is a live table and the next fixtures to embed anywhere.
Keys
Each consumer has its own key: in the admin, System, API keys, "Create". The key is shown once, when it's made, and kept only as a hash. A key can be kept to some websites (a widget then shows only there), and revoked: anything using it stops working at once. The list shows how much each key is used and when last.
Endpoints
Send the key in the X-Api-Key header, or as the key query. Every answer is {"data": ...}.
| Endpoint | What |
|---|---|
GET /api/public/v1/competitions | Competitions, with their divisions and stages |
GET /api/public/v1/competitions/{slug}/fixtures?from=YYYY-MM-DD&to=YYYY-MM-DD | Published fixtures |
GET /api/public/v1/competitions/{slug}/results | The latest confirmed results |
GET /api/public/v1/stages/{id}/table | A stage's table, group by group |
Answers may be cached for a minute (Cache-Control: public, max-age=60) and read from any site (CORS). Each
key may make 120 requests a minute; beyond that the answer is 429, with Retry-After. A wrong or revoked key
is 401; a key used on a site it isn't kept to is 403.
The widget
Paste where the table should show:
<div data-sports-widget="harbour-five-a-side" data-key="pk_..."></div>
<script src="https://<your site>/widget.js" async></script>
data-stage picks a stage other than the first. The widget sits in a frame that grows to fit its content, and
refreshes itself every minute, so a result entered shows on the club's site a minute later at most.
Found a mistake? Tell us.