Skip to content

Batch user info by ids

GET
/twitter/user/batch_info_by_ids
const url = 'https://api.relayxapi.com/twitter/user/batch_info_by_ids?userIds=example';
const options = {
method: 'GET',
headers: { 'X-API-Key': '<api-key>' },
};
try {
const res = await fetch(url, options);
const data = await res.json();
console.log(data);
} catch (err) {
console.error(err);
}

Resolve many numeric user ids to full profiles in one call — far cheaper per user than looking them up individually.

userIds
required
Userids

Comma-separated user ids

string

Comma-separated user ids

x-api-key
X-Api-Key
string

Successful Response

Media typeapplication/json
Example
{
"status": "success",
"msg": "",
"users": [
{
"type": "user",
"userName": "jack",
"url": "https://x.com/jack",
"id": "12",
"name": "jack",
"isBlueVerified": true,
"description": "no state is the best state",
"location": null,
"followers": 12300500,
"following": 3,
"statusesCount": null,
"createdAt": "Tue Mar 21 20:50:14 +0000 2006",
"profilePicture": "https://pbs.twimg.com/profile_images/1661201415899951105/azNjKOSH_normal.jpg",
"coverPicture": "https://pbs.twimg.com/profile_banners/12/1742427520",
"canDm": true,
"pinnedTweetIds": [],
"profile_bio": {
"description": "no state is the best state",
"entities": {
"description": {}
}
}
},
{
"type": "user",
"userName": "NASA",
"url": "https://x.com/NASA",
"id": "11348282",
"name": "NASA",
"isBlueVerified": true,
"description": "Making the seemingly impossible, possible. ✨",
"location": null,
"followers": 92374422,
"following": 117,
"statusesCount": null,
"createdAt": "Wed Dec 19 20:20:32 +0000 2007",
"profilePicture": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
"coverPicture": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
"canDm": false,
"pinnedTweetIds": [],
"profile_bio": {
"description": "Making the seemingly impossible, possible. ✨",
"entities": {
"description": {}
}
}
}
]
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}