GetXAPI
Users

Check Relationship

Check if one Twitter user follows another via API. $0.001 per call. GetXAPI follow relationship check endpoint documentation.

GET/twitter/user/check_follow_relationship

This endpoint costs $0.001 per API call.

Query Parameters

ParameterTypeRequiredDescription
source_user_namestringYesSource user screen name (without @)
target_user_namestringYesTarget user screen name (without @)
auth_tokenstringNoauth_token of the source account. Required to read blocking/blockedBy/muting — without it they return null (see Notes).
ct0stringNoCurrent CSRF token cookie for the source account. Send with twid to skip credential bootstrap.
twidstringNoCurrent user ID cookie for the source account, e.g. u=1234567890. Send with ct0.
proxystringNoProxy URL — http://, https://, socks5://, or socks4://.

Notes

  • sourceFollowsTarget and targetFollowsSource are public and always accurate.
  • blocking, blockedBy and muting are private to the source account. X only returns them when the request is authenticated as the source account. Without auth_token the lookup runs through a shared account and these come back null (unknown) — do not read null as "not blocking".
  • To read block/mute status reliably, pass auth_token (and ideally ct0 + twid) of the account named in source_user_name.

Response

Without auth_token — private fields are null and a note explains why:

{
  "status": "success",
  "msg": "success",
  "data": {
    "sourceUserName": "example_user",
    "targetUserName": "target_user",
    "sourceFollowsTarget": true,
    "targetFollowsSource": false,
    "canDm": false,
    "blocking": null,
    "blockedBy": null,
    "muting": null,
    "note": "blocking, blocked_by and muting are private to the source account and unavailable via a shared lookup. To read them, pass auth_token of the source_user_name account."
  }
}

With auth_token of the source account — private fields are accurate:

{
  "status": "success",
  "msg": "success",
  "data": {
    "sourceUserName": "example_user",
    "targetUserName": "target_user",
    "sourceFollowsTarget": false,
    "targetFollowsSource": false,
    "canDm": false,
    "blocking": true,
    "blockedBy": false,
    "muting": false
  }
}

Response Fields

FieldTypeDescription
sourceUserNamestring@handle of source user
targetUserNamestring@handle of target user
sourceFollowsTargetbooleanTrue if source follows target (public)
targetFollowsSourcebooleanTrue if target follows source (public)
canDmbooleanTrue if source can DM target
blockingboolean | nullTrue if source is blocking target; null if unknown (no source auth_token)
blockedByboolean | nullTrue if source is blocked by target; null if unknown
mutingboolean | nullTrue if source is muting target; null if unknown
notestringPresent only when the private fields are null; explains how to get them

Example

Public relationship only:

curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/user/check_follow_relationship?source_user_name=example_user&target_user_name=target_user"

Accurate block/mute (authenticated as the source account):

curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/user/check_follow_relationship?source_user_name=example_user&target_user_name=target_user&auth_token=SOURCE_AUTH_TOKEN"

On this page