Live football scores API in JavaScript
Show every match currently in play, with score, minute and period, using one request. You need an API key, which switches on when your 14-day trial starts (card required, nothing charged until the trial ends).
Reviewed 2026-10-14
1. Get your API key
Register, start the 14-day trial, and copy your key from the dashboard. Keep it out of your code and out of browser JavaScript: set it as an environment variable and call the API from a server (Node, a serverless function or a backend route). A key in front-end code can be copied by anyone who opens the page.
export PREDICTIQ_KEY="your_key_here"2. Request the live feed
The live feed returns all matches in play: teams, logos, score, minute and period. It needs your key in the Authorization header. A missing or invalid key is refused, so check the status code.
const API = "https://api.predictiqpro.com";
const headers = { Authorization: `Token ${process.env.PREDICTIQ_KEY}` };
const res = await fetch(`${API}/live/feed`, { headers });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());3. Refresh on an interval
Poll every 20 to 60 seconds. That is plenty for a score strip and keeps your usage low. Don't poll faster than 20 seconds: the feed is cached on our side, so you gain nothing.
async function refresh() {
const res = await fetch(`${API}/live/feed`, { headers });
if (res.ok) console.log(await res.json());
else console.error("live feed error", res.status);
}
refresh();
setInterval(refresh, 30_000);4. Or get pushed updates over a WebSocket
On the Developer plan and up you can open a WebSocket instead of polling. You receive a snapshot when you connect, then only the matches that changed. Run this on a server, since the key is part of the URL.
const ws = new WebSocket(`wss://api.predictiqpro.com/live/ws?key=${process.env.PREDICTIQ_KEY}`);
ws.onmessage = (e) => {
const msg = JSON.parse(e.data); // "snapshot" first, then "update"
if (msg.type === "update") console.log(msg.matches, msg.goals);
};5. Add match stats
Possession, shots, corners and cards for one match. This also needs your key. Values the provider does not report are null, never 0.
const FIXTURE_ID = 123456; // replace with a live fixture id
const stats = await fetch(`${API}/live/arena/${FIXTURE_ID}/stats`, { headers });
console.log(await stats.json());Related guides
Ready to build?
Full endpoint reference is in the docs; plans are on the pricing page.
Start 14-day trial