Check Follow
GET
/tw-v2/user/friendshipDescription
Check if a follow relationship exists between two Twitter/X users.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| subjectId | string | required | The user ID of the subject user (the follower) |
| targetId | string | required | The user ID of the target user (the one being followed) |
Code Examples
const params = new URLSearchParams({
subjectId: '44196397',
targetId: '123456789'
});
const response = await fetch(`https://api.tweetapi.com/tw-v2/user/friendship?${params}`, {
method: 'GET',
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data);
Response
Success Response (200 OK)
200
{
"data": {
"sourceId": "44196397",
"targetId": "427089628",
"following": true,
"followedBy": true,
"blocking": false,
"blockedBy": false,
"muting": false,
"notificationsEnabled": false,
"canDm": true,
"followRequestSent": false,
"followRequestReceived": false,
"wantRetweets": false,
"markedSpam": false,
"allReplies": false,
"canMediaTag": false
}
}API Playground
GET
/tw-v2/user/friendshipPress ⌘ + Enter to execute
curl -X GET "https://api.tweetapi.com/tw-v2/user/friendship" \
-H "X-API-Key: YOUR_API_KEY"Response
Click "Try It!" to see the response