Ximalaya APIximalaya.com ↗
Access Ximalaya audio content via API: categories, albums, tracks, comments, user profiles, and search. 7 endpoints returning structured JSON.
What is the Ximalaya API?
The Ximalaya API provides access to China's largest audio platform across 7 endpoints, covering content categories, album metadata, track listings, user comments, and creator profiles. The get_album_tracks endpoint returns per-track fields including duration, play count, likes, comment count, and pricing status. Combined with search_albums and get_categories, you can navigate the full content catalog programmatically without a Ximalaya developer account.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/6306b7e5-8c54-4f86-ba68-c4aaf14e4300/get_categories' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace ximalaya-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.ximalaya_api import Ximalaya, Category, Album, AlbumSummary, AlbumMatch, Track, Comment, User, Sort
# Initialize the client
ximalaya = Ximalaya()
# List all categories
for category in ximalaya.categories.list():
print(category.name, category.title)
# Browse albums in a category using constructible Category
for album_summary in ximalaya.category(name="youshengshu").albums.list(limit=5):
print(album_summary.title, album_summary.play_count, album_summary.anchor_name)
# Search for albums by keyword
for match in ximalaya.albummatches.search(query="\u4ed9\u4fa0", limit=3):
print(match.title, match.play_count, match.nickname)
# Drill into album details
album = match.details()
print(album.album_title, album.subscribe_count, album.category_title)
# Get album by ID and browse its tracks
album = ximalaya.albums.get(album_id="77855794")
print(album.album_title, album.play_count, album.anchor_name)
for track in album.tracks.list(sort_asc=Sort.ASCENDING, limit=5):
print(track.title, track.duration, track.playtimes)
# Browse comments on the album
for comment in album.comments.list(limit=3):
print(comment.nickname, comment.content, comment.likes)
# Get user profile
user = ximalaya.users.get(uid="10778196")
print(user.nick_name, user.fans_count, user.province)
Retrieve all top-level content categories on Ximalaya. Each category has a pinyin name usable as a key in get_category_albums. Returns the full category tree in one call (no pagination).
No input parameters required.
{
"type": "object",
"fields": {
"categories": "array of category objects with id, name, title, categoryType, orderNum, parentId, isDisplay"
},
"sample": {
"data": {
"categories": [
{
"id": 2,
"name": "music",
"title": "音乐",
"orderNum": 4,
"parentId": 0,
"isDisplay": true,
"categoryType": 0
},
{
"id": 3,
"name": "book",
"title": "有声书",
"orderNum": 1,
"parentId": 0,
"isDisplay": true,
"categoryType": 0
}
]
},
"status": "success"
}
}About the Ximalaya API
Content Discovery
get_categories returns the complete top-level category tree in a single call — no pagination required. Each category object includes id, name, title, categoryType, orderNum, and parentId. The name field is a pinyin string (e.g. youshengshu, ertong, xiangsheng) used directly as the category_name parameter in get_category_albums. That endpoint paginates results via page and page_size, and each album record exposes playCount, trackCount, isPaid, isFinished, and anchor identity fields (anchorName, uid).
Album and Track Detail
get_album_info accepts a numeric album_id and returns a richer metadata set: shortIntro, subscribeCount, createDate, isFinished (0=ongoing, 1=in-progress, 2=complete), and pricing. get_album_tracks lists individual tracks with duration in seconds, playtimes, likes, comments, and per-track isPaid/isFree/price fields. Tracks can be sorted ascending or descending by track order via the sort_asc parameter, and pagination is controlled with page and page_size; the response includes maxPageId and totalCount for full iteration.
Comments and User Profiles
get_album_comments returns paginated comment records with content, nickname, likes, replyCount, region, and createdAt timestamp. It also includes album-level rating data: albumScore (float out of 10), scoreDiagram (star distribution breakdown), and allCommentsCount for the true total. The order parameter accepts values like content-score-desc to sort by rating.
get_user_info fetches a public profile by uid, returning nickName, fansCount, albumsCount, tracksCount, anchorGrade, gender, province, and city. UIDs appear as anchorUid or uid fields in album and category results, making it straightforward to chain calls from content discovery to creator profile.
The Ximalaya API is a managed, monitored endpoint for ximalaya.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when ximalaya.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official ximalaya.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a Ximalaya podcast directory filtered by category using
get_categoriesandget_category_albumspinyin slugs. - Track play count growth over time for albums by periodically polling
get_album_infoforplayCountandsubscribeCount. - Analyze listener sentiment by aggregating
albumScore,scoreDiagram, and commentlikesfromget_album_comments. - Index Chinese audiobook and podcast metadata for a multilingual content discovery platform using
search_albumswith Chinese-language queries. - Monitor creator statistics —
fansCount,tracksCount,anchorGrade— across a cohort of anchors viaget_user_info. - Audit paid content availability across a category by checking
isPaidandisFreeflags returned byget_album_tracks. - Surface trending albums in a niche by sorting
get_category_albumsresults byplayCountacross pages.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Ximalaya have an official developer API?+
What does `get_album_tracks` return, and can I get audio file URLs?+
get_album_tracks returns trackId, title, duration (seconds), playtimes, likes, comments, isPaid, isFree, and price for each track. It does not return audio stream or download URLs — only metadata. You can fork the API on Parse and revise it to add a track audio URL endpoint if that field becomes accessible.Does the API cover individual track comments, not just album-level comments?+
get_album_comments returns comments attached to an album, along with the album's aggregate albumScore and scoreDiagram. Per-track comment threads are not covered. You can fork the API on Parse and revise it to add a track-level comments endpoint.How does pagination work across endpoints?+
get_category_albums, get_album_tracks, and get_album_comments all paginate via page and page_size parameters. Track and comment responses include maxPageId and totalCount so you can iterate all pages. get_categories and get_album_info return complete data in a single call with no pagination.Does `isFinished` reliably indicate whether an album is complete?+
isFinished field uses an integer enum: 0 = ongoing, 1 = in-progress/updating, 2 = finished. The interpretation of value 1 versus 0 can be ambiguous for actively updating serials, so treat it as a soft signal rather than a hard guarantee for time-sensitive workflows.