Fun Facts API

Send an artist and title; get back facts about the song and artist, each with its source, plus play stats from StreamFX.co.uk streams. JSON over HTTPS. Free up to 5,000 requests a day — apply for a key.

Your key

Make your key in the developer portal once your application is approved. Send it with every request in the Authorization header:

Authorization: Bearer sfx_live_…

If your tool can't set that header, use X-Api-Key: sfx_live_…, or ?key= as a last resort (it can end up in logs). Keep your key on your server — don't put it in a web page or app where people can read it. If it leaks, make a new one in the portal; the old one stops working straight away.

Facts for a track

GET https://www.streamfx.co.uk/api/v1/facts.php?artist=…&title=…

ParameterWhat it is
titleRequired. The song title. Extras like “(Radio Edit)”, “- 2015 Remaster” or track numbers are tidied up for you.
artistRecommended. The artist as your software has it — “A feat. B”, “A & B” and “A, B” all work.

If we've never seen the track, we look it up there and then, which can take a second or two. After that it's instant, for you and everyone else.

The answer

{
  "track": { "artist": "Faithless", "title": "Insomnia", "id": "3f9c…" },
  "status": "found",
  "facts": [
    {
      "text": "…",
      "source": "wikipedia",
      "source_name": "Wikipedia",
      "url": "https://en.wikipedia.org/wiki/…",
      "licence": "CC BY-SA 4.0",
      "checked_by_a_person": false
    }
  ],
  "year": 1995,
  "network": {
    "plays": 1240, "djs": 86, "plays_last_7_days": 31,
    "first_played": "2025-03-14",
    "often_followed_by": { "artist": "…", "title": "…" },
    "most_played": "Saturday nights"
  },
  "attribution": "Fun facts by StreamFX.co.uk …"
}
FieldMeaning
statusfound — there are facts. none — we couldn't find anything worth saying (we look again every week). looking — our sources couldn't be reached just now; try again in a few minutes.
factsBest first. Facts checked by our team come first (checked_by_a_person: true, source community).
sourcewikipedia, wikidata, musicbrainz, deezer, lastfm, community or network (worked out from plays on StreamFX.co.uk).
networkPlay stats across every StreamFX.co.uk stream, updated hourly. null until at least 5 different DJs have played the track. Never says who played it.

Limits

The free plan allows 5,000 requests a day, counted from midnight UK time. Every answer tells you where you are:

X-RateLimit-LimitYour daily allowance
X-RateLimit-RemainingRequests left today
X-RateLimit-ResetSeconds until the count resets

Tip: facts for a track rarely change, so keep answers for a day or so on your side rather than asking again on every page view.

Errors

Errors come back as {"error": {"code": "…", "message": "…"}} with these status codes:

StatusCodeWhat to do
400missing_titleAdd title.
401unauthorisedCheck your key — it may have been replaced.
403key_disabledYour access is switched off. Check your email from us.
403blockedRequests from your IP address or website have been blocked. Contact us.
429daily_limit_reachedWait for Retry-After seconds (midnight UK time).
500server_errorTry again shortly.

Examples

JavaScript (on your server)

const r = await fetch('https://www.streamfx.co.uk/api/v1/facts.php?' + new URLSearchParams({ artist, title }), {
  headers: { Authorization: 'Bearer ' + process.env.STREAMFX_KEY }
});
const { facts } = await r.json();
console.log(facts[0]?.text);

PHP

$ctx = stream_context_create(['http' => ['header' => 'Authorization: Bearer ' . getenv('STREAMFX_KEY')]]);
$url = 'https://www.streamfx.co.uk/api/v1/facts.php?' . http_build_query(['artist' => $artist, 'title' => $title]);
$facts = json_decode(file_get_contents($url, false, $ctx), true)['facts'] ?? [];

Python

import os, requests
r = requests.get("https://www.streamfx.co.uk/api/v1/facts.php", params={"artist": artist, "title": title},
                 headers={"Authorization": "Bearer " + os.environ["STREAMFX_KEY"]})
print(r.json()["facts"][:1])

Rules

  • Keep your key private and stay within your daily limit.
  • Show where a fact came from. For Wikipedia facts (CC BY-SA 4.0) show the source link with the fact.
  • Credit “Fun facts by StreamFX.co.uk” somewhere in your app or site.
  • Don't resell the facts as a data feed, or try to copy the whole database.
  • We may switch off keys that break these rules. Facts are provided as they are; tell us if you spot a wrong one.