# Ximalaya — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Browse Ximalaya's audio content by exploring categories and albums, retrieving detailed album information and track listings, viewing user profiles, and reading user comments. Search for albums and discover audio content organized by category with complete metadata.

**Category:** Music | **Website:** [ximalaya.com/](https://ximalaya.com/) | **Docs:** [parse.bot/marketplace/68118e85-be31-48ac-a115-727d8b853d2e/ximalaya-com-api](https://parse.bot/marketplace/68118e85-be31-48ac-a115-727d8b853d2e/ximalaya-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-ximalaya-com-api-68118e85/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_album_comments

Retrieve comments for an album with pagination. Returns comment content, author nickname, likes, reply count, region, creation timestamp, and overall album score/rating statistics.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `album_id` | string | Yes | Numeric album ID (e.g. 77855794). Obtainable from get_category_albums or search_albums results. |
| `order` | string | No | Sort order for comments (e.g. content-score-desc). |
| `page` | integer | No | Page number for pagination. |
| `page_size` | integer | No | Number of comments per page. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ximalaya-com-api-68118e85/get_album_comments \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"album_id":"<string>","order":"<string>","page":"<integer>","page_size":"<integer>"}'
```

### get_album_info

Retrieve detailed metadata for a single album by its numeric ID. Returns title, cover, play count, subscription count, pricing, intro text, category, creation/update dates, and anchor details. A single round-trip; no pagination.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `album_id` | string | Yes | Numeric album ID (e.g. 77855794). Obtainable from get_category_albums or search_albums results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ximalaya-com-api-68118e85/get_album_info \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"album_id":"<string>"}'
```

### get_album_tracks

List tracks within an album with pagination. Returns track title, duration (seconds), play count, likes, comments count, pricing info, and order number. Paginates via page number.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `album_id` | string | Yes | Numeric album ID (e.g. 77855794). Obtainable from get_category_albums or search_albums results. |
| `page` | integer | No | Page number for pagination. |
| `page_size` | integer | No | Number of tracks per page. |
| `sort_asc` | string | No | Sort order. Accepted values: true (ascending by track order), false (descending). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ximalaya-com-api-68118e85/get_album_tracks \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"album_id":"<string>","page":"<integer>","page_size":"<integer>","sort_asc":"<string>"}'
```

### get_categories

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).

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ximalaya-com-api-68118e85/get_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_category_albums

List albums within a category, sorted by popularity. Category is identified by its pinyin name (from get_categories). Paginates via page number; each page returns up to page_size albums with play counts, track counts, and anchor info.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_name` | string | No | Category pinyin name from get_categories (e.g. youshengshu, yinyue, ertong, xiangsheng, comic, finance, culture, kid, entertainment, train). |
| `page` | integer | No | Page number for pagination. |
| `page_size` | integer | No | Number of albums per page. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ximalaya-com-api-68118e85/get_category_albums \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_name":"<string>","page":"<integer>","page_size":"<integer>"}'
```

### get_user_info

Retrieve public profile information for a user or anchor by numeric UID. Returns nickname, avatar, fan count, following count, track/album counts, personal signature, province/city, anchor grade, and live-stream status.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `uid` | string | Yes | Numeric user ID (e.g. 10778196). Obtainable from album or track details (anchorUid or uid field). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ximalaya-com-api-68118e85/get_user_info \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"uid":"<string>"}'
```

### search_albums

Full-text search for albums by keyword. Supports Chinese and English queries. Returns paginated results with album summaries including play counts, track counts, anchor name, and intro text.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. |
| `page_size` | integer | No | Number of results per page. |
| `query` | string | Yes | Search keyword (supports Chinese characters and English). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ximalaya-com-api-68118e85/search_albums \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","page_size":"<integer>","query":"<string>"}'
```
