Dataspryva

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.

FieldTypeRequiredDescription
modestringrequiredWhat to fetch. Each mode reads its own list field.
searchQueriesarrayoptionalFree-text queries (mode=search). One or more artist, song, album or playlist names.
searchTypestringoptionalWhich catalog entity to search for (mode=search).
songUrlsarrayoptionalmusic.163.com song URLs or bare song IDs, e.g. 186016.
artistIdsarrayoptionalArtist IDs, music.163.com artist URLs, or exact artist names.
artistOrderstringoptionalOrder the artist's song catalogue by popularity or release time (mode=byArtist).
albumUrlsarrayoptionalmusic.163.com album URLs or bare album IDs.
playlistUrlsarrayoptionalmusic.163.com playlist URLs or bare playlist IDs. Full tracklists are read.
playlistCatstringoptionalNetEase playlist genre, scene or mood to browse (mode=byPlaylist).
toplistIdsarrayoptionalChart IDs, music.163.com toplist URLs, or Chinese/English chart names. Use `all` or leave empty for every current chart.
maxTracksPerChartintegeroptionalLimit tracks read from each chart before the global max items cap (mode=byToplist). 0 reads every track.
commentUrlsarrayoptionalSong, 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.
commentOrderstringoptionalRecommended comments or NetEase's hot-comment selection (mode=comments).
maxCommentsPerItemintegeroptionalMaximum top-level comments read per song, album, playlist or chart (mode=comments). NetEase stops anonymous pagination around 1,100.
includeRepliesbooleanoptionalFetch the reply floor for comments that have replies (mode=comments).
maxRepliesPerCommentintegeroptionalHow many replies to read for each comment when replies are enabled (mode=comments).
includeArtistProfilebooleanoptionalEmit one artist profile record with bio, images, sizes, rank, identities and fan count (mode=byArtist / byArtistAlbums).
includeLyricsbooleanoptionalAttach full LRC lyrics plus translation, romanization and word-by-word lyrics when NetEase has them (every song mode).
includeAlbumTracksbooleanoptionalEmit each album's tracks as song records (mode=byAlbum).
includePlaylistTracksbooleanoptionalEmit the playlist's full tracklist as song records (mode=byPlaylistUrl).
includeToplistInfobooleanoptionalEmit a chart summary record before each chart's tracks (mode=byToplist).
minDurationSecintegeroptionalSkip song records shorter than this. Album, artist, playlist and chart metadata are unaffected.
maxDurationSecintegeroptionalSkip song records longer than this. Album, artist, playlist and chart metadata are unaffected.
minPopularityintegeroptionalSkip song records below this NetEase popularity score (0-100). Metadata records are unaffected.
minPlayCountintegeroptionalSkip browsed playlists with fewer plays (mode=byPlaylist).
minTrackCountintegeroptionalSkip browsed playlists with fewer tracks (mode=byPlaylist).
containsKeywordstringoptionalKeep only records whose name contains this text (case-insensitive). Applies to songs, albums, artists, playlists and charts.
maxItemsintegeroptionalHard 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.