Check Follow

GET/tw-v2/user/friendship

Description

Check if a follow relationship exists between two users.

Parameters

ParameterTypeRequiredDescription
subjectIdstringrequiredThe user ID of the subject user (the follower)
targetIdstringrequiredThe user ID of the target user (the one being followed)

Code Examples

const params = new URLSearchParams({
  subjectId: '90013690',
  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": "90013690",
    "targetId": "900114305",
    "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/friendship

Press ⌘ + 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