- members - Get Community Members
- membersPage - Get Community Members by Page
- tweets - Get Community Tweets
- tweetsPage - Get Community Tweets by Page
- search - Search Community
- get - Get Community
- searchTweets - Search Community Tweets
Get community members
import { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.communities.members({
communityId: "<id>",
targetCount: 298640,
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { communitiesMembers } from "@twexapi-dev/x-api-scraper/funcs/communities-members.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 communitiesMembers(xApiScraper, {
communityId: "<id>",
targetCount: 298640,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("communitiesMembers failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CommunitiesMembersRequest | ✔️ | 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 | */* |
Retrieve a paginated list of community 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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.communities.membersPage({
nextCursor: "1234567890",
communityId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { communitiesMembersPage } from "@twexapi-dev/x-api-scraper/funcs/communities-members-page.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 communitiesMembersPage(xApiScraper, {
nextCursor: "1234567890",
communityId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("communitiesMembersPage failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.GetCommunityMembersCursorQuery | ✔️ | 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.GetCommunityMembersCursorResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.XAPIScraperDefaultError | 4XX, 5XX | */* |
Get community tweets
import { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.communities.tweets({
communityId: "<id>",
tweetType: "Media",
targetCount: 682850,
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { communitiesTweets } from "@twexapi-dev/x-api-scraper/funcs/communities-tweets.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 communitiesTweets(xApiScraper, {
communityId: "<id>",
tweetType: "Media",
targetCount: 682850,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("communitiesTweets failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CommunitiesTweetsRequest | ✔️ | 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.CommunityTweetsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.XAPIScraperDefaultError | 4XX, 5XX | */* |
Retrieve a paginated list of community 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 { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.communities.tweetsPage({
nextCursor: "1234567890",
communityId: "<id>",
tweetType: "Top",
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { communitiesTweetsPage } from "@twexapi-dev/x-api-scraper/funcs/communities-tweets-page.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 communitiesTweetsPage(xApiScraper, {
nextCursor: "1234567890",
communityId: "<id>",
tweetType: "Top",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("communitiesTweetsPage failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.GetCommunityTweetsCursorQuery | ✔️ | 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.GetCommunityTweetsCursorResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.XAPIScraperDefaultError | 4XX, 5XX | */* |
Search community
import { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.communities.search({
query: "<value>",
targetCount: 761546,
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { communitiesSearch } from "@twexapi-dev/x-api-scraper/funcs/communities-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 communitiesSearch(xApiScraper, {
query: "<value>",
targetCount: 761546,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("communitiesSearch failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.SearchCommunityQuery | ✔️ | 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.SearchCommunityResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.XAPIScraperDefaultError | 4XX, 5XX | */* |
Get community
import { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.communities.get({
communityId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { communitiesGet } from "@twexapi-dev/x-api-scraper/funcs/communities-get.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 communitiesGet(xApiScraper, {
communityId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("communitiesGet failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CommunitiesGetRequest | ✔️ | 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.GetCommunityResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.XAPIScraperDefaultError | 4XX, 5XX | */* |
Search community tweets
import { XApiScraper } from "@twexapi-dev/x-api-scraper";
const xApiScraper = new XApiScraper({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await xApiScraper.communities.searchTweets({
communityId: "<id>",
targetCount: 687977,
query: "<value>",
});
console.log(result);
}
run();The standalone function version of this method:
import { XApiScraperCore } from "@twexapi-dev/x-api-scraper/core.js";
import { communitiesSearchTweets } from "@twexapi-dev/x-api-scraper/funcs/communities-search-tweets.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 communitiesSearchTweets(xApiScraper, {
communityId: "<id>",
targetCount: 687977,
query: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("communitiesSearchTweets failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.SearchCommunityTweetsQuery | ✔️ | 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.CommunityTweetsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.XAPIScraperDefaultError | 4XX, 5XX | */* |