WORKING API EXAMPLES

What will you build for the fans?

Three small demos built with the same data and queries as the FanGraph API. Try an idea, inspect its response, then copy a starter for your own project.

These are FanGraph demos. The birthday preview does not send messages to Discord. No API key is needed to try these limited public previews; your own app calls /api/v1 with a personal key kept on your server. Live demo refreshes share the playground’s limit of 5/minute and 20/day.

FANGRAPH DEMO · COMMUNITY

A birthday bot, without the setup

Preview a birthday message for your fan community. Copy the starter to fetch birthdays and format a message; connect your own Discord bot separately.

Loaded from the live catalog when this page opened.

Message preview

🎂 Happy birthday to Sting! Celebrate with your fan community.

1 recorded birthdays · Pop

Preview only. Nothing is posted or sent.

THE API REQUEST

GET /api/v1/birthdays/today?vertical=pop&limit=10

Run this starter on your server. Set FANGRAPH_API_KEY in its environment. Keep keys out of browser code and public repositories.

// Save as example.mjs; run node example.mjs on your server (Node.js 18+).
// Set FANGRAPH_API_KEY in the server environment first.
const key = process.env.FANGRAPH_API_KEY;
if (!key) throw new Error('Set FANGRAPH_API_KEY in your server environment.');
const response = await fetch('https://fangraphapi.com/api/v1/birthdays/today?vertical=pop&limit=10', {
  headers: { 'x-api-key': key },
  signal: AbortSignal.timeout(15000),
});
if (!response.ok) throw new Error('FanGraph returned HTTP ' + response.status);
const body = await response.json();
const names = body.data.map(artist => artist.name);
console.log(names.length ? '🎂 Happy birthday to ' + names.join(', ') + '!' : 'No recorded birthdays for this date.');
// Connect this message to your own Discord bot after configuring Discord.
Inspect the API response
{
  "data": [
    {
      "id": "pop-q483203",
      "vertical_id": "pop",
      "kind": "member",
      "slug": "sting",
      "name": "Sting",
      "birth_date": "1951-10-02",
      "debut_date": null,
      "status": "unknown",
      "country": null,
      "official_url": null,
      "created_at": "2026-10-01 14:49:39",
      "updated_at": "2026-10-01 14:49:39"
    }
  ],
  "meta": {
    "total": 1,
    "limit": 10,
    "offset": 0,
    "vertical": "pop",
    "timezone": "Asia/Seoul"
  }
}
FANGRAPH DEMO · MUSIC

An artist release tracker

Choose an artist or group and browse a small release-history sample. Useful for discography widgets and fan dashboards.

Loaded from the live catalog when this page opened.

Taylor Swift · recorded releases

Showing 6 of 19 records, ordered from earliest to latest. This is a sample, not a complete discography.

Browse recorded releases →

THE API REQUEST

GET /api/v1/releases?vertical=pop&artist=pop-q26876&limit=6

Run this starter on your server. Set FANGRAPH_API_KEY in its environment. Keep keys out of browser code and public repositories.

