- getByUsernames - Get Multiple Users by Usernames
- getByIds - Users Details by ID
- verifyAccount - Verify Account Status
- getStatuses - Batch Get User account status
- search - Search User
- follow - Follow User
- unfollow - Unfollow User
- getAccountBased - Get Twitter Account Based in
- getAbout - Get Twitter User About by Screen Name
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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.users.getByUsernames([
"elonmusk",
]);
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { usersGetByUsernames } from "@twexapi-dev/x-api-scraper/funcs/users-get-by-usernames.js";
// Use `XApiScraperCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const xApiScraper = new XApiScraperCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await usersGetByUsernames(xApiScraper, [
"elonmusk",
]);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("usersGetByUsernames failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
string[] | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.users.getByIds([
"44196397",
"1696160451770429440",
]);
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { usersGetByIds } from "@twexapi-dev/x-api-scraper/funcs/users-get-by-ids.js";
// Use `XApiScraperCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const xApiScraper = new XApiScraperCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await usersGetByIds(xApiScraper, [
"44196397",
"1696160451770429440",
]);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("usersGetByIds failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
string[] | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.users.verifyAccount([
"1696160451770429440",
]);
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { usersVerifyAccount } from "@twexapi-dev/x-api-scraper/funcs/users-verify-account.js";
// Use `XApiScraperCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const xApiScraper = new XApiScraperCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await usersVerifyAccount(xApiScraper, [
"1696160451770429440",
]);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("usersVerifyAccount failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
string[] | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.users.getStatuses([
"elonmusk",
"sundarpichai",
]);
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { usersGetStatuses } from "@twexapi-dev/x-api-scraper/funcs/users-get-statuses.js";
// Use `XApiScraperCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const xApiScraper = new XApiScraperCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await usersGetStatuses(xApiScraper, [
"elonmusk",
"sundarpichai",
]);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("usersGetStatuses failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
string[] | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<any>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.XAPIScraperDefaultError | 4XX, 5XX | */* |
Search user
import { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.users.search({
keyword: "<value>",
targetCount: 794044,
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { usersSearch } from "@twexapi-dev/x-api-scraper/funcs/users-search.js";
// Use `XApiScraperCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const xApiScraper = new XApiScraperCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await usersSearch(xApiScraper, {
keyword: "<value>",
targetCount: 794044,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("usersSearch failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UsersSearchRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.users.follow({
username: "Mckenna.Roberts",
cookie: "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { usersFollow } from "@twexapi-dev/x-api-scraper/funcs/users-follow.js";
// Use `XApiScraperCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const xApiScraper = new XApiScraperCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await usersFollow(xApiScraper, {
username: "Mckenna.Roberts",
cookie: "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("usersFollow failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.FollowUserQuery | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.users.unfollow({
username: "Casandra47",
cookie: "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { usersUnfollow } from "@twexapi-dev/x-api-scraper/funcs/users-unfollow.js";
// Use `XApiScraperCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const xApiScraper = new XApiScraperCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await usersUnfollow(xApiScraper, {
username: "Casandra47",
cookie: "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("usersUnfollow failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.UnfollowUserQuery | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.users.getAccountBased([
"screen_name",
]);
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { usersGetAccountBased } from "@twexapi-dev/x-api-scraper/funcs/users-get-account-based.js";
// Use `XApiScraperCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const xApiScraper = new XApiScraperCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await usersGetAccountBased(xApiScraper, [
"screen_name",
]);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("usersGetAccountBased failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
string[] | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.users.getAbout({
screenName: "elonmusk",
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { usersGetAbout } from "@twexapi-dev/x-api-scraper/funcs/users-get-about.js";
// Use `XApiScraperCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const xApiScraper = new XApiScraperCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await usersGetAbout(xApiScraper, {
screenName: "elonmusk",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("usersGetAbout failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UsersGetAboutRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.TwitterUserAboutStandardResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.XAPIScraperDefaultError | 4XX, 5XX | */* |