Documentation Index
Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
Use this file to discover all available pages before exploring further.
本教程将引导您向每个 Bright Data LinkedIn Scraper API 端点发送同步请求。完成后,您将获得用于个人资料、公司、职位和帖子的工作示例。
前置条件
请求结构
每个同步请求都遵循相同的模式:
POST https://api.brightdata.com/datasets/v3/scrape?dataset_id={DATASET_ID}&format=json
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
[{"url": "https://www.linkedin.com/..."}]
端点之间唯一改变的是 dataset_id 和输入 URL 格式。
同步请求最多支持 20 个 URL,超时时间为 1 分钟。如果请求耗时较长,API 将自动返回 snapshot_id。请参阅异步请求。
个人资料
数据集 ID: gd_l1viktl72bvl7bjuj0
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1viktl72bvl7bjuj0&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.linkedin.com/in/satyanadella"}]'
您应该看到 200 响应。这需要 10-30 秒。
[
{
"name": "Satya Nadella",
"city": "Redmond",
"country_code": "US",
"position": "Chairman and CEO at Microsoft",
"current_company": {
"name": "Microsoft",
"company_id": "microsoft",
"link": "https://www.linkedin.com/company/microsoft"
},
"about": "Chairman and CEO at Microsoft...",
"followers": 10842560,
"connections": 500
}
]
完整个人资料响应模式
数据集 ID: gd_l1vikfnt1wgvvqz95w
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1vikfnt1wgvvqz95w&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.linkedin.com/company/microsoft"}]'
[
{
"name": "Microsoft",
"followers": 23000000,
"employees_in_linkedin": 290000,
"about": "Every company has a mission...",
"industries": ["Software Development"],
"company_size": "10,001+ employees",
"headquarters": "Redmond, Washington",
"website": "https://www.microsoft.com",
"founded": "1975"
}
]
完整公司响应模式
数据集 ID: gd_lpfll7v5hcqtkxl6l
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lpfll7v5hcqtkxl6l&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.linkedin.com/jobs/view/3986111804"}]'
[
{
"job_title": "Software Engineer",
"company_name": "Epic",
"job_location": "Verona, WI",
"job_seniority_level": "Entry level",
"job_employment_type": "Full-time",
"job_industries": ["Software Development"],
"job_summary": "Work on healthcare software that impacts millions...",
"apply_link": "https://www.linkedin.com/jobs/view/3986111804/apply",
"is_easy_apply": true
}
]
完整职位响应模式
数据集 ID: gd_lyy3tktm25m4avu764
curl -X POST \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lyy3tktm25m4avu764&format=json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url": "https://www.linkedin.com/posts/satyanadella_activity-7180537307521769472"}]'
[
{
"post_text": "Excited to share our latest AI innovations...",
"num_likes": 45230,
"num_comments": 1250,
"date_posted": "2024-04-03T14:30:00.000Z",
"hashtags": ["AI", "Innovation"],
"user_followers": 10842560,
"post_type": "original"
}
]
完整帖子响应模式
快速参考:数据集 ID
| 端点 | 数据集 ID | URL 模式 |
|---|
| 个人资料 | gd_l1viktl72bvl7bjuj0 | linkedin.com/in/{username} |
| 公司 | gd_l1vikfnt1wgvvqz95w | linkedin.com/company/{slug} |
| 职位 | gd_lpfll7v5hcqtkxl6l | linkedin.com/jobs/view/{id} |
| 帖子 | gd_lyy3tktm25m4avu764 | linkedin.com/posts/{slug} |
输出格式
使用 format 查询参数控制响应格式:
| 值 | 描述 |
|---|
json | JSON 数组(默认) |
ndjson | 换行分隔的 JSON,每行一条记录 |
csv | 逗号分隔值 |
后续步骤
异步批处理请求
在单个批处理作业中抓取数百个 URL。