// Save as example.mjs; run node example.mjs on your server (Node.js 18+).
// Set FANGRAPH_API_KEY in the server environment first.
const key = process.env.FANGRAPH_API_KEY;
if (!key) throw new Error('Set FANGRAPH_API_KEY in your server environment.');
const response = await fetch('https://fangraphapi.com/api/v1/releases?vertical=pop&artist=pop-q26876&limit=6', {
  headers: { 'x-api-key': key },
  signal: AbortSignal.timeout(15000),
});
if (!response.ok) throw new Error('FanGraph returned HTTP ' + response.status);
const body = await response.json();
for (const release of body.data) {
  console.log(release.release_date, release.title, release.status, release.source_url);
}
// Dates retain their date_precision. Coverage is not a complete discography.
Inspect the API response
{
  "data": [
    {
      "id": "mb-ba1d0c2a-bb07-38bc-835c-a880f76f1309",
      "vertical_id": "pop",
      "artist_id": "pop-q26876",
      "title": "Taylor Swift",
      "release_date": "2006-10-24",
      "date_precision": "day",
      "type": "album",
      "status": "released",
      "source_url": "https://musicbrainz.org/release-group/ba1d0c2a-bb07-38bc-835c-a880f76f1309",
      "verified_at": null,
      "announcement_source_id": null,
      "market": null
    },
    {
      "id": "mb-b6ba14c4-b8c4-3eb9-a562-dfb2f02181e8",
      "vertical_id": "pop",
      "artist_id": "pop-q26876",
      "title": "Sounds of the Season: The Taylor Swift Holiday Collection",
      "release_date": "2007-10-14",
      "date_precision": "day",
      "type": "ep",
      "status": "released",
      "source_url": "https://musicbrainz.org/release-group/b6ba14c4-b8c4-3eb9-a562-dfb2f02181e8",
      "verified_at": null,
      "announcement_source_id": null,
      "market": null
    },
    {
      "id": "mb-eff166f0-1fe3-3aca-9313-566adfa502c0",
      "vertical_id": "pop",
      "artist_id": "pop-q26876",
      "title": "Beautiful Eyes",
      "release_date": "2008-07-15",
      "date_precision": "day",
      "type": "ep",
      "status": "released",
      "source_url": "https://musicbrainz.org/release-group/eff166f0-1fe3-3aca-9313-566adfa502c0",
      "verified_at": null,
      "announcement_source_id": null,
      "market": null
    },
    {
      "id": "mb-63eba062-847c-3b73-8b0f-6baf27bba6fa",
      "vertical_id": "pop",
      "artist_id": "pop-q26876",
      "title": "Fearless",
      "release_date": "2008-11-11",
      "date_precision": "day",
      "type": "album",
      "status": "released",
      "source_url": "https://musicbrainz.org/release-group/63eba062-847c-3b73-8b0f-6baf27bba6fa",
      "verified_at": null,
      "announcement_source_id": null,
      "market": null
    },
    {
      "id": "mb-ba1259eb-d41e-41c5-a70c-0e6fa73e6708",
      "vertical_id": "pop",
      "artist_id": "pop-q26876",
      "title": "Speak Now",
      "release_date": "2010-10-25",
      "date_precision": "day",
      "type": "album",
      "status": "released",
      "source_url": "https://musicbrainz.org/release-group/ba1259eb-d41e-41c5-a70c-0e6fa73e6708",
      "verified_at": null,
      "announcement_source_id": null,
      "market": null
    },
    {
      "id": "mb-a73cecde-0923-40ad-aad1-e8c24ba6c3d2",
      "vertical_id": "pop",
      "artist_id": "pop-q26876",
      "title": "Red",
      "release_date": "2012-08-10",
      "date_precision": "day",
      "type": "album",
      "status": "released",
      "source_url": "https://musicbrainz.org/release-group/a73cecde-0923-40ad-aad1-e8c24ba6c3d2",
      "verified_at": null,
      "announcement_source_id": null,
      "market": null
    }
  ],
  "meta": {
    "total": 19,
    "limit": 6,
    "offset": 0,
    "vertical": "pop",
    "timezone": "Asia/Seoul"
  }
}
FANGRAPH DEMO · DISCOVERY

A source-backed artist card

Turn an artist response into a compact profile with a birthday, original introduction and licensed photo when available.

Loaded from the live catalog when this page opened.

Taylor Swift

Photo: iHeartRadioCA. YouTube : #taylorswift on the #vmas pink carpet – View/save archived versions on archive.org (See specific archived version) · Source · CC BY 3.0. Displayed smaller, no additional edits. No endorsement implied.

Taylor Swift

Birthday · 1989-12-13

Taylor Swift is known as a singer-songwriter and composer. Recorded musical genres include pop music, country music. The recorded birthday is December 13, 1989.

View sourced profile →

THE API REQUEST

GET /api/v1/members/pop-q26876?vertical=pop

Run this starter on your server. Set FANGRAPH_API_KEY in its environment. Keep keys out of browser code and public repositories.

// Save as example.mjs; run node example.mjs on your server (Node.js 18+).
// Set FANGRAPH_API_KEY in the server environment first.
const key = process.env.FANGRAPH_API_KEY;
if (!key) throw new Error('Set FANGRAPH_API_KEY in your server environment.');
const response = await fetch('https://fangraphapi.com/api/v1/members/pop-q26876?vertical=pop', {
  headers: { 'x-api-key': key },
  signal: AbortSignal.timeout(15000),
});
if (!response.ok) throw new Error('FanGraph returned HTTP ' + response.status);
const body = await response.json();
const artist = body.data[0];
console.log(artist.name, artist.birth_date, artist.introduction);
if (artist.image) {
  console.log('Photo:', artist.image.url);
  console.log('Credit:', artist.image.creator, artist.image.credit);
  console.log('Source:', artist.image.source_url);
  console.log('License:', artist.image.license, artist.image.license_url);
}
// Render text safely. Include photo credit, source and license links in your UI.
Inspect the API response
{
  "data": [
    {
      "id": "pop-q26876",
      "vertical_id": "pop",
      "kind": "member",
      "slug": "taylor-swift",
      "name": "Taylor Swift",
      "birth_date": "1989-12-13",
      "debut_date": null,
      "status": "unknown",
      "country": null,
      "official_url": null,
      "created_at": "2026-10-01 14:49:39",
      "updated_at": "2026-10-01 14:49:39",
      "introduction": "Taylor Swift is known as a singer-songwriter and composer. Recorded musical genres include pop music, country music. The recorded birthday is December 13, 1989.",
      "profile": {
        "occupations": [
          "singer-songwriter",
          "singer",
          "lyricist",
          "musician",
          "composer"
        ],
        "genres": [
          "pop music",
          "country music"
        ],
        "citizenships": [
          "United States"
        ],
        "birthplaces": [
          "Reading Hospital"
        ],
        "record_labels": [
          "Big Machine Records",
          "Republic Records"
        ],
        "other_names": [
          "Nils Sjöberg"
        ],
        "active_since": "2003"
      },
      "profile_source": "https://www.wikidata.org/wiki/Q26876",
      "image": {
        "url": "https://fangraphapi.com/artist-images/pop-q26876.png",
        "source_url": "https://commons.wikimedia.org/wiki/File:Taylor_Swift_at_the_2023_MTV_Video_Music_Awards_(3).png",
        "creator": "iHeartRadioCA",
        "credit": "YouTube : #taylorswift on the #vmas pink carpet – View/save archived versions on archive.org (See specific archived version)",
        "license": "CC BY 3.0",
        "license_url": "https://creativecommons.org/licenses/by/3.0",
        "width": 640,
        "height": 910,
        "notice": "Reuse is subject to the linked image license. This photo does not imply endorsement."
      },
      "provenance": [
        {
          "id": "pop-q26876-name",
          "entity_id": "pop-q26876",
          "source_id": "wikidata",
          "source_record_id": "Q26876",
          "field": "name",
          "value_json": "\"Taylor Swift\"",
          "retrieved_at": "2026-10-01T14:48:08.154844+00:00",
          "source_revision": "2549691644",
          "source": {
            "id": "wikidata",
            "provider": "wikidata",
            "url": "https://www.wikidata.org/wiki/Q26876",
            "license": "CC0 structured data"
          }
        },
        {
          "id": "pop-q26876-birth_date",
          "entity_id": "pop-q26876",
          "source_id": "wikidata",
          "source_record_id": "Q26876",
          "field": "birth_date",
          "value_json": "\"1989-12-13\"",
          "retrieved_at": "2026-10-01T14:48:08.154844+00:00",
          "source_revision": "2549691644",
          "source": {
            "id": "wikidata",
            "provider": "wikidata",
            "url": "https://www.wikidata.org/wiki/Q26876",
            "license": "CC0 structured data"
          }
        }
      ]
    }
  ],
  "meta": {
    "total": 1,
    "limit": 50,
    "offset": 0,
    "vertical": "pop",
    "timezone": "Asia/Seoul"
  }
}

Take your idea further

Use group memberships for a fan discovery app, birthdays for a community calendar, or reviewed upcoming releases for a watch list. Coverage is growing: show empty states, preserve date precision and link to sources. Follow each photo’s individual license.

Browse all endpoints → · Ask a question or share your project →