Tweets.Replies
- page - Get Replies by Page
Recommended for fetching tweet replies. Uses cursor-based pagination and avoids timeouts on large threads. The first request (omit next_cursor) returns root_tweet plus the first batch of replies. Pass next_cursor from the previous response to fetch the next page until has_next_page is false. Pricing: $0.10 per 1,000 replies.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.GetRepliesPageQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsRepliesPageRequest;
import io.twexapi.sdk.models.operations.TweetsRepliesPageResponse;
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();
TweetsRepliesPageRequest req = TweetsRepliesPageRequest.builder()
.tweetId("1803006263529541838")
.body(GetRepliesPageQuery.builder()
.build())
.build();
TweetsRepliesPageResponse res = sdk.tweets().replies().page()
.request(req)
.call();
if (res.getRepliesPageResponse().isPresent()) {
System.out.println(res.getRepliesPageResponse().get());
}
}
}
TweetsRepliesPageResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |