Please note: This guide assumes you have completed the prerequisites from the quick start overview.

Steps to build a List follows lookup request

Step one: Choose the List endpoint collection from Postman

Once you have the Twitter API v2 collection loaded in Postman, navigate to the “List” folder, select another folder “List follows”, and then choose "User's followed Lists".
 

Step two: Identify and specify the user

In order to retrieve which Lists a user follows, you must specify their user ID within the request.

User IDs are simply the numerical value that represents an account handle that you can find within an account's profile URL. For example, the following account’s username is TwitterDev.

https://twitter.com/TwitterDev

To convert this username to the user ID, you will have to use the users lookup endpoint with the username and find the numerical user ID in the payload. In the case of @TwitterDev, the user ID is 2244994945.

In Postman, navigate to the "Params" tab and enter this user ID into the "Value" column of the id parameter.

 

Key Value
id 2244994945 (user ID)

 

Step three: Identify and specify which fields you would like to retrieve

If you click the "Send" button after step three, you will receive the default List object fields in your response: id and name.

If you would like to receive additional fields beyond id and name, you will have to specify those fields in your request with the field and/or expansion parameters.

For this exercise, we will request three additional sets of fields from different objects:

  • The additional follower_count field in the primary List object.
  • The full user object using the expansion parameter.
  • The additional  tweet.created_at field in the associated user object.

     

In Postman, navigate to the "Params" tab and add the following key:value pair to the "Query Params" table:

Key

Value

Returned fields

list.fields

follower_count

follower_count

expansions

owner_id

includes.users.id,
includes.users.name,
includes.users.username

user.fields

created_at

includes.users.created_at

You should now see a similar URL next to the “Send” button:

 

      https://api.twitter.com/2/users/2244994945/followed_lists?expansions=owner_id&list.fields=follower_count&user.fields=created_at
    

Step four: Make your request and review your response

Once you have everything set up, hit the "Send" button, and you will receive a similar response to the following example response:

      {
  "data": [
    {
      "follower_count": 695,
      "id": "163068571",
      "name": "SF News",
      "owner_id": "69658976"
    }
  ],
  "includes": {
    "users": [
      {
        "name": "J-Ro",
        "username": "jamieromas",
        "id": "69658976",
        "created_at": "2009-08-28T18:30:45.000Z"
      }
    ]
  },
  "meta": {
    "result_count": 1
  }
}