Please note: This guide assumes you have completed the prerequisites from the quick start overview.
Steps to build a List members lookup request
Step one: Choose the List endpoint collection from Postman Once you have the X API v2 collection loaded in Postman, navigate to the “List” folder, select another folder “List members”, and then choose “Members lookup”. Step two: Identify and specify which List you would like to retrieve members from You must specify a List that you would like to receive members from. You can find the List ID by navigating to x.com and clicking on a List and then looking in the URL. For example, the following URL’s List ID is 84839422. https://x.com/i/lists/84839422 The target ID can be any valid List ID. In Postman, navigate to the “Params” tab, and enter your ID into the “Value” column of the id path variable. Be sure not to include any spaces before or after any 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 user object fields in your response: id, name, and username.
If you would like to receive additional fields beyond id, name, and username, 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 user.created_at field in the primary user objects.
- The full Post object using the expansion parameter.
- The additional tweet.created_at field in the associated Post objects.
You should now see a similar URL next to the “Send” button:
https://api.x.com/2/lists/84839422/members?user.fields=created_at&expansions=pinned_tweet_id&tweet.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: