Use NetEase Cloud Music Song, Chart & Playlist Scraper with Python
Search NetEase Cloud Music songs, fetch song details by URL, pull an artist's top songs or album list, browse playlists by genre, or get any top-100 chart. Returns artist, album, duration, cover art, and popularity for each track.
1. Choose the data you need
Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.
2. Prepare a source-based input
This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.
{
"albumUrls": [],
"artistIds": [],
"artistOrder": "hot",
"commentOrder": "recommended",
"commentUrls": [],
"includeAlbumTracks": true,
"includeArtistProfile": false,
"includeLyrics": false,
"includePlaylistTracks": true,
"includeReplies": false,
"includeToplistInfo": true,
"maxCommentsPerItem": 100,
"maxItems": 3,
"maxRepliesPerComment": 20,
"maxTracksPerChart": 0,
"mode": "search",
"playlistCat": "华语",
"playlistUrls": [],
"searchQueries": [
"周杰伦"
],
"searchType": "song",
"songUrls": [],
"toplistIds": []
}
Download input.example.json and save your reviewed copy as input.json.
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | required | What to fetch. Each mode reads its own list field. |
searchQueries | array | optional | Free-text queries (mode=search). One or more artist, song, album or playlist names. |
searchType | string | optional | Which catalog entity to search for (mode=search). |
songUrls | array | optional | music.163.com song URLs or bare song IDs, e.g. 186016. |
artistIds | array | optional | Artist IDs, music.163.com artist URLs, or exact artist names. |
artistOrder | string | optional | Order the artist's song catalogue by popularity or release time (mode=byArtist). |
albumUrls | array | optional | music.163.com album URLs or bare album IDs. |
playlistUrls | array | optional | music.163.com playlist URLs or bare playlist IDs. Full tracklists are read. |
playlistCat | string | optional | NetEase playlist genre, scene or mood to browse (mode=byPlaylist). |
toplistIds | array | optional | Chart IDs, music.163.com toplist URLs, or Chinese/English chart names. Use `all` or leave empty for every current chart. |
maxTracksPerChart | integer | optional | Limit tracks read from each chart before the global max items cap (mode=byToplist). 0 reads every track. |
commentUrls | array | optional | Song, album, playlist or chart URLs/IDs. A bare ID is treated as a song; use `album:123`, `playlist:123` or `chart:123` to be explicit. |
commentOrder | string | optional | Recommended comments or NetEase's hot-comment selection (mode=comments). |
maxCommentsPerItem | integer | optional | Maximum top-level comments read per song, album, playlist or chart (mode=comments). NetEase stops anonymous pagination around 1,100. |
includeReplies | boolean | optional | Fetch the reply floor for comments that have replies (mode=comments). |
maxRepliesPerComment | integer | optional | How many replies to read for each comment when replies are enabled (mode=comments). |
includeArtistProfile | boolean | optional | Emit one artist profile record with bio, images, sizes, rank, identities and fan count (mode=byArtist / byArtistAlbums). |
includeLyrics | boolean | optional | Attach full LRC lyrics plus translation, romanization and word-by-word lyrics when NetEase has them (every song mode). |
includeAlbumTracks | boolean | optional | Emit each album's tracks as song records (mode=byAlbum). |
includePlaylistTracks | boolean | optional | Emit the playlist's full tracklist as song records (mode=byPlaylistUrl). |
includeToplistInfo | boolean | optional | Emit a chart summary record before each chart's tracks (mode=byToplist). |
minDurationSec | integer | optional | Skip song records shorter than this. Album, artist, playlist and chart metadata are unaffected. |
maxDurationSec | integer | optional | Skip song records longer than this. Album, artist, playlist and chart metadata are unaffected. |
minPopularity | integer | optional | Skip song records below this NetEase popularity score (0-100). Metadata records are unaffected. |
minPlayCount | integer | optional | Skip browsed playlists with fewer plays (mode=byPlaylist). |
minTrackCount | integer | optional | Skip browsed playlists with fewer tracks (mode=byPlaylist). |
containsKeyword | string | optional | Keep only records whose name contains this text (case-insensitive). Applies to songs, albums, artists, playlists and charts. |
maxItems | integer | optional | Hard cap on total dataset records for the run, including error records. |
3. Start an Actor run
Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.
Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.
import json
import os
import urllib.request
# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
actor_input = json.load(stream)
token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
"https://api.apify.com/v2/acts/vXYLnAW7cJHKOW6xQ/runs?timeout=120&maxTotalChargeUsd=0.50",
data=json.dumps(actor_input).encode("utf-8"),
headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.
4. Inspect the actual results
Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.
NetEase Cloud Music songs, albums, artists, playlists, chart summaries, comments and lyrics metadata.
Questions before you run
Which inputs are required?
The published required fields are mode
What does this guide verify?
The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.
What if the run request times out?
Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.
Generated from source build OBp2YCjuqgFzas3t0 and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.