Introduction
While the recent search endpoint allows you to only get Posts published in the last 7 days, the user Post timeline and user mention timeline endpoints allow you to retrieve Posts and mentions that are older than the last 7 days, for an authorized user (using the user ID). Developers can use these endpoints to study topics, entities and sentiment of Posts from a user’s timeline or mentions. In this tutorial, we will show you how to explore a user’s Posts and mentions using the user Tweet timeline and user mention timeline endpoints.Prerequisites
- In order to use the user Tweet timeline and user mention timeline endpoints, you will need to have a valid developer account.
- You will also need a Project created.
- You must have signed up for a developer account, and have activated the new developer portal experience.
- Access is available with active keys and tokens for a developer App that is attached to a Project created in the developer portal.
- A Bearer Token from your App in the X developer portal.
- If you do not have an approved developer account, you can apply for one.
Approved developer account
If you do not have one yet, you can apply for one.Create a Project and connect an App
In the developer portal, click create a new Project.



How to get the user ID for a user to use in the user Tweet timeline and user mention timeline endpoints
The user Tweet timeline and user mention timeline endpoints allow you to get Posts using the user ID. In order to get the user ID from a username, you can use the new user lookup endpoint v2. Replace the USER_NAME with the username of your choice and XXXX with your own bearer token that you obtained aboveConnecting to the user Tweet timeline and user mention timeline endpoints
In order to get the user Tweet timeline for a user ,run the following curl command in your terminal (make sure to replace the USER_ID with the user ID of your choice and XXXX with your own bearer token that you obtained above)Exploring the user’s Posts
Once you know how to get Posts using the user Tweet timeline and user mention timeline endpoints, you can start to explore their Posts. For example, if you wanted to identify common named entities present in a user’s mentions, you can do the following: In the API request, specify that you want the context_annotations object returned in the Tweet responses:Resources
- Learn more about the user Tweet timeline and the user mention timeline endpoints.
- Check out the API reference for the user Tweet timeline endpoint to learn more about what’s available.
- Check out the API reference for the user mention timeline endpoint to learn more about what’s available.
- Get inspired by reading our other tutorials.