Untuk AI

Spotify API: song search, play counts, artists

3 Spotify endpoints covering Tracks and Artists, from $0.003 a call. No Spotify account or cookie needed.

Mulai gratis Try track search
Hubungkan AI Anda

Tempelkan ini ke agen Anda

Baca https://okdata.online/agents.md dan siapkan okdata untuk saya; kunci saya ada di variabel lingkungan OKDATA_API_KEY.

Claude Code, Cursor, Codex, dan agen lain yang bisa membuka tautan akan menyiapkan dirinya sendiri dari sini.

Server MCPhttps://api.okdata.online/mcp

Ask about Spotify from Claude, Cursor and other agents: the Spotify MCP page

Endpoint
3 endpoint
Dalam 2 grup, satu format respons
Harga terendah
Mulai $0.003
Panggilan, dibayar dari saldo prabayar
Kebaruan data
Live
Dibaca dari platform saat Anda memanggil
Biaya bulanan
$0
Tanpa langganan atau pembelanjaan minimum

Every Spotify endpoint

Satu baris per endpoint: permintaan, data yang dikembalikan, dan biaya satu panggilan.

Tracks

2

Artists

1

Harga per panggilan kecuali ditandai /item. Panggilan yang sudah mencapai platform tetap ditagih meskipun hasilnya kosong atau gagal.

What people do with Spotify data

Setiap kebutuhan punya halaman sendiri berisi endpoint yang dipakai, contoh eksekusi, dan biayanya.

Mulai dalam tiga langkah

The example is Spotify track search; every Spotify endpoint is called the same way and answers in the same shape.

  1. Dapatkan key

    Buat akun dan kunci di konsol. Kunci baru mendapat $0.20 untuk mencoba, tanpa kartu.

    Buka konsol

  2. Hubungkan AI Anda, atau panggil sendiri

    Tempel kalimat ini ke Claude Code, Cursor, Codex, atau agen lain yang dapat membuka tautan, dan agen akan menyiapkan dirinya sendiri. Atau kirim permintaan di bawah dengan key Anda di header Authorization.

    Siapkan okdata untuk saya dengan mengikuti https://okdata.online/agents.md. Ini API key okdata saya: okd_…. Simpan baik-baik dan gunakan untuk semua panggilan okdata.

    Ganti placeholder dengan key Anda, atau masuk dan salin dengan key yang sudah terisi.

  3. Lakukan panggilan pertama

    Item ada di data.items (satu objek di data.item), halaman berikutnya di page.next_cursor, dan biaya yang ditagihkan di meta.billing.amount.

    cURL

    curl -G "https://api.okdata.online/v1/spotify/tracks/search" \
      -H "Authorization: Bearer $OKDATA_API_KEY" \
      --data-urlencode 'query=taylor swift'

    Python

    import os
    import requests
    
    resp = requests.get(
        "https://api.okdata.online/v1/spotify/tracks/search",
        headers={"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"},
        params={"query": "taylor swift"},
        timeout=60,
    )
    body = resp.json()
    if body["code"] != "ok":
        raise RuntimeError(f"{body['code']}: {body['message']} (charged: {body['charged']})")
    
    for row in body["data"]["items"]:
        print(row)
    print("cost: $" + body["meta"]["billing"]["amount"])

    TypeScript

    const url = new URL('https://api.okdata.online/v1/spotify/tracks/search');
    url.searchParams.set('query', "taylor swift");
    
    const res = await fetch(url, {
      headers: {
        Authorization: `Bearer ${process.env.OKDATA_API_KEY}`,
      },
    });
    const body = await res.json();
    if (body.code !== 'ok') throw new Error(`${body.code}: ${body.message}`);
    
    for (const row of body.data.items) {
      console.log(row);
    }
    console.log('cost: $' + body.meta.billing.amount);

    MCPtools/call

    {
      "name": "call",
      "arguments": {
        "capability": "spotify.tracks.search",
        "query": "taylor swift"
      }
    }

Questions about the Spotify API

What does the Spotify API cost?

Each of the 3 endpoints has its own price, $0.003 a call; the cheapest is Spotify artist profile at $0.003. You pay per call from a prepaid balance, with no subscription. A call that reaches the platform is charged even when it comes back empty, not found or failed; one stopped before that, such as for bad parameters, is free.

Do I need a Spotify account or cookie?

No. You call https://api.okdata.online with one okdata key and get public Spotify data back; you never use your own Spotify account, cookie or QR login.

Seberapa baru datanya?

A request reads Spotify when you call, unless the same request was answered a short while ago: then the answer can come from the result cache, with meta.cached: true and meta.fetched_at saying when it was read (lists and searches up to 30 minutes old, one post or product up to 1 hour, profiles up to 6 hours).

Can my AI agent use the Spotify API?

Ya. Hubungkan server MCP di https://api.okdata.online/mcp: tool find-nya menampilkan 3 endpoint ini beserta harganya, dan tool call-nya menjalankannya dengan key Anda.

Bisakah saya mencobanya gratis?

New accounts get $0.20 of trial credit with no card: enough for 66 calls to Spotify artist profile.

Hubungkan sekali, lalu cukup bertanya.

Setiap kunci baru mendapat $0.20 untuk mencoba. Satu kalimat menghubungkan agen Anda.

Mulai gratis
Hubungkan AI Anda

Tempelkan ini ke agen Anda

Baca https://okdata.online/agents.md dan siapkan okdata untuk saya; kunci saya ada di variabel lingkungan OKDATA_API_KEY.

Claude Code, Cursor, Codex, dan agen lain yang bisa membuka tautan akan menyiapkan dirinya sendiri dari sini.

Server MCPhttps://api.okdata.online/mcp