Blocks lookup: Standard v1.1 compared to X API v2
If you have been working with the standard v1.1 GET blocks/ids and GET blocks/list endpoints, the goal of this guide is to help you understand the similarities and differences between the standard v1.1 and X API v2 blocks lookup endpoints.- Similarities
- Authentication
- Differences
- Endpoint URLs
- Users per request limits
- App and Project requirements
- Response data formats
- Request parameters
Similarities
Authentication Both the standard v1.1 and X API v2 blocks lookup endpoints use OAuth 1.0a User Context. Therefore, if you were previously using one of the standard v1.1 blocks lookup endpoints, you can continue using the same authentication method if you migrate to the X API v2 version.Differences
Endpoint URLs- Standard v1.1 endpoints:
- GET https://api.x.com/1.1/blocks/ids.json (list of user IDs who are blocked by the specified user)
- GET https://api.x.com/1.1/blocks/lists.json (list of users who are blocked by the specified user)
- X API v2 endpoint:
- GET https://api.x.com/2/users/:id/blocking (list of users who are blocked by the specified user ID)
- At the JSON root level, the standard endpoints return Post objects in a statuses array, while X API v2 returns a data array.
- Instead of referring to Retweeted and Quoted “statuses”, X API v2 JSON refers to Retweeted and Quoted Tweets. Many legacy and deprecated fields, such as contributors and user.translator_type are being removed.
- Instead of using both favorites (in Post object) and favourites (in user object), X API v2 uses the term like.
- X is adopting the convention that JSON values with no value (for example, null) are not written to the payload. Post and user attributes are only included if they have a non-null values.
- A conversation_id field
- Two new annotations fields, including context and entities
- Several new metrics fields
- A new reply_setting field, which shows you who can reply to a given Post