Para IA

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.

Empieza gratis Try track search
Conecta tu IA

Pega esto en tu agente

Lee https://okdata.online/agents.md y configura okdata por mí; mi clave está en la variable de entorno OKDATA_API_KEY.

Claude Code, Cursor, Codex y otros agentes que pueden abrir un enlace se configuran solos a partir de él.

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

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

Endpoints
3 endpoints
En 2 grupos, un solo formato de respuesta
Precio más bajo
Desde $0.003
Una llamada, pagada con saldo prepago
Actualidad
En directo
Leído de la plataforma cuando llamas
Cuota mensual
$0
Sin suscripción ni gasto mínimo

Every Spotify endpoint

Una fila por endpoint: la solicitud, lo que se devuelve y lo que cuesta una llamada.

Tracks

2

Artists

1

Los precios son por llamada, salvo que se indique /item. Una llamada que llegó a la plataforma se cobra aunque vuelva vacía o falle.

What people do with Spotify data

Cada tarea tiene su propia página con los endpoints que usa, un ejemplo resuelto y su coste.

Empieza en tres pasos

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

  1. Obtener una clave

    Crea una cuenta y una clave en la consola. Cada clave nueva incluye $0.20 para probar, sin tarjeta.

    Abrir la consola

  2. Conecta tu IA o llámala tú mismo

    Pega esta frase en Claude Code, Cursor, Codex u otro agente que pueda abrir un enlace, y se configurará solo. O envía la solicitud de abajo con tu clave en el encabezado Authorization.

    Configura okdata por mí siguiendo https://okdata.online/agents.md. Esta es mi clave de API de okdata: okd_…. Guárdala bien y úsala en todas tus llamadas a okdata.

    Sustituye el marcador por tu propia clave, o inicia sesión y cópialo con la clave ya incluida.

  3. Haz la primera llamada

    Los elementos llegan en data.items (un objeto en data.item), la página siguiente en page.next_cursor y lo que se te cobró en 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.

¿Qué tan actualizados están los datos?

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?

Sí. Conecta el servidor MCP en https://api.okdata.online/mcp: su herramienta find lista estos 3 endpoints con sus precios, y su herramienta call los ejecuta con tu key.

¿Puedo probarlo gratis?

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

Conéctate una vez y luego solo pregunta.

Cada clave nueva incluye $0.20 para probar. Una frase conecta tu agente.

Empieza gratis
Conecta tu IA

Pega esto en tu agente

Lee https://okdata.online/agents.md y configura okdata por mí; mi clave está en la variable de entorno OKDATA_API_KEY.

Claude Code, Cursor, Codex y otros agentes que pueden abrir un enlace se configuran solos a partir de él.

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