curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":[{"keyword":"machine learning","date":"Past week","num_of_posts":100},{"keyword":"python tips","date":"Past month","num_of_posts":50}],"limit_per_input":10}' \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvz8ah06191smkebj4¬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_lvz8ah06191smkebj4",
"notify": "false",
"include_errors": "true",
"type": "discover_new",
"discover_by": "keyword",
},
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"input": [
{
"keyword": "machine learning",
"date": "Past week",
"num_of_posts": 100,
},
{
"keyword": "python tips",
"date": "Past month",
"num_of_posts": 50,
},
],
"limit_per_input": 10,
},
)
print(response.text)
const params = new URLSearchParams({
dataset_id: "gd_lvz8ah06191smkebj4",
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: [
{
keyword: "machine learning",
date: "Past week",
num_of_posts: 100,
},
{
keyword: "python tips",
date: "Past month",
num_of_posts: 50,
},
],
limit_per_input: 10,
}),
});
console.log(await response.text());
[
{
"post_id": "1bsdf34",
"url": "https://www.reddit.com/r/MachineLearning/comments/1bsdf34/",
"user_posted": "ml_researcher",
"title": "New paper on transformer efficiency",
"description": "Sharing a recent paper...",
"num_upvotes": 842,
"num_comments": 54,
"date_posted": "2026-04-03T09:14:00Z",
"tag": "Research",
"community_name": "MachineLearning",
"community_url": "https://www.reddit.com/r/MachineLearning",
"community_description": "Beginners to experts.",
"community_members_num": 2900000,
"community_rank": null,
"related_posts": [],
"comments": [],
"photos": [],
"videos": []
}
]
Reddit
按关键词发现 Reddit 帖子
使用 Bright Data Scraper API 发现与搜索关键词匹配的 Reddit 帖子。发送 POST /datasets/v3/scrape 请求,dataset_id 为 gd_lvz8ah06191smkebj4。
POST
/
datasets
/
v3
/
scrape
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":[{"keyword":"machine learning","date":"Past week","num_of_posts":100},{"keyword":"python tips","date":"Past month","num_of_posts":50}],"limit_per_input":10}' \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvz8ah06191smkebj4¬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_lvz8ah06191smkebj4",
"notify": "false",
"include_errors": "true",
"type": "discover_new",
"discover_by": "keyword",
},
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"input": [
{
"keyword": "machine learning",
"date": "Past week",
"num_of_posts": 100,
},
{
"keyword": "python tips",
"date": "Past month",
"num_of_posts": 50,
},
],
"limit_per_input": 10,
},
)
print(response.text)
const params = new URLSearchParams({
dataset_id: "gd_lvz8ah06191smkebj4",
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: [
{
keyword: "machine learning",
date: "Past week",
num_of_posts: 100,
},
{
keyword: "python tips",
date: "Past month",
num_of_posts: 50,
},
],
limit_per_input: 10,
}),
});
console.log(await response.text());
[
{
"post_id": "1bsdf34",
"url": "https://www.reddit.com/r/MachineLearning/comments/1bsdf34/",
"user_posted": "ml_researcher",
"title": "New paper on transformer efficiency",
"description": "Sharing a recent paper...",
"num_upvotes": 842,
"num_comments": 54,
"date_posted": "2026-04-03T09:14:00Z",
"tag": "Research",
"community_name": "MachineLearning",
"community_url": "https://www.reddit.com/r/MachineLearning",
"community_description": "Beginners to experts.",
"community_members_num": 2900000,
"community_rank": null,
"related_posts": [],
"comments": [],
"photos": [],
"videos": []
}
]
查询参数
string
默认值:"gd_lvz8ah06191smkebj4"
必填
用于此请求的数据集ID。
必须设置为
gd_lvz8ah06191smkebj4 以收集按关键词发现数据。string
默认值:"discover_new"
必须设置为
discover_new。string
默认值:"keyword"
必须设置为
keyword。boolean
默认值:false
请求完成时是否发送通知。
boolean
默认值:true
是否在响应中包含错误。
请求体
object[]
必填
输入对象的数组。
显示 属性
显示 属性
示例
{
"input": [
{"keyword": "machine learning", "date": "Past week", "num_of_posts": 100},
{"keyword": "python tips", "date": "Past month", "num_of_posts": 50}
]
}
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":[{"keyword":"machine learning","date":"Past week","num_of_posts":100},{"keyword":"python tips","date":"Past month","num_of_posts":50}],"limit_per_input":10}' \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lvz8ah06191smkebj4¬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_lvz8ah06191smkebj4",
"notify": "false",
"include_errors": "true",
"type": "discover_new",
"discover_by": "keyword",
},
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"input": [
{
"keyword": "machine learning",
"date": "Past week",
"num_of_posts": 100,
},
{
"keyword": "python tips",
"date": "Past month",
"num_of_posts": 50,
},
],
"limit_per_input": 10,
},
)
print(response.text)
const params = new URLSearchParams({
dataset_id: "gd_lvz8ah06191smkebj4",
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: [
{
keyword: "machine learning",
date: "Past week",
num_of_posts: 100,
},
{
keyword: "python tips",
date: "Past month",
num_of_posts: 50,
},
],
limit_per_input: 10,
}),
});
console.log(await response.text());
[
{
"post_id": "1bsdf34",
"url": "https://www.reddit.com/r/MachineLearning/comments/1bsdf34/",
"user_posted": "ml_researcher",
"title": "New paper on transformer efficiency",
"description": "Sharing a recent paper...",
"num_upvotes": 842,
"num_comments": 54,
"date_posted": "2026-04-03T09:14:00Z",
"tag": "Research",
"community_name": "MachineLearning",
"community_url": "https://www.reddit.com/r/MachineLearning",
"community_description": "Beginners to experts.",
"community_members_num": 2900000,
"community_rank": null,
"related_posts": [],
"comments": [],
"photos": [],
"videos": []
}
]
此页面对您有帮助吗?