SocialData.Tools: API Documentation
  • Getting Started
  • Authentication
  • Pricing
  • SDKs and Code Examples
  • Twitter: Tweets
    • Retrieve tweet details
    • Retrieve thread
    • Retrieve article details
    • Retrieve all users who retweeted a tweet
    • Retrieve search results by keyword
    • Retrieve all users who liked a tweet
  • Twitter: Users
    • Retrieve user profile details
    • Retrieve profile's affiliated users
    • Retrieve tweets and replies made by a specific user
    • Retrieve likes made by a specific user
    • Retrieve user's articles
    • Retrieve user's highlighted tweets
    • Retrieve user's followers
    • Retrieve user's following
    • Retrieve user's lists
    • Check if a user is following another user
    • Check if a user retweeted a specific tweet
    • Check if a user commented on a specific tweet
    • Check if a user liked a specific tweet
    • Retrieve users search results by screenname
  • Twitter: Lists
    • Retrieve list details
    • Retrieve list members
  • Twitter: Spaces
    • Retrieve Twitter spaces stream details
  • Twitter / X: Communities
    • Retrieve community tweets timeline
    • Retrieve community members
Powered by GitBook
On this page
  • Endpoint
  • Endpoint parameters
  • Response codes
  • Rate limits
  • Example request
  • Example response
  1. Twitter: Users

Check if a user is following another user

PreviousRetrieve user's listsNextCheck if a user retweeted a specific tweet

Last updated 23 days ago

WARNING:

You are viewing an outdated version of our documentation. For the latest and most accurate information, please visit .

This endpoint provides a convenient way to check if a user (identified by source_user_id) is following another user (identified by target_user_id).

Endpoint

GET https://api.socialdata.tools/twitter/user/[source_user_id]/following/[target_user_id]

Endpoint parameters

Name
Description
Example

source_user_id (Required)

The numeric ID of the desired follower.

1625802236571033602

target_user_id (Required)

The numeric ID of the desired user being followed.

1489552236571048124

Common Issues and Best Practices

  • In languages where theuser_id value exceeds the default Integer type limit (e.g., Node.js), store source_user_id and target_user_id as strings. Use the id_str property returned by the API for these values

Response codes

  • HTTP 200 OK - succeeded

  • HTTP 402 Payment Required - not enough credits to perform this request

  • HTTP 404 Not Found - requested target user does not exist

  • HTTP 422 Unprocessable Content - validation failed (e.g. one of the required parameters was not provided)

  • HTTP 500 Internal Server Error - other error, typically means that SocialData API failed to obtain the requested information and you should try again later

Rate limits

By default each user has a limit of 120 requests per minute shared across all endpoints. Please reach out to support@socialdata.tools if you need to raise your rate limit.

Example request

curl "https://api.socialdata.tools/twitter/user/123123123/following/456456456"
-H 'Authorization: Bearer API_KEY'
-H 'Accept: application/json'

Example response

// If succeeded: 
{
    "status": "success",
    "source_user_id": "123123123...",
    "target_user_id": "456456456...",
    "is_following": true,
    "followers_checked_count": null // Deprecated
}

// If failed:
{
    "status":"error",
    "message":"User not found"
}

docs.socialdata.tools