tweets
Get list tweets
import os
from x_api_scraper import XapiScraper
with XapiScraper(
bearer_auth=os.getenv("X_API_SCRAPER_BEARER_AUTH", ""),
) as xapi_scraper:
res = xapi_scraper.lists.tweets(list_id="<id>", target_count=277741)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
list_id |
str |
✔️ |
N/A |
target_count |
int |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListTweetsResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
tweets_page
Retrieve a paginated list of list tweets using cursor-based pagination. Each page returns up to 20 tweets. Pass next_cursor from the previous response to continue. Pricing: $0.10 per 1,000 tweets.
import os
from x_api_scraper import XapiScraper
with XapiScraper(
bearer_auth=os.getenv("X_API_SCRAPER_BEARER_AUTH", ""),
) as xapi_scraper:
res = xapi_scraper.lists.tweets_page(list_id="<id>", next_cursor="1234567890")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
list_id |
str |
✔️ |
The ID of the list to get tweets from. |
|
next_cursor |
OptionalNullable[str] |
➖ |
Cursor returned by the previous page. Leave empty to fetch the first page. |
1234567890 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.GetListTweetsCursorResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Get list subscribers
import os
from x_api_scraper import XapiScraper
with XapiScraper(
bearer_auth=os.getenv("X_API_SCRAPER_BEARER_AUTH", ""),
) as xapi_scraper:
res = xapi_scraper.lists.subscribers(list_id="<id>", target_count=440492)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
list_id |
str |
✔️ |
N/A |
target_count |
int |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListSubscribersResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Get list members
import os
from x_api_scraper import XapiScraper
with XapiScraper(
bearer_auth=os.getenv("X_API_SCRAPER_BEARER_AUTH", ""),
) as xapi_scraper:
res = xapi_scraper.lists.members(list_id="<id>", target_count=685648)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
list_id |
str |
✔️ |
N/A |
target_count |
int |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListMembersResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Retrieve a paginated list of list members using cursor-based pagination. Each page returns up to 20 members. Pass next_cursor from the previous response to continue. Pricing: $0.10 per 1,000 members.
import os
from x_api_scraper import XapiScraper
with XapiScraper(
bearer_auth=os.getenv("X_API_SCRAPER_BEARER_AUTH", ""),
) as xapi_scraper:
res = xapi_scraper.lists.members_page(list_id="<id>", next_cursor="1234567890")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
list_id |
str |
✔️ |
The ID of the list to get members from. |
|
next_cursor |
OptionalNullable[str] |
➖ |
Cursor returned by the previous page. Leave empty to fetch the first page. |
1234567890 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.GetListMembersCursorResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Search list
import os
from x_api_scraper import XapiScraper
with XapiScraper(
bearer_auth=os.getenv("X_API_SCRAPER_BEARER_AUTH", ""),
) as xapi_scraper:
res = xapi_scraper.lists.search(query="<value>", target_count=810476)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
query |
str |
✔️ |
The query to search for. |
target_count |
int |
✔️ |
The number of lists to search. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.SearchListResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |