User by ID
GET https://api.twitter.com/2/users/:id
This endpoint returns details about a user by ID. For full details, see the API reference for this endpoint.
Body
PARAM
Key | Datatype | Required | Description |
user.fields
|
null | Comma-separated fields for the user object. Allowed values: created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld Default values: id,name,username | |
expansions
|
null | Expansions enable requests to expand an ID into a full object in the includes response object. Allowed value: pinned_tweet_id Default value: none | |
tweet.fields
|
null | Comma-separated list of fields for the Tweet object. Expansion required. Allowed values: attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld Default values: id,text OAuth1.0a User Context authorization required if any of the following fields are included in the request: non_public_metrics,organic_metrics,promoted_metrics |
HEADERS
Key | Datatype | Required | Description |
RESPONSES
status OK
{
"data": {
"created_at": "2013-12-14T04:35:55.000Z",
"description": "The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API. \n\n#BlackLivesMatter",
"entities": {
"url": {
"urls": [
{
"start": 0,
"end": 23,
"url": "https://t.co/3ZX3TNiZCY",
"expanded_url": "https://developer.twitter.com/en/community",
"display_url": "developer.twitter.com/en/community"
}
]
},
"description": {
"hashtags": [
{
"start": 23,
"end": 30,
"tag": "DevRel"
},
{
"start": 113,
"end": 130,
"tag": "BlackLivesMatter"
}
]
}
},
"id": "2244994945",
"location": "127.0.0.1",
"name": "Twitter Dev",
"pinned_tweet_id": "1255542774432063488",
"profile_image_url": "https://pbs.twimg.com/profile_images/1267175364003901441/tBZNFAgA_normal.jpg",
"protected": false,
"url": "https://t.co/3ZX3TNiZCY",
"username": "TwitterDev",
"verified": true
},
"includes": {
"tweets": [
{
"author_id": "2244994945",
"conversation_id": "1255542774432063488",
"created_at": "2020-04-29T17:01:38.000Z",
"entities": {
"urls": [
{
"start": 264,
"end": 287,
"url": "https://t.co/BPqMcQzhId",
"expanded_url": "https://blog.twitter.com/developer/en_us/topics/tools/2020/covid19_public_conversation_data.html",
"display_url": "blog.twitter.com/developer/en_u…",
"images": [
{
"url": "https://pbs.twimg.com/news_img/1274730688919613440/SEsqlE16?format=jpg&name=orig",
"width": 1600,
"height": 600
},
{
"url": "https://pbs.twimg.com/news_img/1274730688919613440/SEsqlE16?format=jpg&name=150x150",
"width": 150,
"height": 150
}
],
"status": 200,
"title": "Enabling study of the public conversation in a time of crisis",
"description": "To further support our company’s ongoing efforts, we want to enable developers and researchers to study the public conversation on COVID-19 in real-time.",
"unwound_url": "https://blog.twitter.com/developer/en_us/topics/tools/2020/covid19_public_conversation_data.html"
}
]
},
"id": "1255542774432063488",
"lang": "en",
"possibly_sensitive": false,
"source": "Twitter Web App",
"text": "During these unprecedented times, what’s happening on Twitter can help the world better understand & respond to the pandemic. \n\nWe're launching a free COVID-19 stream endpoint so qualified devs & researchers can study the public conversation in real-time. https://t.co/BPqMcQzhId"
}
]
}
} |