TikTok API
Search Photos
Search TikTok for photo posts matching a keyword query.
POST
$0.01/call/v1/tiktok/search-photoUsage
const res = await fetch('https://api.yepapi.com/v1/tiktok/search-photo', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ keywords: 'travel photography' }),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/tiktok/search-photo \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"keywords": "travel photography"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
keywords | string | Yes | Search query for photo posts | — |
cursor | string | No | Pagination cursor from previous response | — |
count | number | No | Number of results to return | 20 |
Response
{
"ok": true,
"data": {
"has_more": true,
"cursor": "20",
"photos": [
{
"video_id": "7389012345678901234",
"description": "Hidden gems in Bali #travel #photography",
"create_time": 1712456789,
"author": {
"unique_id": "traveler_jake",
"nickname": "Jake Travels",
"avatar": "https://p16-sign.tiktokcdn.com/..."
},
"images": [
"https://p16-sign.tiktokcdn.com/image1.jpg",
"https://p16-sign.tiktokcdn.com/image2.jpg"
],
"statistics": {
"digg_count": 45000,
"comment_count": 890,
"share_count": 2300
}
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.has_more | boolean | Whether more results are available |
data.cursor | string | Cursor for fetching the next page |
data.photos | object[] | Array of photo post results |
data.photos[].video_id | string | Unique post identifier |
data.photos[].description | string | Post caption text |
data.photos[].create_time | number | Unix timestamp of when the post was created |
data.photos[].author | object | Post author information |
data.photos[].images | string[] | Array of image URLs in the photo post |
data.photos[].statistics | object | Engagement metrics (likes, comments, shares) |
Use the cursor value from the response to paginate through results.