Check Follow Relationship
Check whether source_user_name follows target_user_name (following) and whether target_user_name follows source_user_name (followed_by). One request returns both directions, plus both screen names and user IDs. $0.05/1000 calls.
Back to API Reference
/Followers & Following Endpoints
GET
/twitter/user/check_follow_relationshipAuthorization
AuthorizationBearer token · headerrequiredGlobal API Bearer Token for TwexAPI. Included as: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Query Parameters
source_user_namestringrequiredScreen name of the source user (with or without @).
matches ^\s*@?[A-Za-z0-9_]{1,15}\s*$
target_user_namestringrequiredScreen name of the target user (with or without @).
matches ^\s*@?[A-Za-z0-9_]{1,15}\s*$
Responses
200Follow relationship in both directions
codeintegerrequiredmsgstringrequireddataCheckFollowRelationshipDatarequiredShow propertiesHide properties
source_user_namestringrequiredScreen name of the source user, as returned by X.
source_user_idstring | anyrequiredUser ID of the source user.
Show propertiesHide properties
Any of:
string
stringany
anytarget_user_namestringrequiredScreen name of the target user, as returned by X.
target_user_idstring | anyrequiredUser ID of the target user.
Show propertiesHide properties
Any of:
string
stringany
anyfollowingbooleanrequiredWhether the source user follows the target user.
followed_bybooleanrequiredWhether the target user follows the source user.
400Missing or invalid screen name
codeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
Any of:
any[]
Array of
anyanyany
any401Authentication failed
codeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
Any of:
any[]
Array of
anyanyany
any403A user is suspended, or authentication or quota was denied
codeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
Any of:
any[]
Array of
anyanyany
any404One of the users was not found
codeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
Any of:
any[]
Array of
anyanyany
any429Rate limit exceeded
codeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
Any of:
any[]
Array of
anyanyany
any500Server error
codeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
Any of:
any[]
Array of
anyanyany
any502Upstream service error
codeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
Any of:
any[]
Array of
anyanyany
any503Service temporarily unavailable
codeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
Any of:
any[]
Array of
anyanyany
any504Upstream request timed out
codeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
Any of:
any[]
Array of
anyanyany
any⚡Interactive ConsoleGET
⚡Interactive Console / Try APIGETLive Console
🌐Target Server:
https://api.twexapi.io● Production Ready
🔍
Public Data Read (TwexAPI Key Only, No Twitter Cookie Required)
This endpoint queries public Twitter data — no Twitter account or Cookie required! Simply enter your TwexAPI Platform Key (Bearer Token) in the "API Authorization" section below to test.
🔑API Authorization
⚙️Parameters (2)
📡
No Response Yet
Configure parameters in the Request tab and click Send Request below.
Request
curl -X GET "https://api.twexapi.io/twitter/user/check_follow_relationship?source_user_name=elonmusk&target_user_name=X" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.twexapi.io/twitter/user/check_follow_relationship?source_user_name=elonmusk&target_user_name=X", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});import requests
response = requests.get(
"https://api.twexapi.io/twitter/user/check_follow_relationship?source_user_name=elonmusk&target_user_name=X",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)Response
{
"code": 200,
"msg": "success",
"data": {
"source_user_name": "elonmusk",
"source_user_id": "44196397",
"target_user_name": "X",
"target_user_id": "783214",
"following": true,
"followed_by": false
}
}{
"code": 400,
"msg": "Validation error: querystring.target_user_name: Field required",
"data": null
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 404,
"msg": "X user was not found. (50)",
"data": null
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}