> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# v1 to v2

> If you have been working with the standard v1.1 GET lists/statuses endpoint, the goal of this. Reference for the Enterprise X API tier covering migrate.

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

### List Posts lookup: Standard v1.1 compared to X API v2

If you have been working with the standard v1.1 [GET lists/statuses](https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses) endpoint, the goal of this guide is to help you understand the similarities and differences between the standard v1.1 and X API v2 endpoints.

* **Similarities**
  * Authentication methods
  * Rate limits
* **Differences**
  * Endpoint URLs
  * App and Project requirements
  * Data objects per request limits
  * Response data formats
  * Request parameters

#### Similarities

**Authentication**

Both endpoint versions support both [OAuth 1.0a User Context](/resources/fundamentals/authentication#oauth-2-0). Therefore, if you were previously using one of the standard v1.1 List Posts lookup endpoints, you can continue using the same authentication method if you migrate to the X API v2 version.

Depending on your authentication library/package of choice, App only authentication is probably the easiest way to get started and can be set with a simple request header. To learn how to generate an App only Access Token, see [this App only guide](/resources/fundamentals/authentication#bearer-token-also-known-as-app-only).

**Rate limits**

|                                                                                                                                                               |                                                                                                                                                                                                                                                   |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Standard v1.1**                                                                                                                                             | **X API v2**                                                                                                                                                                                                                                      |
| /1.1/lists/statuses.json<br /><br />900 requests per 15-minute window with OAuth 1.0a User Context<br /><br />900 requests per 15-minute window with App only | /2/lists/:id/tweets<br /><br />900 requests per 15-minute window with OAuth 1.0a User Context<br /><br />900 requests per 15-minute window with OAuth 2.0 Authorization Code with PKCE<br /><br />900 requests per 15-minute window with App only |

#### Differences

**Endpoint URLs**

* Standard v1.1 endpoints:
  * GET [https://api.x.com/1.1/lists/statuses.json](https://api.x.com/1.1/lists/statuses.json)
    (Lookup Tweets from a specified List)
* X API v2 endpoint:
  * GET [https://api.x.com/2/lists/:id/tweets](https://api.x.com/2/lists/:id/tweets)
    (Lookup Tweets from a specified List)

**App and Project requirements**

The X API v2 endpoints require that you use credentials from a [developer App](/resources/fundamentals/developer-apps) that is associated with a [Project](/resources/fundamentals/developer-apps) when authenticating your requests. All X API v1.1 endpoints can use credentials from Apps or Apps associated with a project.

**Data objects per request limits**

The standard v1.1 /lists/statuses endpoint allows you to return up to 5000 Posts per request. The new v2 endpoints allow you to return up to 100 Posts per request. By default, 100 user objects will be returned, to change the number of results you will need to pass a query parameter max\_results= with a number between 1-100; you can then pass the next\_token returned in the response payload to the pagination\_token query parameter in your next request.

**Response data format**

One of the biggest differences between standard v1.1 and X API v2 endpoint versions is how you select which fields return in your payload.

For the standard endpoints, you receive many of the response fields by default and then have the option to use parameters to identify which additional fields or sets of fields should return in the payload.

The X API v2 version only delivers the Post id and text fields by default. To request any additional fields or objects, you will need to use the [fields](/x-api/fundamentals/fields) and [expansions](/x-api/fundamentals/expansions) parameters. Any Post fields that you request from this endpoint will return in the primary Post object. Any expanded object fields will return an includes object within your response. You can then match any expanded objects back to the primary Post object by matching the IDs from the primary object and in expanded objects.

Here are examples of possible Post fields and expansions:

* attachments
* author\_id
* context\_annotations
* created\_at
* geo
* lang

|                     |               |
| :------------------ | :------------ |
| **Endpoint**        | **Expansion** |
| /2/lists/:id/tweets | author\_id    |

We encourage you to read more about these new parameters in their respective guides, or by reading our guide on [how to use fields and expansions](/x-api/fundamentals/data-dictionary/reference#how-to-use-fields-and-expansions).

We have also put together a [data format migration guide](/x-api/migrate/data-format-migration) that can help you map standard v1.1 fields to the newer v2 fields. This guide will also provide you the specific expansion and field parameter that you will need to pass with your v2 request to return specific fields.

In addition to the changes in how you request certain fields, X API v2 is also introducing new JSON designs for the objects returned by the APIs, including [Post](/x-api/fundamentals/data-dictionary/reference#tweet) and [user](/x-api/fundamentals/data-dictionary/reference#user) objects.

* 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 non-null values.

**Request parameters**

The following standard v1.1 request parameters have equivalents in X API v2:

|                     |                                                              |
| :------------------ | :----------------------------------------------------------- |
| Standard v1.1       | X API v2                                                     |
| list\_id            | id                                                           |
| slug                | No equivalent                                                |
| owner\_screen\_name | No equivalent                                                |
| owner\_id           | Requested with expansions parameter with value of author\_id |
| since\_id           | No equivalent                                                |
| max\_id             | No equivalent                                                |
| include\_entities   | Requested with tweet.fields parameter with value of entities |
| include\_rts        | No equivalent                                                |
| count               | max\_results                                                 |

***

## Code examples

### Get Posts from a List (v2)

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/lists/84839422/tweets?tweet.fields=created_at,public_metrics&max_results=100" \
    -H "Authorization: Bearer $BEARER_TOKEN"
  ```

  ```python Python theme={null}
  import requests

  bearer_token = "YOUR_BEARER_TOKEN"
  url = "https://api.x.com/2/lists/84839422/tweets"

  params = {
      "tweet.fields": "created_at,public_metrics",
      "max_results": 100
  }
  headers = {"Authorization": f"Bearer {bearer_token}"}

  response = requests.get(url, headers=headers, params=params)
  print(response.json())
  ```

  ```python Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # Get Posts from a List
  for page in client.lists.get_tweets(
      "84839422",
      tweet_fields=["created_at", "public_metrics"],
      max_results=100
  ):
      for post in page.data:
          print(f"{post.created_at}: {post.text[:50]}...")
  ```

  ```javascript JavaScript SDK theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ bearerToken: "YOUR_BEARER_TOKEN" });

  // Get Posts from a List
  const paginator = client.lists.getTweets("84839422", {
    tweetFields: ["created_at", "public_metrics"],
    maxResults: 100,
  });

  for await (const page of paginator) {
    page.data?.forEach((post) => {
      console.log(`${post.created_at}: ${post.text?.slice(0, 50)}...`);
    });
  }
  ```
</CodeGroup>
