Skip to content
datasportsAPI

05Website widgets

Put live sport on a page without building a backend.

A live score list, a single match card or a league table, drawn by one script and sized to sit in your layout. The key behind it is publishable: it only answers on the sites you list, and only for the endpoints the widgets read.

The play

Four calls. Final whistle: live on your site.

Each marker is a request. Each run carries its ids to the next.

read it left to right
  1. 1

    Load the script once

    Create a publishable dsa_pub_ key in the dashboard's Widgets tab and name the sites allowed to use it. Add the script once per page; every widget element on it comes alive.

    GETWidget script: https://datasportsapi.com/embed/v1.jsPro + Business
  2. 2

    A live score list

    The livescore type takes a data-sport and shows that sport's live matches grouped by league. Add data-league to narrow it to one competition.

    GETLive scores: /v2/livescoresAll plans
  3. 3

    A match card

    The match type tracks the single fixture named in data-fixture (status, score, goals, cards and substitutions) and refreshes itself.

    GETFixture: /v2/fixtures/{id}All plans
  4. 4

    A league table

    The standings type prints a season's main table from data-league, the newest season unless you pin one with data-season.

    GETStandings: /v2/leagues/{id}/standingsAll plans

In your HTML

Paste, publish, done

Put one element where each widget belongs, then include the script a single time with your publishable key. Each widget draws inside its own shadow root, which keeps your stylesheet out of it.

Key
A publishable dsa_pub_… key, never your dsa_live_… secret
Types
livescore · match · standings
Script
https://datasportsapi.com/embed/v1.js
Prefer code? The SDKs and CLI
<div data-dsa-widget="livescore" data-sport="football"></div>
<script src="https://datasportsapi.com/embed/v1.js" data-key="dsa_pub_…" async></script>
Sample data
footballLive

England · Premier League

  • 63′ArsenalChelsea11

Spain · LaLiga

  • 37′Real MadridAthletic Club20

Türkiye · Süper Lig

  • 12′GalatasarayFenerbahçe00
data-size="small" in a sidebar. Matches and scores here are sample fixtures, not a live feed.

Field notes

Worth knowing before launch.

  1. Sizes: small for a sidebar (up to 340 px), medium for a content column (up to 640 px, the default), large for full width.

  2. Themes: light, dark or auto to follow the visitor. data-accent takes a hex colour, data-refresh any interval from 15 seconds.

  3. Used from a site that is not on its list, a publishable key answers 403 origin_not_allowed.

Which plan

Goes live on Pro.

Widgets come with Pro and Business. Every refresh is an ordinary request against your quota, so size the plan to your traffic: at the default 30-second refresh, a single livescore widget kept open by 100 visitors for an hour costs 12,000 requests.

  1. Free

    01

    $0/ month

    1,000 requests / day

    Widgets are not included. Build the rest of your integration here first.

  2. Starter

    02

    $49/ month

    250,000 requests / month

    Widgets are not included on Starter.

  3. Fits this play

    Pro

    03

    $199/ month

    1,000,000 requests / month

    All three widget types, publishable keys and a million requests a month.

  4. Business

    04

    $999/ month

    10,000,000 requests / month

    Ten million requests a month for pages with heavy traffic.

Build the page on a free key, switch the widgets on with Pro.

1,000 free requests a day during the beta. No card, no sales call.