resttwitter

Does Twitter/X have APIs to get list of Followers & Followings


I want to get a list of followers & followings of my X.com userid (or of any other user). I was looking at Twitter Developer Portal

It lists different plans available for X.com APIs https://developer.x.com/en/portal/products

But none of the APIs listed mention getting lists of followers/followings - only APIs for adding or deleting a follower. So my question is if X.com provides an API for this & if yes, is it available in the free plan - if not, which is the minimum plan it's available in?


Solution

  • You can refer to this official document to get the list of followers and following by user ID. And the Follows and List Follows endpoints are only available for an Enterprise subscription since June 26 2023 (Check the changelog from X).

    https://api.twitter.com/2/users/{id}/followers
    
    https://api.twitter.com/2/users/{id}/following