Skip to content

Search users by keyword

GET
/twitter/user/search
const url = 'https://api.relayxapi.com/twitter/user/search?query=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);
}

Search profiles by keyword and return matching users ranked by relevance.

query
required
Query
string
cursor
Cursor
string
x-api-key
X-Api-Key
string

Successful Response

Media typeapplication/json
Example
{
"users": [
{
"type": "user",
"userName": "NASA",
"url": "https://x.com/NASA",
"id": "11348282",
"name": "NASA",
"isBlueVerified": true,
"description": "Making the seemingly impossible, possible. ✨",
"location": "Pale Blue Dot",
"followers": 92374422,
"following": 117,
"statusesCount": 74329,
"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": {},
"url": {
"urls": [
{
"display_url": "nasa.gov",
"expanded_url": "http://www.nasa.gov/",
"indices": [
0,
23
],
"url": "https://t.co/9NkQJKAnuU"
}
]
}
}
}
},
{
"type": "user",
"userName": "example_user9",
"url": "https://x.com/example_user9",
"id": "1000000000000000009",
"name": "Example User 9",
"isBlueVerified": true,
"description": "Example bio.",
"location": "",
"followers": 8901897,
"following": 44,
"statusesCount": 8457,
"createdAt": "Thu Mar 06 20:15:02 +0000 2008",
"profilePicture": "https://pbs.twimg.com/profile_images/example/avatar_normal.jpg",
"coverPicture": null,
"canDm": false,
"pinnedTweetIds": [],
"profile_bio": null
}
],
"status": "success",
"msg": "",
"has_next_page": false,
"next_cursor": ""
}

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"
}
]
}