# Retrieve user profile details

{% 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 %}

### Endpoint

```url
GET https://api.socialdata.tools/twitter/user/[user_id]
 or
GET https://api.socialdata.tools/twitter/user/[screen_name]
```

### Endpoint parameters

| Name                                                  | Description                                                                                                                           | Example  |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| <p>user\_id <br><strong>(Required)</strong></p>       | <p>The ID of the user for whom to return results. </p><p></p><p>Either an id or screen\_name is required for this method.</p>         | 44196397 |
| <p>screen\_name</p><p><strong>(Required)</strong></p> | <p>The screen name of the user for whom to return results. </p><p></p><p>Either a id or screen\_name is required for this method.</p> | elonmusk |

{% 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 `user_id` as a string. 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 tweet 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/elonmusk"
-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: 
{
    "id": 44196397,
    "id_str": "44196397",
    "name": "Elon Musk",
    "screen_name": "elonmusk",
    "location": "\\ud835\\udd4f\\u00d0",
    "url": null,
    "description": "",
    "protected": false,
    "verified": false,
    "followers_count": 166213974,
    "friends_count": 506,
    "listed_count": 149577,
    "favourites_count": 37987,
    "statuses_count": 34934,
    "created_at": "2009-06-02T20:12:29.000000Z",
    "profile_banner_url": "https:\\/\\/pbs.twimg.com\\/profile_banners\\/44196397\\/1690621312",
    "profile_image_url_https": "https:\\/\\/pbs.twimg.com\\/profile_images\\/1683325380441128960\\/yRsRRjGO_normal.jpg",
    "can_dm": null
}

// If failed:
{
    "status":"error",
    "message":"User with screenname [...] not found on Twitter"
}
```
