# Check if a user is following another user

{% hint style="danger" %} <mark style="color:red;">**WARNING:**</mark>&#x20;

**You are viewing an outdated version of our documentation.** \
**For the latest and most accurate information, please visit** [**docs.socialdata.tools**](https://docs.socialdata.tools)**.**
{% endhint %}

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`).&#x20;

### Endpoint

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

### Endpoint parameters

| Name                                                   | Description                                        | Example             |
| ------------------------------------------------------ | -------------------------------------------------- | ------------------- |
| <p>source\_user\_id<br><strong>(Required)</strong></p> | The numeric ID of the desired follower.            | 1625802236571033602 |
| <p>target\_user\_id<br><strong>(Required)</strong></p> | The numeric ID of the desired user being followed. | 1489552236571048124 |

{% hint style="warning" %} <mark style="color:orange;">**Common Issues and Best Practices**</mark>

* In languages where the`user_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
  {% endhint %}

### 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

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

[![Run In Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/36444222-9d3f261a-6fc3-44cd-90eb-f0d191d6d1a8?action=collection%2Ffork\&source=rip_markdown\&collection-url=entityId%3D36444222-9d3f261a-6fc3-44cd-90eb-f0d191d6d1a8%26entityType%3Dcollection%26workspaceId%3D22407140-425b-41ff-969e-1fb938fe8e86)

### Example response

```json
// 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"
}
```
