> ## Documentation Index
> Fetch the complete documentation index at: https://traceryn.online/llms.txt
> Use this file to discover all available pages before exploring further.

# Methods

> Reference for every method on the TikTokClient in @traceryn/tiktok-sdk.

All data methods are async and return structured objects. Sample responses are in the repository's [`docs/responses`](https://github.com/Traceryn/tiktok-sdk/tree/master/docs/responses) directory.

## Videos

| Method | Description |
| - | - |
| `getVideo(url)` | Get video data from a TikTok link. |
| `getTrendingVideos()` | Get the current trending videos. |
| `getUserLikedVideos(username)` | Get videos a user liked. |

```ts theme={null}
const video = await client.getVideo('https://www.tiktok.com/@user/video/1234567890');
console.log(video.title);

const trending = await client.getTrendingVideos();
console.log(trending.videos.length);
```

## Users

| Method | Description |
| - | - |
| `getUser(usernameOrUrl)` | Get user profile data from a username or profile link. |
| `searchUsers(query)` | Search for TikTok users by keyword. Requires a [Playwright session](https://traceryn.online/tiktok-sdk/playwright-sessions.md) from datacenter IPs. |

```ts theme={null}
const user = await client.getUser('tiktok');
console.log(user.nickname);

const search = await client.searchUsers('tiktok');
console.log(search.users.length);
```

## Comments

| Method | Description |
| - | - |
| `getComments(videoUrl)` | Get comments from a video or post. |

```ts theme={null}
const comments = await client.getComments('https://www.tiktok.com/@user/video/1234567890');
console.log(comments.comments.length);
```

## Hashtags

| Method | Description |
| - | - |
| `getHashtag(name)` | Get hashtag stats. |

```ts theme={null}
const hashtag = await client.getHashtag('fyp');
console.log(hashtag.stats.videoCount);
```

## Sounds

| Method | Description |
| - | - |
| `getSound(musicId)` | Get sound info. Requires a Playwright session from datacenter IPs. |
| `getSoundVideos(musicId)` | Get videos using a sound. Requires a Playwright session from datacenter IPs. |

## Playlists

| Method | Description |
| - | - |
| `getUserPlaylists(username)` | Get playlists for a user. |
| `getPlaylist(mixId)` | Get one playlist. |
| `getPlaylistVideos(mixId)` | Get videos inside a playlist. |

## Proxies

| Method | Description |
| - | - |
| `addProxies(proxies)` | Add your own proxies. |
| `getProxyStats()` | Check proxy usage. |

See [Proxies](https://traceryn.online/tiktok-sdk/proxies.md).

## Cache

| Method | Description |
| - | - |
| `invalidateCache(url)` | Clear one cached video. |
| `clearCache()` | Clear all cached video data. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.