Skip to content

Get User Profile - API Reference

Retrieve user information by their Twitter ID or screen name.

GET https://api.socialdata.tools/twitter/user/{user_id}
GET https://api.socialdata.tools/twitter/user/{username}

Headers

Authorization string required

Authorization Bearer header containing your SocialData API key

Example: Bearer YOUR_API_KEY

Path Parameters

user_id integer required

The numerical id of the target user profile. Either a user_id or username is required for this endpoint.

Example: 44196397

username string required

Username of the target user profile without @. Either a user_id or username is required for this endpoint.

Example: elonmusk

Code Examples

Terminal window
curl "https://api.socialdata.tools/twitter/user/elonmusk"
-H 'Authorization: Bearer API_KEY'
-H 'Accept: application/json'
# OR
curl "https://api.socialdata.tools/twitter/user/343990983"
-H 'Authorization: Bearer API_KEY'
-H 'Accept: application/json'

Example Responses

{
"id": 44196397,
"id_str": "44196397",
"name": "Elon Musk",
"screen_name": "elonmusk",
"location": "\\ud835\\udd4f\\u00d0",
"url": null,
"description": "",
"protected": false,
"verified": true,
"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": false
}

Response Codes

  • 200 OK - request succeeded
  • 402 Payment Required - not enough credits to perform this request
  • 404 Not Found - requested user does not exist
  • 422 Unprocessable Content - validation failed (e.g. one of the required parameters was not provided)
  • 500 Internal Error - API internal error, typically means that SocialData API failed to obtain the requested information and you should try again later

Useful Resources