Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 2.77 KB

File metadata and controls

51 lines (34 loc) · 2.77 KB

Tweets.Replies

Overview

Available Operations

  • page - Get Replies by Page

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.

Example Usage

require 'x_api_scraper'

Models = ::XapiScraper::Models
s = ::XapiScraper::Client.new(
  bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)

req = Models::Operations::TweetsRepliesPageRequest.new(
  tweet_id: '1803006263529541838',
  body: Models::Components::GetRepliesPageQuery.new
)
res = s.tweets.replies.page(request: req)

unless res.get_replies_page_response.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request Models::Operations::TweetsRepliesPageRequest ✔️ The request object to use for the request.

Response

T.nilable(Models::Operations::TweetsRepliesPageResponse)

Errors

Error Type Status Code Content Type
Models::Errors::HTTPValidationError 422 application/json
Errors::APIError 4XX, 5XX */*