Retrieve author details
Unique ID
Based on the twitter author ID, you can use the Twitter API to retrieve the details:
The author is identified as a user in Twitter.
curl -L -X GET 'https://api.twitter.com/2/users/<author ID>?user.fields=created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld' \
-H 'Authorization: Bearer ***'
You can retrieve all details on Twitter developer portal: https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id
{
"data": {
"entities": {
"url": {
"urls": [
{
"start": 0,
"end": 23,
"url": "https://t.co/TunM9nILSl",
"expanded_url": "https://medium.com/@RVAwonk",
"display_url": "medium.com/@RVAwonk"
}
]
}
},
"name": "Caroline Orr Bueno, Ph.D",
"id": "2316383071",
"verified": false,
"pinned_tweet_id": "1591557768934486017",
"description": "~@rvawonk@newsie.social~ Behavioral Scientist. Postdoc @ UMD. Studying disinformation, cognitive security, mediated communication, crises. Opinions are mine.",
"protected": false,
"profile_image_url": "https://pbs.twimg.com/profile_images/1590761552025624576/USILJCTg_normal.jpg",
"username": "RVAwonk",
"public_metrics": {
"followers_count": 454303,
"following_count": 3044,
"tweet_count": 107252,
"listed_count": 4248
},
"url": "https://t.co/TunM9nILSl",
"created_at": "2014-01-29T02:27:58.000Z"
}
}
Retrieve a batch of authors
It is possible to pass a list of user IDs (up to 100) within 1 call.
To do so, you need to add an additional URL parameter: ids
with the list of IDs separated by a comma.
The rest of the parameters remains unchanged:
curl -L -X GET 'https://api.twitter.com/2/users?ids=2316383071,243013409&user.fields=created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld' \
-H 'Authorization: Bearer ***'
The structure of the response doesn't change with the unique ID endpoint, it's just an array of data
that is returned.
You can retrieve all details on Twitter developer portal: https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users