Twitter/X - Scrape Profile
Write to /tmp/brightdata_request.json:
```json
[
{"url": "https://twitter.com/elonmusk"}
]
```
Then run (replace with your actual dataset ID):
```bash
bash -c 'curl -s -X POST "https://api.brightdata.com/datasets/v3/scrape?dataset_id=" \
-H "Authorization: Bearer ${BRIGHTDATA_API_KEY}" \
-H "Content-Type: application/json" \
-d @/tmp/brightdata_request.json'
```
Returns: x_id, profile_name, biography, is_verified, followers, following, profile_image_link
Twitter/X - Scrape Posts
Write to /tmp/brightdata_request.json:
```json
[
{"url": "https://twitter.com/username/status/123456789"}
]
```
Then run (replace with your actual dataset ID):
```bash
bash -c 'curl -s -X POST "https://api.brightdata.com/datasets/v3/scrape?dataset_id=" \
-H "Authorization: Bearer ${BRIGHTDATA_API_KEY}" \
-H "Content-Type: application/json" \
-d @/tmp/brightdata_request.json'
```
Returns: post_id, text, replies, likes, retweets, views, hashtags, media
---
Reddit - Scrape Subreddit Posts
Write to /tmp/brightdata_request.json:
```json
[
{"url": "https://www.reddit.com/r/technology", "sort_by": "hot"}
]
```
Then run (replace with your actual dataset ID):
```bash
bash -c 'curl -s -X POST "https://api.brightdata.com/datasets/v3/trigger?dataset_id=" \
-H "Authorization: Bearer ${BRIGHTDATA_API_KEY}" \
-H "Content-Type: application/json" \
-d @/tmp/brightdata_request.json'
```
Parameters: url, sort_by (new/top/hot)
Returns: post_id, title, description, num_comments, upvotes, date_posted, community
Reddit - Scrape Comments
Write to /tmp/brightdata_request.json:
```json
[
{"url": "https://www.reddit.com/r/technology/comments/xxxxx/post_title"}
]
```
Then run (replace with your actual dataset ID):
```bash
bash -c 'curl -s -X POST "https://api.brightdata.com/datasets/v3/scrape?dataset_id=" \
-H "Authorization: Bearer ${BRIGHTDATA_API_KEY}" \
-H "Content-Type: application/json" \
-d @/tmp/brightdata_request.json'
```
Returns: comment_id, user_posted, comment_text, upvotes, replies
---
YouTube - Scrape Video Info
Write to /tmp/brightdata_request.json:
```json
[
{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}
]
```
Then run (replace with your actual dataset ID):
```bash
bash -c 'curl -s -X POST "https://api.brightdata.com/datasets/v3/scrape?dataset_id=" \
-H "Authorization: Bearer ${BRIGHTDATA_API_KEY}" \
-H "Content-Type: application/json" \
-d @/tmp/brightdata_request.json'
```
Returns: title, views, likes, num_comments, video_length, transcript, channel_name
YouTube - Search by Keyword
Write to /tmp/brightdata_request.json:
```json
[
{"keyword": "artificial intelligence", "num_of_posts": 50}
]
```
Then run (replace with your actual dataset ID):
```bash
bash -c 'curl -s -X POST "https://api.brightdata.com/datasets/v3/trigger?dataset_id=" \
-H "Authorization: Bearer ${BRIGHTDATA_API_KEY}" \
-H "Content-Type: application/json" \
-d @/tmp/brightdata_request.json'
```
YouTube - Scrape Comments
Write to /tmp/brightdata_request.json:
```json
[
{"url": "https://www.youtube.com/watch?v=xxxxx", "load_replies": 3}
]
```
Then run (replace with your actual dataset ID):
```bash
bash -c 'curl -s -X POST "https://api.brightdata.com/datasets/v3/scrape?dataset_id=" \
-H "Authorization: Bearer ${BRIGHTDATA_API_KEY}" \
-H "Content-Type: application/json" \
-d @/tmp/brightdata_request.json'
```
Returns: comment_text, likes, replies, username, date
---
Instagram - Scrape Profile
Write to /tmp/brightdata_request.json:
```json
[
{"url": "https://www.instagram.com/username"}
]
```
Then run (replace with your actual dataset ID):
```bash
bash -c 'curl -s -X POST "https://api.brightdata.com/datasets/v3/scrape?dataset_id=" \
-H "Authorization: Bearer ${BRIGHTDATA_API_KEY}" \
-H "Content-Type: application/json" \
-d @/tmp/brightdata_request.json'
```
Returns: followers, post_count, profile_name, is_verified, biography
Instagram - Scrape Posts
Write to /tmp/brightdata_request.json:
```json
[
{
"url": "https://www.instagram.com/username",
"num_of_posts": 20,
"start_date": "01-01-2024",
"end_date": "12-31-2024"
}
]
```
Then run (replace with your actual dataset ID):
```bash
bash -c 'curl -s -X POST "https://api.brightdata.com/datasets/v3/trigger?dataset_id=" \
-H "Authorization: Bearer ${BRIGHTDATA_API_KEY}" \
-H "Content-Type: application/json" \
-d @/tmp/brightdata_request.json'
```
---