X user profile by username — followers, bio, verified
x.x.user.profile.by_usernameGet any public X user's profile by handle
- Price
- $0.01/resultAt provider cost
- Success rate
- 100%Last 30 days · 78 calls
- Latency p50
- 146 msp95 369 ms
- Last verified
- Jul 28, 2026Verified working
GEThttps://toolswitch.dev/v1/tools/x.x.user.profile.by_username?user.fields=id%2Cname%2Cusername%2Cdescription%2Cpublic_metrics%2Cverified%2Ccreated_atPreviewTry onlineComing soonProvider docs ↗
- Uses platform quota
- Synchronous response
- Reads public data
Parameters
for several handles at once use GET /2/users/by?usernames=a,b,c (up to 100) — one request against the cap instead of 100
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Path parameters | ||||
username | string | Required | handle without the '@' | elonmusk |
| Query parameters | ||||
user.fields | string | Optional | id,name,username,description,public_metrics,verified,created_at | |
- Path parameters
usernamestringRequiredhandle without the '@'
Example:
elonmusk- Query parameters
user.fieldsstringOptionalExample:
id,name,username,description,public_metrics,verified,created_at
Code samples
Replace $TOOLSWITCH_KEY with the key you created in the console.
Preview
curl -X GET 'https://toolswitch.dev/v1/tools/x.x.user.profile.by_username?user.fields=id%2Cname%2Cusername%2Cdescription%2Cpublic_metrics%2Cverified%2Ccreated_at' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/x.x.user.profile.by_username?user.fields=id%2Cname%2Cusername%2Cdescription%2Cpublic_metrics%2Cverified%2Ccreated_at",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/x.x.user.profile.by_username?user.fields=id%2Cname%2Cusername%2Cdescription%2Cpublic_metrics%2Cverified%2Ccreated_at", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());This gateway API is in preview; its URL and authentication may change. The example parameters are sample data. Calls are billed at $0.01/result, including the service fee.