Retrieve detailed profile information for multiple Twitter users by their usernames or profile URLs, $0.10/1000 users. The maximum input quantity is limited by your plan's QPS. To pass larger input quantity limits, upgrade your plan to get higher QPS.
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.users.get_by_usernames(request=[
"elonmusk",
])
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
request |
List[str] |
✔️ |
The request object to use for the request. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Any
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Users Details by ID. The maximum input quantity is limited by your plan's QPS. To pass larger input quantity limits, upgrade your plan to get higher QPS.
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.users.get_by_ids(request=[
"44196397",
"1696160451770429440",
])
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
request |
List[str] |
✔️ |
The request object to use for the request. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.UsersDetailsResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Retrieves the verification metadata for a specific account. This endpoint identifies whether an account holds a Blue Verified status (authenticity check) or is an Official Organization Affiliate (gold/grey labels). The maximum input quantity is limited by your plan's QPS. To pass larger input quantity limits, upgrade your plan to get higher QPS.
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.users.verify_account(request=[
"1696160451770429440",
])
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
request |
List[str] |
✔️ |
The request object to use for the request. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.AccountVerifyResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Retrieve detailed account status for multiple Twitter users by their usernames. The maximum input quantity is limited by your plan's QPS. To pass larger input quantity limits, upgrade your plan to get higher QPS.
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.users.get_statuses(request=[
"elonmusk",
"sundarpichai",
])
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
request |
List[str] |
✔️ |
The request object to use for the request. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Any
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Search user
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.users.search(keyword="<value>", target_count=794044)
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
keyword |
str |
✔️ |
The keyword to search for. |
target_count |
int |
✔️ |
The number of users to return. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.SearchUserResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Follow a user, $0.001 per call.
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.users.follow(username="Mckenna.Roberts", cookie="ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
username |
str |
✔️ |
The username of the user to follow or unfollow. |
|
cookie |
str |
✔️ |
The user's Twitter authentication cookie or Twitter auth_token, how-to-get-twitter-cookie |
ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.BlockUserResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Unfollow a user, $0.001 per call.
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.users.unfollow(username="Casandra47", cookie="ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
username |
str |
✔️ |
The username of the user to unfollow. |
|
cookie |
str |
✔️ |
The user's Twitter authentication cookie or Twitter auth_token, how-to-get-twitter-cookie |
ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.UnfollowUserResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Get Twitter Account Based in. The maximum input quantity is limited by your plan's QPS. To pass larger input quantity limits, upgrade your plan to get higher QPS.
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.users.get_account_based(request=[
"screen_name",
])
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
request |
List[str] |
✔️ |
The request object to use for the request. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.TwitterAccountBasedStandardResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |
Get Twitter User About for a specific twitter user. get account_based_in,location_accurate
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.users.get_about(screen_name="elonmusk")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
Example |
screen_name |
str |
✔️ |
The screen name of the twitter user to get about. |
elonmusk |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.TwitterUserAboutStandardResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |