Get community members
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.CommunitiesMembersRequest;
import io.twexapi.sdk.models.operations.CommunitiesMembersResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CommunitiesMembersRequest req = CommunitiesMembersRequest.builder()
.communityId("<id>")
.targetCount(298640L)
.build();
CommunitiesMembersResponse res = sdk.communities().members()
.request(req)
.call();
if (res.searchUserResponse().isPresent()) {
System.out.println(res.searchUserResponse().get());
}
}
}
CommunitiesMembersResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
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.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.GetCommunityMembersCursorQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.CommunitiesMembersPageResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
GetCommunityMembersCursorQuery req = GetCommunityMembersCursorQuery.builder()
.communityId("<id>")
.nextCursor("1234567890")
.build();
CommunitiesMembersPageResponse res = sdk.communities().membersPage()
.request(req)
.call();
if (res.getCommunityMembersCursorResponse().isPresent()) {
System.out.println(res.getCommunityMembersCursorResponse().get());
}
}
}
CommunitiesMembersPageResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
tweets
Get community tweets
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.CommunitiesTweetsRequest;
import io.twexapi.sdk.models.operations.CommunitiesTweetsResponse;
import io.twexapi.sdk.models.operations.TweetType;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CommunitiesTweetsRequest req = CommunitiesTweetsRequest.builder()
.communityId("<id>")
.tweetType(TweetType.MEDIA)
.targetCount(682850L)
.build();
CommunitiesTweetsResponse res = sdk.communities().tweets()
.request(req)
.call();
if (res.communityTweetsResponse().isPresent()) {
System.out.println(res.communityTweetsResponse().get());
}
}
}
CommunitiesTweetsResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
tweetsPage
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.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.GetCommunityTweetsCursorQuery;
import io.twexapi.sdk.models.components.TweetType;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.CommunitiesTweetsPageResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
GetCommunityTweetsCursorQuery req = GetCommunityTweetsCursorQuery.builder()
.communityId("<id>")
.tweetType(TweetType.TOP)
.nextCursor("1234567890")
.build();
CommunitiesTweetsPageResponse res = sdk.communities().tweetsPage()
.request(req)
.call();
if (res.getCommunityTweetsCursorResponse().isPresent()) {
System.out.println(res.getCommunityTweetsCursorResponse().get());
}
}
}
CommunitiesTweetsPageResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Search community
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.SearchCommunityQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.CommunitiesSearchResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
SearchCommunityQuery req = SearchCommunityQuery.builder()
.query("<value>")
.targetCount(761546L)
.build();
CommunitiesSearchResponse res = sdk.communities().search()
.request(req)
.call();
if (res.searchCommunityResponse().isPresent()) {
System.out.println(res.searchCommunityResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
request |
SearchCommunityQuery |
✔️ |
The request object to use for the request. |
CommunitiesSearchResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Get community
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.CommunitiesGetRequest;
import io.twexapi.sdk.models.operations.CommunitiesGetResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CommunitiesGetRequest req = CommunitiesGetRequest.builder()
.communityId("<id>")
.build();
CommunitiesGetResponse res = sdk.communities().get()
.request(req)
.call();
if (res.getCommunityResponse().isPresent()) {
System.out.println(res.getCommunityResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
request |
CommunitiesGetRequest |
✔️ |
The request object to use for the request. |
CommunitiesGetResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
searchTweets
Search community tweets
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.SearchCommunityTweetsQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.CommunitiesSearchTweetsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
SearchCommunityTweetsQuery req = SearchCommunityTweetsQuery.builder()
.communityId("<id>")
.targetCount(687977L)
.query("<value>")
.build();
CommunitiesSearchTweetsResponse res = sdk.communities().searchTweets()
.request(req)
.call();
if (res.communityTweetsResponse().isPresent()) {
System.out.println(res.communityTweetsResponse().get());
}
}
}
CommunitiesSearchTweetsResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |