curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":[{"user_name":"elonmusk"}],"limit_per_input":null}' \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lwxmeb2u1cniijd7t4¬ify=false&include_errors=true&type=discover_new&discover_by=user_name"
import requests
response = requests.post(
"https://api.brightdata.com/datasets/v3/scrape",
params={
"dataset_id": "gd_lwxmeb2u1cniijd7t4",
"notify": "false",
"include_errors": "true",
"type": "discover_new",
"discover_by": "user_name",
},
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"input": [{"user_name": "elonmusk"}],
"limit_per_input": None,
},
)
print(response.text)
const params = new URLSearchParams({
dataset_id: "gd_lwxmeb2u1cniijd7t4",
notify: "false",
include_errors: "true",
type: "discover_new",
discover_by: "user_name",
});
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: [{ user_name: "elonmusk" }],
limit_per_input: null,
}),
});
console.log(await response.text());
[
{
"x_id": "1077446982",
"url": "https://x.com/RepRWilliams",
"id": "RepRWilliams",
"profile_name": "Rep. Roger Williams",
"biography": "Chairman of @HouseSmallBiz. Conservative fighting for lower taxes, less regulations, and more freedom for Texans.",
"is_verified": true,
"profile_image_link": "https://pbs.twimg.com/...",
"external_link": "https://williams.house.gov/",
"date_joined": "2013-01-10T19:21:22.000Z",
"following": 910,
"followers": 24746,
"subscriptions": 0,
"location": "North Texas",
"birth_date": null,
"posts_count": 10434,
"posts": [
{
"date_posted": "2026-04-07T19:10:38.000Z",
"description": "As Chairman of @HouseSmallBiz, I have seen the positive impact the Working Families Tax Cuts have had on small businesses.",
"likes": 6,
"post_id": "2041594516373700624",
"post_url": "https://x.com/RepRWilliams/status/2041594516373700624",
"replies": 3,
"reposts": 3,
"views": 449
}
],
"is_business_account": false,
"is_government_account": false,
"banner_image": "https://pbs.twimg.com/..."
}
]
X (Twitter)
Discover X (Twitter) profiles by username
Discover X (Twitter) profile data by account username with the Bright Data Scraper API: POST /datasets/v3/scrape, dataset_id gd_lwxmeb2u1cniijd7t4.
POST
/
datasets
/
v3
/
scrape
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":[{"user_name":"elonmusk"}],"limit_per_input":null}' \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lwxmeb2u1cniijd7t4¬ify=false&include_errors=true&type=discover_new&discover_by=user_name"
import requests
response = requests.post(
"https://api.brightdata.com/datasets/v3/scrape",
params={
"dataset_id": "gd_lwxmeb2u1cniijd7t4",
"notify": "false",
"include_errors": "true",
"type": "discover_new",
"discover_by": "user_name",
},
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"input": [{"user_name": "elonmusk"}],
"limit_per_input": None,
},
)
print(response.text)
const params = new URLSearchParams({
dataset_id: "gd_lwxmeb2u1cniijd7t4",
notify: "false",
include_errors: "true",
type: "discover_new",
discover_by: "user_name",
});
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: [{ user_name: "elonmusk" }],
limit_per_input: null,
}),
});
console.log(await response.text());
[
{
"x_id": "1077446982",
"url": "https://x.com/RepRWilliams",
"id": "RepRWilliams",
"profile_name": "Rep. Roger Williams",
"biography": "Chairman of @HouseSmallBiz. Conservative fighting for lower taxes, less regulations, and more freedom for Texans.",
"is_verified": true,
"profile_image_link": "https://pbs.twimg.com/...",
"external_link": "https://williams.house.gov/",
"date_joined": "2013-01-10T19:21:22.000Z",
"following": 910,
"followers": 24746,
"subscriptions": 0,
"location": "North Texas",
"birth_date": null,
"posts_count": 10434,
"posts": [
{
"date_posted": "2026-04-07T19:10:38.000Z",
"description": "As Chairman of @HouseSmallBiz, I have seen the positive impact the Working Families Tax Cuts have had on small businesses.",
"likes": 6,
"post_id": "2041594516373700624",
"post_url": "https://x.com/RepRWilliams/status/2041594516373700624",
"replies": 3,
"reposts": 3,
"views": 449
}
],
"is_business_account": false,
"is_government_account": false,
"banner_image": "https://pbs.twimg.com/..."
}
]
Query Parameters
string
default:"gd_lwxmeb2u1cniijd7t4"
required
The dataset ID used for this request.
Must be set to
gd_lwxmeb2u1cniijd7t4 to collect Discover by Username data.string
default:"discover_new"
Must be set to
discover_new.string
default:"user_name"
Must be set to
user_name.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
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":[{"user_name":"elonmusk"}],"limit_per_input":null}' \
"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_lwxmeb2u1cniijd7t4¬ify=false&include_errors=true&type=discover_new&discover_by=user_name"
import requests
response = requests.post(
"https://api.brightdata.com/datasets/v3/scrape",
params={
"dataset_id": "gd_lwxmeb2u1cniijd7t4",
"notify": "false",
"include_errors": "true",
"type": "discover_new",
"discover_by": "user_name",
},
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"input": [{"user_name": "elonmusk"}],
"limit_per_input": None,
},
)
print(response.text)
const params = new URLSearchParams({
dataset_id: "gd_lwxmeb2u1cniijd7t4",
notify: "false",
include_errors: "true",
type: "discover_new",
discover_by: "user_name",
});
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: [{ user_name: "elonmusk" }],
limit_per_input: null,
}),
});
console.log(await response.text());
[
{
"x_id": "1077446982",
"url": "https://x.com/RepRWilliams",
"id": "RepRWilliams",
"profile_name": "Rep. Roger Williams",
"biography": "Chairman of @HouseSmallBiz. Conservative fighting for lower taxes, less regulations, and more freedom for Texans.",
"is_verified": true,
"profile_image_link": "https://pbs.twimg.com/...",
"external_link": "https://williams.house.gov/",
"date_joined": "2013-01-10T19:21:22.000Z",
"following": 910,
"followers": 24746,
"subscriptions": 0,
"location": "North Texas",
"birth_date": null,
"posts_count": 10434,
"posts": [
{
"date_posted": "2026-04-07T19:10:38.000Z",
"description": "As Chairman of @HouseSmallBiz, I have seen the positive impact the Working Families Tax Cuts have had on small businesses.",
"likes": 6,
"post_id": "2041594516373700624",
"post_url": "https://x.com/RepRWilliams/status/2041594516373700624",
"replies": 3,
"reposts": 3,
"views": 449
}
],
"is_business_account": false,
"is_government_account": false,
"banner_image": "https://pbs.twimg.com/..."
}
]
Was this page helpful?