Apple Music Top Tracks API. Top tracks, on request.
Most played songs and music videos by country. We handle the proxies, blocks and platform changes.
Apple Music Top Tracks API at a glance
Returns Apple Music's chart of the most played songs or music videos in a country's store, top first, a page at a time, with each one's rank and ISRC. Each row also has the credited artists with their IDs, album, length, release date, composer, genres, explicit rating, audio formats, whether Apple has its lyrics, artwork and a preview clip. Pick the store with country and the chart with kind: the US songs chart by default.
GET /v1/applemusic/top_tracks
- 1 credit per page, $0.75–$1.97 per 1,000 pages
- 22 typed fields null when unknown
- 100 tracks per page, Apple Music's own chart order (1 = most played)
- 100 credits free when you sign up, no card, so you can build before you spend
Send one request. Get up to 100 tracks back.
Copy the request in your language, or hand it to your agent. Sign up for an API key and your first 100 credits are free.
$ npm install socialtapconst params = new URLSearchParams({
country: "US",
kind: "song",
});
const res = await fetch(`https://socialtap.dev/v1/applemusic/top_tracks?${params}`, {
headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, page, meta } = body;
console.log(data, meta.credits_charged);import os
import requests
res = requests.get(
"https://socialtap.dev/v1/applemusic/top_tracks",
params={"country": "US", "kind": "song"},
headers={"x-api-key": os.environ["SOCIALTAP_API_KEY"]},
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
data, page, meta = body["data"], body["page"], body["meta"]
print(data, meta["credits_charged"])require "json"
require "net/http"
uri = URI("https://socialtap.dev/v1/applemusic/top_tracks")
uri.query = URI.encode_www_form('country' => 'US', 'kind' => 'song')
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV.fetch("SOCIALTAP_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body["error"]["code"]}: #{body["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
pp body["data"]
puts body["meta"]["credits_charged"]<?php
$query = http_build_query([
'country' => 'US',
'kind' => 'song',
]);
$ch = curl_init('https://socialtap.dev/v1/applemusic/top_tracks?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('SOCIALTAP_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
echo $body['meta']['credits_charged'], PHP_EOL;package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
)
func main() {
q := url.Values{}
q.Set("country", "US")
q.Set("kind", "song")
req, err := http.NewRequest("GET", "https://socialtap.dev/v1/applemusic/top_tracks?"+q.Encode(), nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("x-api-key", os.Getenv("SOCIALTAP_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var body struct {
Data json.RawMessage `json:"data"`
Page json.RawMessage `json:"page"`
Meta map[string]any `json:"meta"`
Error *struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
if body.Error != nil {
log.Fatalf("%s: %s", body.Error.Code, body.Error.Message)
}
fmt.Println(string(body.Data), body.Meta["credits_charged"])
}curl 'https://socialtap.dev/v1/applemusic/top_tracks?country=US&kind=song' \
-H "x-api-key: $SOCIALTAP_API_KEY"{
"data": [
{
"approximate_fields": [
"published_at"
],
"author": {
"avatar_url": "https://is1-ssl.mzstatic.com/image/thumb/AMCArtistImages211/v4/7d/f9/5b/7df95b8e-26fb-5e14-f35d-f603abc52dc8/ami-identity-6b9f829473ca41446a842ac18b0e65ee-2026-01-27T17-02-20.725Z_cropped.png/2400x2400bb.jpg",
"display_name": "Ella Langley",
"id": "1384373733",
"is_verified": null,
"url": "https://music.apple.com/us/artist/ella-langley/1384373733",
"username": null
},
"coauthors": [],
"duration_ms": 232226,
"hashtags": [],
"id": "1844932150",
"is_nsfw": null,
"is_pinned": null,
"is_sponsored": null,
"language": null,
"media": [
{
"alt_text": null,
"duration_ms": null,
"expires_at": null,
"height": null,
"thumbnail_url": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/e2/91/4d/e2914d0a-7f1d-f04c-fbf4-c50b38548838/196873638690.jpg/3000x3000bb.jpg",
"type": "audio",
"url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/38/49/4c/38494cb4-f9e0-1db4-0b84-8c478cb55390/mzaf_14015374052766148372.plus.aac.ep.m4a",
"width": null
}
],
"mentions": [],
"metrics": {
"comment_count": null,
"like_count": null,
"quote_count": null,
"repost_count": null,
"save_count": null,
"share_count": null,
"view_count": null
},
"platform": "applemusic",
"platform_specific": {
"applemusic": {
"air_ended_at": null,
"album_artist_name": "Ella Langley",
"album_id": "1844932149",
"album_title": "Choosin' Texas - Single",
"album_url": "https://music.apple.com/us/album/choosin-texas-single/1844932149",
"artist_name": "Ella Langley",
"attribution": null,
"audio_locale": "en-US",
"audio_traits": [
"atmos",
"lossless",
"lossy-stereo"
],
"composer_name": "Ella Langley, Luke Dick, Miranda Lambert & Joybeth Taylor",
"content_rating": null,
"curator_id": null,
"disc_number": 1,
"genres": [
"Country"
],
"is_4k": null,
"is_apple_digital_master": false,
"is_explicit": false,
"is_hdr": null,
"is_live": null,
"is_lyrics_available": true,
"is_mastered_for_itunes": false,
"is_time_synced_lyrics_available": true,
"isrc": "USSM12504190",
"long_note": null,
"movement_count": null,
"movement_name": null,
"movement_number": null,
"rank": 1,
"storefront": "us",
"track_number": 1,
"video_traits": [],
"work_name": null
}
},
"platform_type": "song",
"published_at": "2025-10-17T00:00:00Z",
"text": null,
"thumbnail_url": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/e2/91/4d/e2914d0a-7f1d-f04c-fbf4-c50b38548838/196873638690.jpg/3000x3000bb.jpg",
"title": "Choosin' Texas",
"type": "audio",
"unknown_fields": [],
"url": "https://music.apple.com/us/album/choosin-texas/1844932149?i=1844932150"
},
{
"approximate_fields": [
"published_at"
],
"author": {
"avatar_url": "https://is1-ssl.mzstatic.com/image/thumb/AMCArtistImages221/v4/84/8a/4e/848a4e8b-48c7-e3fa-ae20-a42cd4b469a8/ami-identity-d59cbd95617167e768f2dbfe6377cf2e-2026-08-09T23-03-10.005Z_cropped.png/1454x1454bb.jpg",
"display_name": "KAROL G",
"id": "290814601",
"is_verified": null,
"url": "https://music.apple.com/us/artist/karol-g/290814601",
"username": null
},
"coauthors": [
{
"avatar_url": "https://is1-ssl.mzstatic.com/image/thumb/AMCArtistImages221/v4/f2/bd/40/f2bd40bd-cbc0-bb7d-87b2-27f8b2eed765/ami-identity-7f43d3c2d6a3b0cb7b4be17c4fd5aca6-2024-10-24T17-10-43.339Z_cropped.png/1349x1349bb.jpg",
"display_name": "Judeline",
"id": "1487503245",
"is_verified": null,
"url": "https://music.apple.com/us/artist/judeline/1487503245",
"username": null
},
{
"avatar_url": "https://is1-ssl.mzstatic.com/image/thumb/AMCArtistImages221/v4/7f/72/61/7f7261cb-880d-6bf2-73e7-07107d3764c4/file_cropped.png/1830x1830bb.jpg",
"display_name": "rusowsky",
"id": "1388592825",
"is_verified": null,
"url": "https://music.apple.com/us/artist/rusowsky/1388592825",
"username": null
}
],
"duration_ms": 225835,
"hashtags": [],
"id": "6796864754",
"is_nsfw": null,
"is_pinned": null,
"is_sponsored": null,
"language": null,
"media": [
{
"alt_text": null,
"duration_ms": null,
"expires_at": null,
"height": null,
"thumbnail_url": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/2b/66/b2/2b66b26c-ab23-faa1-c4ee-06fa2cce8f76/26UM1IM00558.rgb.jpg/3000x3000bb.jpg",
"type": "audio",
"url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/f3/08/da/f308da3d-00cc-7682-7be9-87cb882f4ea5/mzaf_14078178240008272749.plus.aac.ep.m4a",
"width": null
}
],
"mentions": [],
"metrics": {
"comment_count": null,
"like_count": null,
"quote_count": null,
"repost_count": null,
"save_count": null,
"share_count": null,
"view_count": null
},
"platform": "applemusic",
"platform_specific": {
"applemusic": {
"air_ended_at": null,
"album_artist_name": "KAROL G",
"album_id": "6796864741",
"album_title": "NO ME ARREPIENTO DE SENTIR TANTO",
"album_url": "https://music.apple.com/us/album/no-me-arrepiento-de-sentir-tanto/6796864741",
"artist_name": "KAROL G, Judeline & rusowsky",
"attribution": null,
"audio_locale": "es-ES",
"audio_traits": [
"atmos",
"lossless",
"lossy-stereo"
],
"composer_name": "Cordel Dexter Burrell, Carolina Giraldo Navarro, Marco Masis, Omer Fedi, Lara Fernández Castrelo, Andres Jael Correa Rios & Ruslán Mediavilla",
"content_rating": null,
"curator_id": null,
"disc_number": 1,
"genres": [
"Urbano latino",
"Latin"
],
"is_4k": null,
"is_apple_digital_master": true,
"is_explicit": false,
"is_hdr": null,
"is_live": null,
"is_lyrics_available": true,
"is_mastered_for_itunes": true,
"is_time_synced_lyrics_available": true,
"isrc": "USUG12607940",
"long_note": null,
"movement_count": null,
"movement_name": null,
"movement_number": null,
"rank": 2,
"storefront": "us",
"track_number": 11,
"video_traits": [],
"work_name": null
}
},
"platform_type": "song",
"published_at": "2026-08-05T00:00:00Z",
"text": null,
"thumbnail_url": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/2b/66/b2/2b66b26c-ab23-faa1-c4ee-06fa2cce8f76/26UM1IM00558.rgb.jpg/3000x3000bb.jpg",
"title": "BbY WOW",
"type": "audio",
"unknown_fields": [],
"url": "https://music.apple.com/us/album/bby-wow/6796864741?i=6796864754"
},
{
"approximate_fields": [
"published_at"
],
"author": {
"avatar_url": "https://is1-ssl.mzstatic.com/image/thumb/AMCArtistImages211/v4/19/7a/a7/197aa7f2-53af-5777-72ed-e292b550d159/ami_U003aidentity_U003a11b6c33ddb521791b7ba1dd8c4dcf764-2026-10-16T00-09-37.146Z_cropped.png/902x902bb.jpg",
"display_name": "Tate McRae",
"id": "1446365464",
"is_verified": null,
"url": "https://music.apple.com/us/artist/tate-mcrae/1446365464",
"username": null
},
"coauthors": [],
"duration_ms": 208810,
"hashtags": [],
"id": "6822497774",
"is_nsfw": null,
"is_pinned": null,
"is_sponsored": null,
"language": null,
"media": [
{
"alt_text": null,
"duration_ms": null,
"expires_at": null,
"height": null,
"thumbnail_url": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/69/64/e4/6964e483-c02c-e389-14f4-c426e8c65f2c/196874840146.jpg/3000x3000bb.jpg",
"type": "audio",
"url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/05/27/d4/0527d4f3-f6af-1ef8-6a32-25477b7b00ba/mzaf_9026536433413395761.plus.aac.ep.m4a",
"width": null
}
],
"mentions": [],
"metrics": {
"comment_count": null,
"like_count": null,
"quote_count": null,
"repost_count": null,
"save_count": null,
"share_count": null,
"view_count": null
},
"platform": "applemusic",
"platform_specific": {
"applemusic": {
"air_ended_at": null,
"album_artist_name": "Tate McRae",
"album_id": "6822497770",
"album_title": "Housewife - Single",
"album_url": "https://music.apple.com/us/album/housewife-single/6822497770",
"artist_name": "Tate McRae",
"attribution": null,
"audio_locale": "en-US",
"audio_traits": [
"atmos",
"lossless",
"lossy-stereo"
],
"composer_name": "Tate McRae, Julia Michaels, Ryan Tedder, Grant Boutin, Jasper Harris & Pablo Diaz-Reixa",
"content_rating": null,
"curator_id": null,
"disc_number": 1,
"genres": [
"Pop"
],
"is_4k": null,
"is_apple_digital_master": false,
"is_explicit": false,
"is_hdr": null,
"is_live": null,
"is_lyrics_available": true,
"is_mastered_for_itunes": false,
"is_time_synced_lyrics_available": true,
"isrc": "USRC12601916",
"long_note": null,
"movement_count": null,
"movement_name": null,
"movement_number": null,
"rank": 3,
"storefront": "us",
"track_number": 1,
"video_traits": [],
"work_name": null
}
},
"platform_type": "song",
"published_at": "2026-10-15T00:00:00Z",
"text": null,
"thumbnail_url": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/69/64/e4/6964e483-c02c-e389-14f4-c426e8c65f2c/196874840146.jpg/3000x3000bb.jpg",
"title": "Housewife",
"type": "audio",
"unknown_fields": [],
"url": "https://music.apple.com/us/album/housewife/6822497770?i=6822497774"
}
],
"page": {
"has_more": true,
"next_cursor": "c1.EXAMPLE_CURSOR",
"next_cursor_expires_at": "2026-10-26T12:00:00Z",
"end_reason": null
},
"meta": {
"request_id": "req_3f9c2a7d1e8b4c6a9f0e2d4b6a8c0e1f",
"platform": "applemusic",
"source": "api",
"is_cached": false,
"credits_charged": 1,
"latency_ms": 488,
"fetched_at": "2026-10-25T12:00:00Z",
"input": null,
"credits_remaining": 9999,
"client_request_id": null,
"warnings": []
}
}import { SocialTap } from "socialtap";
const client = new SocialTap(); // apiKey defaults to process.env.SOCIALTAP_API_KEY
const res = await client.applemusic.topTracks.list({ country: "US", kind: "song" });
console.log(res.data);
console.log(res.credits.charged, res.meta.request_id);import java.net.URI;
import java.net.URLEncoder;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
public class Main {
public static void main(String[] args) throws Exception {
String query = "country=" + encode("US")
+ "&kind=" + encode("song");
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://socialtap.dev/v1/applemusic/top_tracks?" + query))
.header("x-api-key", System.getenv("SOCIALTAP_API_KEY"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
// An error is {"error": {"code", "message", ...}}; success is {data, meta}, meta.credits_charged its price.
if (response.statusCode() >= 400) throw new RuntimeException(response.body());
System.out.println(response.body());
}
static String encode(String value) {
return URLEncoder.encode(value, StandardCharsets.UTF_8);
}
}using System.Text.Json;
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-api-key", Environment.GetEnvironmentVariable("SOCIALTAP_API_KEY"));
var query = string.Join("&",
"country=" + Uri.EscapeDataString("US"),
"kind=" + Uri.EscapeDataString("song"));
var res = await http.GetAsync("https://socialtap.dev/v1/applemusic/top_tracks?" + query);
using var body = JsonDocument.Parse(await res.Content.ReadAsStringAsync());
if (!res.IsSuccessStatusCode)
{
var error = body.RootElement.GetProperty("error");
throw new Exception($"{error.GetProperty("code")}: {error.GetProperty("message")}");
}
Console.WriteLine(body.RootElement.GetProperty("data"));
Console.WriteLine(body.RootElement.GetProperty("meta").GetProperty("credits_charged"));// Cargo.toml: reqwest = { version = "0.12", features = ["blocking", "json"] }, serde_json = "1"
use std::env;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let res = reqwest::blocking::Client::new()
.get("https://socialtap.dev/v1/applemusic/top_tracks")
.query(&[("country", "US"), ("kind", "song")])
.header("x-api-key", env::var("SOCIALTAP_API_KEY")?)
.send()?;
let ok = res.status().is_success();
let body: serde_json::Value = res.json()?;
if !ok {
return Err(format!("{}: {}", body["error"]["code"], body["error"]["message"]).into());
}
println!("{} {}", body["data"], body["meta"]["credits_charged"]);
Ok(())
}200 OK · GET https://socialtap.dev/v1/applemusic/top_tracksLong arrays and strings are shortened here. Real responses are complete.Docs One schema on 21 platforms.
The response reference lists every field, its type and when it is null. See the full schema.
Null means unknown
A field Apple Music doesn't show is null, never zero or an empty string, so a real zero always means zero.
No input needed
Every parameter is optional: the plain request returns the default list.
Write one parser
Apple Music, TikTok, Instagram and 18 more platforms answer in these fields, so the code that reads one reads them all.
platformstring- Platform ID (tiktok, youtube, …).
idstring- Platform-native post ID (string; Instagram shortcode, Reddit with its t3_ prefix).
urlstring- Canonical post URL.
typestring- Normalized content shape. New values may be added; treat unknown values as other.
platform_typestring- The platform's own product label, lowercase (reel, short, story, live, tweet, …).
titlestring- Headline (YouTube title, Reddit title); null on caption-only platforms.
textstring- Caption, description or body as plain text.
languagestring- BCP-47 language of text, when the platform states it.
Live data from 33 platforms.
What teams build with the Apple Music Top Tracks API.
Track the most played songs each day
Compare a song's rank across countries
Feed trend dashboards with matching ISRCs
Spot new songs breaking into the chart
Good to know before you build.
- platform_specific.applemusic.rank is the row's place in the chart, top first, and stays the same whatever limit you ask for. Apple publishes no play counts, so metrics are null and the rank is all the chart says.
- Apple serves about 200 rows per chart, fewer in a few small stores, and the walk then ends with page.end_reason end: that is the whole chart.
- since and until filter by release date. A chart isn't in date order, so they don't end the walk early: every page is read and charged until the chart ends.
- Charts differ by store, and platform_specific.applemusic.storefront says which store answered. A store's titles can be in its own language: lang asks for another where Apple offers it, and a language it doesn't offer gets the store's own, as a US chart with lang=ja-JP does.
- The Apple Music Top Albums API charts albums, and the Apple Music Top Playlists API playlists.
- When Apple's catalog API fails, the top of the chart comes from Apple's RSS feed and ends the walk with platform_limit: isrc, composer_name, duration_ms, the album, the preview, the audio formats and the lyrics flags are null or [], and only the first artist is named (those lists in unknown_fields). The feed has no languages, so a request with lang fails rather than answer in another.
1 credit per page. Failed requests are free.
Buy credits once and spend them on any endpoint, on any platform.
| Source | Price per successful page | Per 1,000 pages |
|---|---|---|
Platform API api | 1 credit | $0.75–$1.97 |
- Cache hits are free.
- Credits from packs and top-ups never expire.
- A monthly plan's credits are spent first, and what is left of them ends at each renewal.
- Prices exclude tax: sales tax is added at checkout where it applies.
- Outside the US, plans and packs are sold to businesses: checkout asks for your VAT, GST or other business tax ID.
Questions about the Apple Music Top Tracks API.
More in the API reference.
Can I get the chart for another country?
How much does the Apple Music Top Tracks API cost?
How do I get the next page?
See what's on the list right now.
Run it in the playground, or copy the request into your code.
- No credit card
- Failed requests are free
- Works on all 218 endpoints