# TikTok Music Search API

> Returns TikTok music search results matching specified keywords, with options to filter by title or author and sort by usage or duration.

Source: https://www.sandbase.ai/model/tiktok/app-v3/music-search-result
API reference: https://www.sandbase.ai/model/tiktok/app-v3/music-search-result/docs

## Facts

- Provider: TikTok
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/tiktok/app-v3/music-search-result`
- Price: $0.0015 per call
- Free allowance: 100 calls per organization per UTC day, shared across eligible APIs
- Capabilities: api, tiktok
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/tiktok/app-v3/music-search-result` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `keyword` | string | yes |  |
| `count` | integer | no |  |
| `filter_by` | integer | no |  |
| `offset` | integer | no |  |
| `region` | string | no |  |
| `sort_type` | integer | no |  |

## FAQ

### How do I use the TikTok Music Search API?

Send a POST request to https://api.sandbase.ai/v1/api/tiktok/app-v3/music-search-result with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the TikTok Music Search API cost?

$0.0015 per call. Every organization gets 100 free calls per UTC day, shared across eligible SandBase APIs including this one; after that each call is billed at this price from your SandBase balance. There is no subscription.

### What parameters does the TikTok Music Search API accept?

Required: keyword (string). Optional: count (integer), filter_by (integer), offset (integer), region (string) and sort_type (integer). The Parameters table and the Playground on this page list every field.

### What does the TikTok Music Search API return?

A JSON response returned in the same HTTP request (synchronous). The README on this page includes a sample response.

### Do I need a TikTok developer account or API key?

No. TikTok Music Search runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for TikTok API access separately.

## README

### TikTok Music Search API

Search for TikTok music tracks using a specified `keyword`. Filter by title or artist and sort results by relevance, usage, or duration.

#### Use cases

- Search TikTok tracks by keyword, title, or artist name.
- Filter music track results for specific target regions.
- Discover popular audio tracks sorted by usage count or duration.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/tiktok/app-v3/music-search-result" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword": "openai"}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `keyword` | string | Yes | Keyword |
| `count` | integer | No | Number, do not exceed 20 |
| `offset` | integer | No | Offset, starting from 0, the second page gets the cursor value from the response as the offset to continue the request. |
| `region` | string | No | Region, default is US-America, for optional values please refer to TikTok region codes or ISO 3166-1 alpha-2 country codes. |
| `filter_by` | integer | No | Filter type, 0-All, 1-Title, 2-Author, default is 0-All |
| `sort_type` | integer | No | Sort type, 0-Relatedness, 1-Most used, 2-Latest, 3-Shortest duration, 4-Longest duration, default is 0-Relatedness |

#### Example response

Real response for the request above, trimmed to the main fields. User names and long IDs are masked.

```json
{
  "music": [
    {
      "audition_duration": 60,
      "author": "OpenAI",
      "author_deleted": false,
      "binded_challenge_id": 0,
      "commercial_right_type": 1,
      "create_time": 1676501099,
      "duration": 60,
      "id": 7200517085770811393,
      "music_group_use_count": 0,
      "music_ugid_use_count": 0,
      "duration_high_precision": {
        "audition_duration_precision": 60,
        "duration_precision": 60,
        "shoot_duration_precision": 60,
        "video_duration_precision": 60
      },
      "matched_song": {
        "author": "OpenAI",
        "full_duration": 275100,
        "id": "7200516864395462658",
        "title": "Chatbot"
      },
      "music_release_info": {
        "group_release_date": 0
      }
    }
  ]
}
```

#### Notes

- `filter_by` supports `0` (All), `1` (Title), and `2` (Author).
- `sort_type` supports `0` (Relatedness), `1` (Most used), `2` (Latest), `3` (Shortest duration), and `4` (Longest duration).
- `count` must not exceed 20, with subsequent pages using the response cursor as the `offset`.

#### Related APIs

- [TikTok LIVE Status](/model/tiktok/app-v3/check-live-room-online): Check whether a TikTok LIVE room is currently live by room ID.
- [TikTok Room Online Status Batch](/model/tiktok/app-v3/check-live-room-online-batch): Returns the online availability status for multiple TikTok broadcast rooms in a single request.
- [TikTok Content Translation](/model/tiktok/app-v3/content-translate): Translates provided text content into a designated target language.
