curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":[{"search_keyword":"cooking recipes","num_of_posts":20}],"limit_per_input":null}' \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lu702nij2f790tmv9h¬ify=false&include_errors=true&type=discover_new&discover_by=keyword"
import requests
response = requests.post(
"https://api.brightdata.com/datasets/v3/scrape",
params={
"dataset_id": "gd_lu702nij2f790tmv9h",
"notify": "false",
"include_errors": "true",
"type": "discover_new",
"discover_by": "keyword",
},
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"input": [
{
"search_keyword": "cooking recipes",
"num_of_posts": 20,
},
],
"limit_per_input": None,
},
)
print(response.text)
const params = new URLSearchParams({
dataset_id: "gd_lu702nij2f790tmv9h",
notify: "false",
include_errors: "true",
type: "discover_new",
discover_by: "keyword",
});
const response = await fetch(`https://api.brightdata.com/datasets/v3/scrape?${params}`, {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
input: [
{
search_keyword: "cooking recipes",
num_of_posts: 20,
},
],
limit_per_input: null,
}),
});
console.log(await response.text());
[
{
"post_id": "7500000000000000000",
"description": "Easy pasta recipe you need to try #cooking #recipes #foodtok",
"create_time": "2025-02-10T09:15:00.000Z",
"share_count": 3200,
"collect_count": 8900,
"comment_count": 1500,
"play_count": 5200000,
"video_duration": 60,
"hashtags": [
"#cooking",
"#recipes",
"#foodtok"
],
"video_url": "https://v16-webapp-prime.tiktok.com/video/example.mp4",
"profile_username": "homechef",
"profile_url": "https://www.tiktok.com/@homechef",
"is_verified": false
}
]
TikTok
Discover TikTok posts by keyword
Use the Bright Data Scraper API to discover TikTok posts by keyword. Calls the POST /datasets/v3/scrape endpoint and returns a snapshot ID.
POST
/
datasets
/
v3
/
scrape
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":[{"search_keyword":"cooking recipes","num_of_posts":20}],"limit_per_input":null}' \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lu702nij2f790tmv9h¬ify=false&include_errors=true&type=discover_new&discover_by=keyword"
import requests
response = requests.post(
"https://api.brightdata.com/datasets/v3/scrape",
params={
"dataset_id": "gd_lu702nij2f790tmv9h",
"notify": "false",
"include_errors": "true",
"type": "discover_new",
"discover_by": "keyword",
},
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"input": [
{
"search_keyword": "cooking recipes",
"num_of_posts": 20,
},
],
"limit_per_input": None,
},
)
print(response.text)
const params = new URLSearchParams({
dataset_id: "gd_lu702nij2f790tmv9h",
notify: "false",
include_errors: "true",
type: "discover_new",
discover_by: "keyword",
});
const response = await fetch(`https://api.brightdata.com/datasets/v3/scrape?${params}`, {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
input: [
{
search_keyword: "cooking recipes",
num_of_posts: 20,
},
],
limit_per_input: null,
}),
});
console.log(await response.text());
[
{
"post_id": "7500000000000000000",
"description": "Easy pasta recipe you need to try #cooking #recipes #foodtok",
"create_time": "2025-02-10T09:15:00.000Z",
"share_count": 3200,
"collect_count": 8900,
"comment_count": 1500,
"play_count": 5200000,
"video_duration": 60,
"hashtags": [
"#cooking",
"#recipes",
"#foodtok"
],
"video_url": "https://v16-webapp-prime.tiktok.com/video/example.mp4",
"profile_username": "homechef",
"profile_url": "https://www.tiktok.com/@homechef",
"is_verified": false
}
]
Query Parameters
string
default:"gd_lu702nij2f790tmv9h"
required
The dataset ID used for this request.
Must be set to
gd_lu702nij2f790tmv9h to collect Discover by Keyword data.string
default:"discover_new"
Must be set to
discover_new.string
default:"keyword"
Must be set to
keyword.boolean
default:false
Whether to send notifications when the request is completed.
boolean
default:true
Whether to include errors in the response.
Request Body
object[]
required
An array of input objects.
Show properties
Show properties
Example
{
"input": [
{
"search_keyword": "cooking recipes",
"num_of_posts": 20
}
]
}
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":[{"search_keyword":"cooking recipes","num_of_posts":20}],"limit_per_input":null}' \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lu702nij2f790tmv9h¬ify=false&include_errors=true&type=discover_new&discover_by=keyword"
import requests
response = requests.post(
"https://api.brightdata.com/datasets/v3/scrape",
params={
"dataset_id": "gd_lu702nij2f790tmv9h",
"notify": "false",
"include_errors": "true",
"type": "discover_new",
"discover_by": "keyword",
},
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"input": [
{
"search_keyword": "cooking recipes",
"num_of_posts": 20,
},
],
"limit_per_input": None,
},
)
print(response.text)
const params = new URLSearchParams({
dataset_id: "gd_lu702nij2f790tmv9h",
notify: "false",
include_errors: "true",
type: "discover_new",
discover_by: "keyword",
});
const response = await fetch(`https://api.brightdata.com/datasets/v3/scrape?${params}`, {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
input: [
{
search_keyword: "cooking recipes",
num_of_posts: 20,
},
],
limit_per_input: null,
}),
});
console.log(await response.text());
[
{
"post_id": "7500000000000000000",
"description": "Easy pasta recipe you need to try #cooking #recipes #foodtok",
"create_time": "2025-02-10T09:15:00.000Z",
"share_count": 3200,
"collect_count": 8900,
"comment_count": 1500,
"play_count": 5200000,
"video_duration": 60,
"hashtags": [
"#cooking",
"#recipes",
"#foodtok"
],
"video_url": "https://v16-webapp-prime.tiktok.com/video/example.mp4",
"profile_username": "homechef",
"profile_url": "https://www.tiktok.com/@homechef",
"is_verified": false
}
]
Was this page helpful?