API para Spotify
API para Spotify: Contagem de reproduções
Obtenha as contagens de streams e estatísticas de uma URL de faixa, álbum ou artista do Spotify.
POST/v1/run/spotify.play_count
Requisições
-
30d
Preços
Um preço, em dólares
Teste
Faça sua primeira requisição
Resposta de exemplo
Execuções grátis retornam só os primeiros 3 resultados. Recarregue uma chave para receber a resposta completa.
{
"data": {
"items": [
{
"albumName": "Example title",
"artistName": "Example title",
"durationMs": 13,
"id": "a1b2c3d4",
"image": "https://example.com/image.jpg",
"name": "Example title",
"playCount": 12500,
"previewUrl": "https://example.com/page",
"releaseDate": "2024-01-15T09:30:00Z",
"trackNumber": 42,
"type": "general",
"url": "https://example.com/page"
}
]
},
"found": true,
"reason": "not_found"
}Interface da resposta
interface SpotifyPlayCountResponse {
data: {
items: {
albumName?: string;
artistName?: string;
durationMs?: number;
id: string;
image?: string;
name: string;
playCount: number;
previewUrl?: string;
releaseDate?: string;
trackNumber?: number;
type?: string;
url: string;
}[];
} | null;
found: boolean;
reason?: "not_found";
}Referência completa de parâmetros e resposta - todos os campos, tipos e exemplos deste endpoint.
Referência
Requisição, resposta e preço
Última verificação em 2026-09-29 · disponibilidade e latência medidas em 30dPOST /v1/run/spotify.play_count
curl -X POST https://api.getanyapi.com/v1/run/spotify.play_count \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT"}'| Campo | Tipo | Valor de exemplo |
|---|---|---|
| Corpo da requisição | ||
| url | string | "https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT"URL de faixa, álbum ou artista do Spotify cujas contagens de streams serão obtidas (ex.: https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp). |
| Resposta | ||
| data | object | |
| data.items | object[] | Play-count records for the requested Spotify entity (one per track). Populated whenever the provider has data for the entity. |
| data.items[].albumName | string | Name of the album the track belongs to. Empty when the upstream omits it. |
| data.items[].artistName | string | Name of the primary artist. Empty when the upstream omits it. |
| data.items[].durationMs | integer | Track duration in milliseconds. |
| data.items[].id | string | The Spotify entity ID. Populated whenever the provider has data for the entity. |
| data.items[].image | string | URL of the cover art image. |
| data.items[].name | string | The track (or entity) name. Populated whenever the provider has data for the entity. |
| data.items[].playCount | integer | Total number of streams/plays for the track. Populated whenever the provider has data for the entity. |
| data.items[].previewUrl | string | URL of the 30-second audio preview. |
| data.items[].releaseDate | string | Release date as an ISO 8601 string. |
| data.items[].trackNumber | integer | Position of the track within its album. |
| data.items[].type | string | The Spotify entity type (e.g. "track"). |
| data.items[].url | string | Canonical open.spotify.com URL for the entity, with tracking query params stripped. Populated whenever the provider has data for the entity. |
| found | boolean | Whether the track/album/artist was found and returned play-count records. |
| reason | "not_found" | Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost. |
| Preço | ||
| Preço por requisição | USD | US$ 0,0033 |
| Preço /mil req. | USD | US$ 3,30 |
Dúvidas frequentes
Sobre o endpoint Contagem de reproduções da API para Spotify
O endpoint Contagem de reproduções da AnyAPI para Spotify retorna dados de Spotify em JSON normalizado com uma chamada POST para /v1/run/spotify.play_count. Obtenha as contagens de streams e estatísticas de uma URL de faixa, álbum ou artista do Spotify. A AnyAPI retorna um schema normalizado, seja qual for a fonte que atende. Custa a partir de US$ 3,30 por mil requisições, em dólares, sem assinatura e sem mínimo mensal.
Custa a partir de US$ 3,30 por mil requisições, em dólares, sem assinatura e sem mínimo mensal. Você recarrega uma carteira em dólares e cada chamada desconta dela. Algumas requisições pagas pela carteira que falham geram cobranças de processamento, que repassamos pelo custo, sem margem; a resposta de erro mostra o valor cobrado.
Obtenha as contagens de streams e estatísticas de uma URL de faixa, álbum ou artista do Spotify. A resposta é JSON normalizado, com o mesmo envelope que todo endpoint da AnyAPI retorna, então processar um segundo endpoint é só trocar a URL, e nada mais.