Class: XTwitterScraper::Resources::X::Users

Inherits:
Object
  • Object
show all
Defined in:
lib/x_twitter_scraper/resources/x/users.rb,
lib/x_twitter_scraper/resources/x/users/follow.rb,
sig/x_twitter_scraper/resources/x/users.rbs,
sig/x_twitter_scraper/resources/x/users/follow.rbs

Defined Under Namespace

Classes: Follow

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Users

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Users.

Parameters:



1250
1251
1252
1253
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 1250

def initialize(client:)
  @client = client
  @follow = XTwitterScraper::Resources::X::Users::Follow.new(client: client)
end

Instance Attribute Details

#followXTwitterScraper::Resources::X::Users::Follow (readonly)

X write actions (tweets, likes, follows, DMs)



13
14
15
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 13

def follow
  @follow
end

Instance Method Details

#remove_follower(id, account:, idempotency_key:, request_options: {}) ⇒ XTwitterScraper::Models::X::UserRemoveFollowerResponse

Some parameter documentations has been truncated, see Models::X::UserRemoveFollowerParams for more details.

Remove follower

Parameters:

  • id (String)

    Path param: User ID to remove from your followers

  • account (String)

    Body param: X account identifier (@username or account ID)

  • idempotency_key (String)

    Header param: Generate one unique value for each intended write. Reuse it only w

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 53

def remove_follower(id, params)
  parsed, options = XTwitterScraper::X::UserRemoveFollowerParams.dump_request(params)
  header_params = {idempotency_key: "idempotency-key"}
  @client.request(
    method: :post,
    path: ["x/users/%1$s/remove-follower", id],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: XTwitterScraper::Models::X::UserRemoveFollowerResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ XTwitterScraper::Models::UserProfile

Get user profile with follower counts & verification

Parameters:

Returns:

See Also:



26
27
28
29
30
31
32
33
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 26

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["x/users/%1$s", id],
    model: XTwitterScraper::UserProfile,
    options: params[:request_options]
  )
end

#retrieve_batch(ids:, request_options: {}) ⇒ XTwitterScraper::Models::X::UserRetrieveBatchResponse

Some parameter documentations has been truncated, see Models::X::UserRetrieveBatchParams for more details.

Look up multiple users by IDs in one call

Parameters:

  • ids (String)

    Comma-separated numeric user IDs (1-100 values). Duplicate IDs are ignored while

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 80

def retrieve_batch(params)
  parsed, options = XTwitterScraper::X::UserRetrieveBatchParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "x/users/batch",
    query: query,
    model: XTwitterScraper::Models::X::UserRetrieveBatchResponse,
    options: options
  )
end

#retrieve_followers(id, after: nil, bio_contains: nil, cursor: nil, has_location: nil, has_website: nil, limit: nil, location_contains: nil, max_followers: nil, max_following: nil, max_statuses: nil, min_account_age_days: nil, min_followers: nil, min_following: nil, min_statuses: nil, mode: nil, page_size: nil, username_contains: nil, verified_only: nil, verified_type: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedUsers, XTwitterScraper::Models::X::UserRetrieveFollowersResponse::UserListCoverageResponse

Some parameter documentations has been truncated, see Models::X::UserRetrieveFollowersParams for more details.

List followers of a user

Parameters:

  • id (String)

    Target user ID or username for follower lookup.

  • after (String)

    Legacy cursor alias. Prefer cursor.

  • bio_contains (String)

    Match any comma-separated or line-separated bio term, ignoring case.

  • cursor (String)

    Cursor from the previous response. Xquik cursors resume automatic coverage. Exis

  • has_location (Boolean)

    Only return profiles with a location.

  • has_website (Boolean)

    Only return profiles with a website.

  • limit (Integer)

    Legacy page-size alias outside explicit coverage mode. Coverage accepts 1-10000.

  • location_contains (String)

    Match a location substring, ignoring case.

  • max_followers (Integer)

    Maximum follower count. Missing counts pass this maximum.

  • max_following (Integer)

    Maximum following count.

  • max_statuses (Integer)

    Maximum post count. maxPosts is also accepted.

  • min_account_age_days (Integer)

    Minimum account age in whole days.

  • min_followers (Integer)

    Minimum follower count. Filtering happens before billing.

  • min_following (Integer)

    Minimum following count.

  • min_statuses (Integer)

    Minimum post count. minPosts is also accepted.

  • mode (Symbol, XTwitterScraper::Models::X::UserRetrieveFollowersParams::Mode)

    Omit mode for resumable maximum coverage. Standard keeps legacy pagination. Cove

  • page_size (Integer)

    Maximum user profiles: automatic 300; standard 200. Sources return fewer profile

  • username_contains (String)

    Match a username substring, ignoring case.

  • verified_only (Boolean)

    Only return verified profiles.

  • verified_type (String)

    Match the verification type exactly, ignoring case.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 144

def retrieve_followers(id, params = {})
  parsed, options = XTwitterScraper::X::UserRetrieveFollowersParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["x/users/%1$s/followers", id],
    query: query.transform_keys(
      bio_contains: "bioContains",
      has_location: "hasLocation",
      has_website: "hasWebsite",
      location_contains: "locationContains",
      max_followers: "maxFollowers",
      max_following: "maxFollowing",
      max_statuses: "maxStatuses",
      min_account_age_days: "minAccountAgeDays",
      min_followers: "minFollowers",
      min_following: "minFollowing",
      min_statuses: "minStatuses",
      page_size: "pageSize",
      username_contains: "usernameContains",
      verified_only: "verifiedOnly",
      verified_type: "verifiedType"
    ),
    model: XTwitterScraper::Models::X::UserRetrieveFollowersResponse,
    options: options
  )
end

#retrieve_followers_you_know(id, bio_contains: nil, cursor: nil, has_location: nil, has_website: nil, location_contains: nil, max_followers: nil, max_following: nil, max_statuses: nil, min_account_age_days: nil, min_followers: nil, min_following: nil, min_statuses: nil, page_size: nil, username_contains: nil, verified_only: nil, verified_type: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedUsers

Some parameter documentations has been truncated, see Models::X::UserRetrieveFollowersYouKnowParams for more details.

List mutual followers between you and a user

Parameters:

  • id (String)

    User ID for followers-you-know lookup

  • bio_contains (String)

    Match any comma-separated or line-separated bio term, ignoring case.

  • cursor (String)

    Pagination cursor for followers-you-know

  • has_location (Boolean)

    Only return profiles with a location.

  • has_website (Boolean)

    Only return profiles with a website.

  • location_contains (String)

    Match a location substring, ignoring case.

  • max_followers (Integer)

    Maximum follower count. Missing counts pass this maximum.

  • max_following (Integer)

    Maximum following count.

  • max_statuses (Integer)

    Maximum post count. maxPosts is also accepted.

  • min_account_age_days (Integer)

    Minimum account age in whole days.

  • min_followers (Integer)

    Minimum follower count. Filtering happens before billing.

  • min_following (Integer)

    Minimum following count.

  • min_statuses (Integer)

    Minimum post count. minPosts is also accepted.

  • page_size (Integer)

    Maximum user profiles requested from this page (20-200, default 200). Source, fi

  • username_contains (String)

    Match a username substring, ignoring case.

  • verified_only (Boolean)

    Only return verified profiles.

  • verified_type (String)

    Match the verification type exactly, ignoring case.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 219

def retrieve_followers_you_know(id, params = {})
  parsed, options = XTwitterScraper::X::UserRetrieveFollowersYouKnowParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["x/users/%1$s/followers-you-know", id],
    query: query.transform_keys(
      bio_contains: "bioContains",
      has_location: "hasLocation",
      has_website: "hasWebsite",
      location_contains: "locationContains",
      max_followers: "maxFollowers",
      max_following: "maxFollowing",
      max_statuses: "maxStatuses",
      min_account_age_days: "minAccountAgeDays",
      min_followers: "minFollowers",
      min_following: "minFollowing",
      min_statuses: "minStatuses",
      page_size: "pageSize",
      username_contains: "usernameContains",
      verified_only: "verifiedOnly",
      verified_type: "verifiedType"
    ),
    model: XTwitterScraper::PaginatedUsers,
    options: options
  )
end

#retrieve_following(id, after: nil, bio_contains: nil, cursor: nil, has_location: nil, has_website: nil, limit: nil, location_contains: nil, max_followers: nil, max_following: nil, max_statuses: nil, min_account_age_days: nil, min_followers: nil, min_following: nil, min_statuses: nil, mode: nil, page_size: nil, username_contains: nil, verified_only: nil, verified_type: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedUsers, XTwitterScraper::Models::X::UserRetrieveFollowingResponse::UserListCoverageResponse

Some parameter documentations has been truncated, see Models::X::UserRetrieveFollowingParams for more details.

List accounts a user follows

Parameters:

  • id (String)

    User ID or username for following lookup

  • after (String)

    Deprecated following cursor alias. Prefer cursor.

  • bio_contains (String)

    Match any comma-separated or line-separated bio term, ignoring case.

  • cursor (String)

    Cursor from the previous response. Xquik cursors resume automatic coverage. Exis

  • has_location (Boolean)

    Only return profiles with a location.

  • has_website (Boolean)

    Only return profiles with a website.

  • limit (Integer)

    Legacy page-size alias outside explicit coverage mode. Coverage accepts 1-10000.

  • location_contains (String)

    Match a location substring, ignoring case.

  • max_followers (Integer)

    Maximum follower count. Missing counts pass this maximum.

  • max_following (Integer)

    Maximum following count.

  • max_statuses (Integer)

    Maximum post count. maxPosts is also accepted.

  • min_account_age_days (Integer)

    Minimum account age in whole days.

  • min_followers (Integer)

    Minimum follower count. Filtering happens before billing.

  • min_following (Integer)

    Minimum following count.

  • min_statuses (Integer)

    Minimum post count. minPosts is also accepted.

  • mode (Symbol, XTwitterScraper::Models::X::UserRetrieveFollowingParams::Mode)

    Omit mode for resumable maximum coverage. Standard keeps legacy pagination. Cove

  • page_size (Integer)

    Maximum user profiles: automatic 300; standard 200. Sources return fewer profile

  • username_contains (String)

    Match a username substring, ignoring case.

  • verified_only (Boolean)

    Only return verified profiles.

  • verified_type (String)

    Match the verification type exactly, ignoring case.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 299

def retrieve_following(id, params = {})
  parsed, options = XTwitterScraper::X::UserRetrieveFollowingParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["x/users/%1$s/following", id],
    query: query.transform_keys(
      bio_contains: "bioContains",
      has_location: "hasLocation",
      has_website: "hasWebsite",
      location_contains: "locationContains",
      max_followers: "maxFollowers",
      max_following: "maxFollowing",
      max_statuses: "maxStatuses",
      min_account_age_days: "minAccountAgeDays",
      min_followers: "minFollowers",
      min_following: "minFollowing",
      min_statuses: "minStatuses",
      page_size: "pageSize",
      username_contains: "usernameContains",
      verified_only: "verifiedOnly",
      verified_type: "verifiedType"
    ),
    model: XTwitterScraper::Models::X::UserRetrieveFollowingResponse,
    options: options
  )
end

#retrieve_likes(id, any_words: nil, blue_verified_only: nil, card_name: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_source: nil, exclude_words: nil, from_user: nil, geocode: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, max_faves: nil, max_id: nil, max_quotes: nil, max_replies: nil, max_retweets: nil, media_type: nil, mentioning: nil, min_bookmarks: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, min_views: nil, native_retweets: nil, near: nil, news: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, safe: nil, since_date: nil, since_id: nil, source: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, within: nil, within_time: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedTweets

Some parameter documentations has been truncated, see Models::X::UserRetrieveLikesParams for more details.

List tweets liked by a user

Parameters:

  • id (String)

    User ID or username

  • any_words (String)

    Words or quoted phrases where any one can match. Separate with spaces, commas, o

  • blue_verified_only (Boolean)

    Only return tweets from Blue-verified authors.

  • card_name (String)

    Match the Tweet card name.

  • cashtags (String)

    Cashtags separated by spaces, commas, or lines.

  • conversation_id (String)

    Conversation ID filter.

  • cursor (String)

    Pagination cursor for liked tweets

  • exact_phrase (String)

    Exact phrase to match.

  • exclude_source (String)

    Exclude a source application.

  • exclude_words (String)

    Words or quoted phrases to exclude. Separate with spaces, commas, or lines.

  • from_user (String)

    Filter by author username.

  • geocode (String)

    Match latitude, longitude, and radius.

  • hashtags (String)

    Hashtags separated by spaces, commas, or lines.

  • in_reply_to_tweet_id (String)

    Only replies to this tweet ID.

  • language (String)

    Language code filter, e.g. en or tr.

  • max_faves (Integer)

    Maximum likes threshold. maxLikes is also accepted.

  • max_id (String)

    Return Tweets older than this Tweet ID.

  • max_quotes (Integer)

    Maximum quotes threshold.

  • max_replies (Integer)

    Maximum replies threshold.

  • max_retweets (Integer)

    Maximum retweets threshold.

  • media_type (Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::MediaType)

    Filter by media type.

  • mentioning (String)

    Filter tweets mentioning a username.

  • min_bookmarks (Integer)

    Minimum bookmark count threshold.

  • min_faves (Integer)

    Minimum likes threshold. minLikes is also accepted.

  • min_quotes (Integer)

    Minimum quote count threshold.

  • min_replies (Integer)

    Minimum replies threshold.

  • min_retweets (Integer)

    Minimum retweets threshold.

  • min_views (Integer)

    Minimum view count threshold.

  • native_retweets (Boolean)

    Only return native reposts.

  • near (String)

    Match a place name.

  • news (Boolean)

    Only return news results.

  • page_size (Integer)

    Maximum page items (1-100, default 20). Source, filters, or credits can reduce r

  • quotes (Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Quotes)

    Quote mode.

  • quotes_of_tweet_id (String)

    Only quotes of this tweet ID.

  • replies (Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Replies)

    Reply mode.

  • retweets (Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Retweets)

    Retweet mode.

  • retweets_of_tweet_id (String)

    Only retweets of this tweet ID.

  • safe (Boolean)

    Enable the safe-search filter.

  • since_date (Date)

    Start date in YYYY-MM-DD format.

  • since_id (String)

    Return Tweets newer than this Tweet ID.

  • source (String)

    Match the source application.

  • to_user (String)

    Filter replies sent to a username.

  • until_date (Date)

    End date in YYYY-MM-DD format.

  • url (String)

    URL substring or domain filter.

  • verified_only (Boolean)

    Only return tweets from verified authors.

  • within (String)

    Set the radius for the near filter.

  • within_time (String)

    Match Tweets inside a recent time window.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 433

def retrieve_likes(id, params = {})
  parsed, options = XTwitterScraper::X::UserRetrieveLikesParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["x/users/%1$s/likes", id],
    query: query.transform_keys(
      any_words: "anyWords",
      blue_verified_only: "blueVerifiedOnly",
      card_name: "cardName",
      conversation_id: "conversationId",
      exact_phrase: "exactPhrase",
      exclude_source: "excludeSource",
      exclude_words: "excludeWords",
      from_user: "fromUser",
      in_reply_to_tweet_id: "inReplyToTweetId",
      max_faves: "maxFaves",
      max_id: "maxId",
      max_quotes: "maxQuotes",
      max_replies: "maxReplies",
      max_retweets: "maxRetweets",
      media_type: "mediaType",
      min_bookmarks: "minBookmarks",
      min_faves: "minFaves",
      min_quotes: "minQuotes",
      min_replies: "minReplies",
      min_retweets: "minRetweets",
      min_views: "minViews",
      native_retweets: "nativeRetweets",
      page_size: "pageSize",
      quotes_of_tweet_id: "quotesOfTweetId",
      retweets_of_tweet_id: "retweetsOfTweetId",
      since_date: "sinceDate",
      since_id: "sinceId",
      to_user: "toUser",
      until_date: "untilDate",
      verified_only: "verifiedOnly",
      within_time: "withinTime"
    ),
    model: XTwitterScraper::PaginatedTweets,
    options: options
  )
end

#retrieve_media(id, any_words: nil, blue_verified_only: nil, card_name: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_source: nil, exclude_words: nil, from_user: nil, geocode: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, max_faves: nil, max_id: nil, max_quotes: nil, max_replies: nil, max_retweets: nil, media_type: nil, mentioning: nil, min_bookmarks: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, min_views: nil, native_retweets: nil, near: nil, news: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, safe: nil, since_date: nil, since_id: nil, source: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, within: nil, within_time: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedTweets

Some parameter documentations has been truncated, see Models::X::UserRetrieveMediaParams for more details.

List media tweets posted by a user

Parameters:

  • id (String)

    User ID or username for media lookup

  • any_words (String)

    Words or quoted phrases where any one can match. Separate with spaces, commas, o

  • blue_verified_only (Boolean)

    Only return tweets from Blue-verified authors.

  • card_name (String)

    Match the Tweet card name.

  • cashtags (String)

    Cashtags separated by spaces, commas, or lines.

  • conversation_id (String)

    Conversation ID filter.

  • cursor (String)

    Pagination cursor for media tweets

  • exact_phrase (String)

    Exact phrase to match.

  • exclude_source (String)

    Exclude a source application.

  • exclude_words (String)

    Words or quoted phrases to exclude. Separate with spaces, commas, or lines.

  • from_user (String)

    Filter by author username.

  • geocode (String)

    Match latitude, longitude, and radius.

  • hashtags (String)

    Hashtags separated by spaces, commas, or lines.

  • in_reply_to_tweet_id (String)

    Only replies to this tweet ID.

  • language (String)

    Language code filter, e.g. en or tr.

  • max_faves (Integer)

    Maximum likes threshold. maxLikes is also accepted.

  • max_id (String)

    Return Tweets older than this Tweet ID.

  • max_quotes (Integer)

    Maximum quotes threshold.

  • max_replies (Integer)

    Maximum replies threshold.

  • max_retweets (Integer)

    Maximum retweets threshold.

  • media_type (Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::MediaType)

    Filter by media type.

  • mentioning (String)

    Filter tweets mentioning a username.

  • min_bookmarks (Integer)

    Minimum bookmark count threshold.

  • min_faves (Integer)

    Minimum likes threshold. minLikes is also accepted.

  • min_quotes (Integer)

    Minimum quote count threshold.

  • min_replies (Integer)

    Minimum replies threshold.

  • min_retweets (Integer)

    Minimum retweets threshold.

  • min_views (Integer)

    Minimum view count threshold.

  • native_retweets (Boolean)

    Only return native reposts.

  • near (String)

    Match a place name.

  • news (Boolean)

    Only return news results.

  • page_size (Integer)

    Maximum page items (1-100, default 20). Source, filters, or credits can reduce r

  • quotes (Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Quotes)

    Quote mode.

  • quotes_of_tweet_id (String)

    Only quotes of this tweet ID.

  • replies (Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Replies)

    Reply mode.

  • retweets (Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Retweets)

    Retweet mode.

  • retweets_of_tweet_id (String)

    Only retweets of this tweet ID.

  • safe (Boolean)

    Enable the safe-search filter.

  • since_date (Date)

    Start date in YYYY-MM-DD format.

  • since_id (String)

    Return Tweets newer than this Tweet ID.

  • source (String)

    Match the source application.

  • to_user (String)

    Filter replies sent to a username.

  • until_date (Date)

    End date in YYYY-MM-DD format.

  • url (String)

    URL substring or domain filter.

  • verified_only (Boolean)

    Only return tweets from verified authors.

  • within (String)

    Set the radius for the near filter.

  • within_time (String)

    Match Tweets inside a recent time window.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 583

def retrieve_media(id, params = {})
  parsed, options = XTwitterScraper::X::UserRetrieveMediaParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["x/users/%1$s/media", id],
    query: query.transform_keys(
      any_words: "anyWords",
      blue_verified_only: "blueVerifiedOnly",
      card_name: "cardName",
      conversation_id: "conversationId",
      exact_phrase: "exactPhrase",
      exclude_source: "excludeSource",
      exclude_words: "excludeWords",
      from_user: "fromUser",
      in_reply_to_tweet_id: "inReplyToTweetId",
      max_faves: "maxFaves",
      max_id: "maxId",
      max_quotes: "maxQuotes",
      max_replies: "maxReplies",
      max_retweets: "maxRetweets",
      media_type: "mediaType",
      min_bookmarks: "minBookmarks",
      min_faves: "minFaves",
      min_quotes: "minQuotes",
      min_replies: "minReplies",
      min_retweets: "minRetweets",
      min_views: "minViews",
      native_retweets: "nativeRetweets",
      page_size: "pageSize",
      quotes_of_tweet_id: "quotesOfTweetId",
      retweets_of_tweet_id: "retweetsOfTweetId",
      since_date: "sinceDate",
      since_id: "sinceId",
      to_user: "toUser",
      until_date: "untilDate",
      verified_only: "verifiedOnly",
      within_time: "withinTime"
    ),
    model: XTwitterScraper::PaginatedTweets,
    options: options
  )
end

#retrieve_mentions(id, any_words: nil, blue_verified_only: nil, card_name: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_source: nil, exclude_words: nil, from_user: nil, geocode: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, max_faves: nil, max_id: nil, max_quotes: nil, max_replies: nil, max_retweets: nil, media_type: nil, mentioning: nil, min_bookmarks: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, min_views: nil, native_retweets: nil, near: nil, news: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, safe: nil, since_date: nil, since_id: nil, since_time: nil, source: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, within: nil, within_time: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedTweets

Some parameter documentations has been truncated, see Models::X::UserRetrieveMentionsParams for more details.

List tweets mentioning a user

Parameters:

  • id (String)

    User ID or username for mentions lookup

  • any_words (String)

    Words or quoted phrases where any one can match. Separate with spaces, commas, o

  • blue_verified_only (Boolean)

    Only return tweets from Blue-verified authors.

  • card_name (String)

    Match the Tweet card name.

  • cashtags (String)

    Cashtags separated by spaces, commas, or lines.

  • conversation_id (String)

    Conversation ID filter.

  • cursor (String)

    Pagination cursor for mentions

  • exact_phrase (String)

    Exact phrase to match.

  • exclude_source (String)

    Exclude a source application.

  • exclude_words (String)

    Words or quoted phrases to exclude. Separate with spaces, commas, or lines.

  • from_user (String)

    Filter by author username.

  • geocode (String)

    Match latitude, longitude, and radius.

  • hashtags (String)

    Hashtags separated by spaces, commas, or lines.

  • in_reply_to_tweet_id (String)

    Only replies to this tweet ID.

  • language (String)

    Language code filter, e.g. en or tr.

  • max_faves (Integer)

    Maximum likes threshold. maxLikes is also accepted.

  • max_id (String)

    Return Tweets older than this Tweet ID.

  • max_quotes (Integer)

    Maximum quotes threshold.

  • max_replies (Integer)

    Maximum replies threshold.

  • max_retweets (Integer)

    Maximum retweets threshold.

  • media_type (Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::MediaType)

    Filter by media type.

  • mentioning (String)

    Filter tweets mentioning a username.

  • min_bookmarks (Integer)

    Minimum bookmark count threshold.

  • min_faves (Integer)

    Minimum likes threshold. minLikes is also accepted.

  • min_quotes (Integer)

    Minimum quote count threshold.

  • min_replies (Integer)

    Minimum replies threshold.

  • min_retweets (Integer)

    Minimum retweets threshold.

  • min_views (Integer)

    Minimum view count threshold.

  • native_retweets (Boolean)

    Only return native reposts.

  • near (String)

    Match a place name.

  • news (Boolean)

    Only return news results.

  • page_size (Integer)

    Maximum page items (1-100, default 20). Source, filters, or credits can reduce r

  • quotes (Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Quotes)

    Quote mode.

  • quotes_of_tweet_id (String)

    Only quotes of this tweet ID.

  • replies (Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Replies)

    Reply mode.

  • retweets (Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Retweets)

    Retweet mode.

  • retweets_of_tweet_id (String)

    Only retweets of this tweet ID.

  • safe (Boolean)

    Enable the safe-search filter.

  • since_date (Date)

    Start date in YYYY-MM-DD format.

  • since_id (String)

    Return Tweets newer than this Tweet ID.

  • since_time (String)

    Unix timestamp - return mentions after this time

  • source (String)

    Match the source application.

  • to_user (String)

    Filter replies sent to a username.

  • until_date (Date)

    End date in YYYY-MM-DD format.

  • until_time (String)

    Unix timestamp - return mentions before this time

  • url (String)

    URL substring or domain filter.

  • verified_only (Boolean)

    Only return tweets from verified authors.

  • within (String)

    Set the radius for the near filter.

  • within_time (String)

    Match Tweets inside a recent time window.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 737

def retrieve_mentions(id, params = {})
  parsed, options = XTwitterScraper::X::UserRetrieveMentionsParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["x/users/%1$s/mentions", id],
    query: query.transform_keys(
      any_words: "anyWords",
      blue_verified_only: "blueVerifiedOnly",
      card_name: "cardName",
      conversation_id: "conversationId",
      exact_phrase: "exactPhrase",
      exclude_source: "excludeSource",
      exclude_words: "excludeWords",
      from_user: "fromUser",
      in_reply_to_tweet_id: "inReplyToTweetId",
      max_faves: "maxFaves",
      max_id: "maxId",
      max_quotes: "maxQuotes",
      max_replies: "maxReplies",
      max_retweets: "maxRetweets",
      media_type: "mediaType",
      min_bookmarks: "minBookmarks",
      min_faves: "minFaves",
      min_quotes: "minQuotes",
      min_replies: "minReplies",
      min_retweets: "minRetweets",
      min_views: "minViews",
      native_retweets: "nativeRetweets",
      page_size: "pageSize",
      quotes_of_tweet_id: "quotesOfTweetId",
      retweets_of_tweet_id: "retweetsOfTweetId",
      since_date: "sinceDate",
      since_id: "sinceId",
      since_time: "sinceTime",
      to_user: "toUser",
      until_date: "untilDate",
      until_time: "untilTime",
      verified_only: "verifiedOnly",
      within_time: "withinTime"
    ),
    model: XTwitterScraper::PaginatedTweets,
    options: options
  )
end

#retrieve_replies(id, any_words: nil, blue_verified_only: nil, card_name: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_source: nil, exclude_words: nil, from_user: nil, geocode: nil, hashtags: nil, include_parent_tweet: nil, in_reply_to_tweet_id: nil, language: nil, max_faves: nil, max_id: nil, max_quotes: nil, max_replies: nil, max_retweets: nil, media_type: nil, mentioning: nil, min_bookmarks: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, min_views: nil, native_retweets: nil, near: nil, news: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, safe: nil, since_date: nil, since_id: nil, source: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, within: nil, within_time: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedTweets

Some parameter documentations has been truncated, see Models::X::UserRetrieveRepliesParams for more details.

Returns target-authored posts and replies. Omit mode for automatic maximum coverage. Pass next_cursor unchanged. Unprefixed cursors stay legacy. Excludes other-author context.

Parameters:

  • id (String)

    Target user ID or username for the replies timeline.

  • any_words (String)

    Words or quoted phrases where any one can match. Separate with spaces, commas, o

  • blue_verified_only (Boolean)

    Only return tweets from Blue-verified authors.

  • card_name (String)

    Match the Tweet card name.

  • cashtags (String)

    Cashtags separated by spaces, commas, or lines.

  • conversation_id (String)

    Conversation ID filter.

  • cursor (String)

    Cursor from the previous response. Xquik cursors resume automatic coverage. Exis

  • exact_phrase (String)

    Exact phrase to match.

  • exclude_source (String)

    Exclude a source application.

  • exclude_words (String)

    Words or quoted phrases to exclude. Separate with spaces, commas, or lines.

  • from_user (String)

    Filter by author username.

  • geocode (String)

    Match latitude, longitude, and radius.

  • hashtags (String)

    Hashtags separated by spaces, commas, or lines.

  • include_parent_tweet (Boolean)

    Include each reply's parent tweet.

  • in_reply_to_tweet_id (String)

    Only replies to this tweet ID.

  • language (String)

    Language code filter, e.g. en or tr.

  • max_faves (Integer)

    Maximum likes threshold. maxLikes is also accepted.

  • max_id (String)

    Return Tweets older than this Tweet ID.

  • max_quotes (Integer)

    Maximum quotes threshold.

  • max_replies (Integer)

    Maximum replies threshold.

  • max_retweets (Integer)

    Maximum retweets threshold.

  • media_type (Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::MediaType)

    Filter by media type.

  • mentioning (String)

    Filter tweets mentioning a username.

  • min_bookmarks (Integer)

    Minimum bookmark count threshold.

  • min_faves (Integer)

    Minimum likes threshold. minLikes is also accepted.

  • min_quotes (Integer)

    Minimum quote count threshold.

  • min_replies (Integer)

    Minimum replies threshold.

  • min_retweets (Integer)

    Minimum retweets threshold.

  • min_views (Integer)

    Minimum view count threshold.

  • native_retweets (Boolean)

    Only return native reposts.

  • near (String)

    Match a place name.

  • news (Boolean)

    Only return news results.

  • page_size (Integer)

    Automatic pages accept 1-300 Tweets. Standard pages keep 1-100. Default 20. Cont

  • quotes (Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Quotes)

    Quote mode.

  • quotes_of_tweet_id (String)

    Only quotes of this tweet ID.

  • replies (Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Replies)

    Reply mode.

  • retweets (Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Retweets)

    Retweet mode.

  • retweets_of_tweet_id (String)

    Only retweets of this tweet ID.

  • safe (Boolean)

    Enable the safe-search filter.

  • since_date (Date)

    Start date in YYYY-MM-DD format.

  • since_id (String)

    Return Tweets newer than this Tweet ID.

  • source (String)

    Match the source application.

  • to_user (String)

    Filter replies sent to a username.

  • until_date (Date)

    End date in YYYY-MM-DD format.

  • url (String)

    URL substring or domain filter.

  • verified_only (Boolean)

    Only return tweets from verified authors.

  • within (String)

    Set the radius for the near filter.

  • within_time (String)

    Match Tweets inside a recent time window.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 893

def retrieve_replies(id, params = {})
  parsed, options = XTwitterScraper::X::UserRetrieveRepliesParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["x/users/%1$s/replies", id],
    query: query.transform_keys(
      any_words: "anyWords",
      blue_verified_only: "blueVerifiedOnly",
      card_name: "cardName",
      conversation_id: "conversationId",
      exact_phrase: "exactPhrase",
      exclude_source: "excludeSource",
      exclude_words: "excludeWords",
      from_user: "fromUser",
      include_parent_tweet: "includeParentTweet",
      in_reply_to_tweet_id: "inReplyToTweetId",
      max_faves: "maxFaves",
      max_id: "maxId",
      max_quotes: "maxQuotes",
      max_replies: "maxReplies",
      max_retweets: "maxRetweets",
      media_type: "mediaType",
      min_bookmarks: "minBookmarks",
      min_faves: "minFaves",
      min_quotes: "minQuotes",
      min_replies: "minReplies",
      min_retweets: "minRetweets",
      min_views: "minViews",
      native_retweets: "nativeRetweets",
      page_size: "pageSize",
      quotes_of_tweet_id: "quotesOfTweetId",
      retweets_of_tweet_id: "retweetsOfTweetId",
      since_date: "sinceDate",
      since_id: "sinceId",
      to_user: "toUser",
      until_date: "untilDate",
      verified_only: "verifiedOnly",
      within_time: "withinTime"
    ),
    model: XTwitterScraper::PaginatedTweets,
    options: options
  )
end

#retrieve_search(q:, bio_contains: nil, cursor: nil, has_location: nil, has_website: nil, location_contains: nil, max_followers: nil, max_following: nil, max_statuses: nil, min_account_age_days: nil, min_followers: nil, min_following: nil, min_statuses: nil, username_contains: nil, verified_only: nil, verified_type: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedUsers

Some parameter documentations has been truncated, see Models::X::UserRetrieveSearchParams for more details.

Search users by name or username

Parameters:

  • q (String)

    User search query

  • bio_contains (String)

    Match any comma-separated or line-separated bio term, ignoring case.

  • cursor (String)

    Pagination cursor for user search

  • has_location (Boolean)

    Only return profiles with a location.

  • has_website (Boolean)

    Only return profiles with a website.

  • location_contains (String)

    Match a location substring, ignoring case.

  • max_followers (Integer)

    Maximum follower count. Missing counts pass this maximum.

  • max_following (Integer)

    Maximum following count.

  • max_statuses (Integer)

    Maximum post count. maxPosts is also accepted.

  • min_account_age_days (Integer)

    Minimum account age in whole days.

  • min_followers (Integer)

    Minimum follower count. Filtering happens before billing.

  • min_following (Integer)

    Minimum following count.

  • min_statuses (Integer)

    Minimum post count. minPosts is also accepted.

  • username_contains (String)

    Match a username substring, ignoring case.

  • verified_only (Boolean)

    Only return verified profiles.

  • verified_type (String)

    Match the verification type exactly, ignoring case.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 982

def retrieve_search(params)
  parsed, options = XTwitterScraper::X::UserRetrieveSearchParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "x/users/search",
    query: query.transform_keys(
      bio_contains: "bioContains",
      has_location: "hasLocation",
      has_website: "hasWebsite",
      location_contains: "locationContains",
      max_followers: "maxFollowers",
      max_following: "maxFollowing",
      max_statuses: "maxStatuses",
      min_account_age_days: "minAccountAgeDays",
      min_followers: "minFollowers",
      min_following: "minFollowing",
      min_statuses: "minStatuses",
      username_contains: "usernameContains",
      verified_only: "verifiedOnly",
      verified_type: "verifiedType"
    ),
    model: XTwitterScraper::PaginatedUsers,
    options: options
  )
end

#retrieve_tweets(id, any_words: nil, blue_verified_only: nil, card_name: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_source: nil, exclude_words: nil, from_user: nil, geocode: nil, hashtags: nil, include_parent_tweet: nil, include_replies: nil, in_reply_to_tweet_id: nil, language: nil, max_faves: nil, max_id: nil, max_quotes: nil, max_replies: nil, max_retweets: nil, media_type: nil, mentioning: nil, min_bookmarks: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, min_views: nil, native_retweets: nil, near: nil, news: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, safe: nil, since_date: nil, since_id: nil, source: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, within: nil, within_time: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedTweets

Some parameter documentations has been truncated, see Models::X::UserRetrieveTweetsParams for more details.

Omit mode for automatic maximum coverage. Pass next_cursor unchanged. Unprefixed cursors use legacy pagination. Shape and billing stay the same.

Parameters:

  • id (String)

    X user ID or username

  • any_words (String)

    Words or quoted phrases where any one can match. Separate with spaces, commas, o

  • blue_verified_only (Boolean)

    Only return tweets from Blue-verified authors.

  • card_name (String)

    Match the Tweet card name.

  • cashtags (String)

    Cashtags separated by spaces, commas, or lines.

  • conversation_id (String)

    Conversation ID filter.

  • cursor (String)

    Cursor from the previous response. Xquik cursors resume automatic coverage. Exis

  • exact_phrase (String)

    Exact phrase to match.

  • exclude_source (String)

    Exclude a source application.

  • exclude_words (String)

    Words or quoted phrases to exclude. Separate with spaces, commas, or lines.

  • from_user (String)

    Filter by author username.

  • geocode (String)

    Match latitude, longitude, and radius.

  • hashtags (String)

    Hashtags separated by spaces, commas, or lines.

  • include_parent_tweet (Boolean)

    Include parent tweet for replies

  • include_replies (Boolean)

    Include reply tweets

  • in_reply_to_tweet_id (String)

    Only replies to this tweet ID.

  • language (String)

    Language code filter, e.g. en or tr.

  • max_faves (Integer)

    Maximum likes threshold. maxLikes is also accepted.

  • max_id (String)

    Return Tweets older than this Tweet ID.

  • max_quotes (Integer)

    Maximum quotes threshold.

  • max_replies (Integer)

    Maximum replies threshold.

  • max_retweets (Integer)

    Maximum retweets threshold.

  • media_type (Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::MediaType)

    Filter by media type.

  • mentioning (String)

    Filter tweets mentioning a username.

  • min_bookmarks (Integer)

    Minimum bookmark count threshold.

  • min_faves (Integer)

    Minimum likes threshold. minLikes is also accepted.

  • min_quotes (Integer)

    Minimum quote count threshold.

  • min_replies (Integer)

    Minimum replies threshold.

  • min_retweets (Integer)

    Minimum retweets threshold.

  • min_views (Integer)

    Minimum view count threshold.

  • native_retweets (Boolean)

    Only return native reposts.

  • near (String)

    Match a place name.

  • news (Boolean)

    Only return news results.

  • page_size (Integer)

    Automatic pages accept 1-300 Tweets. Standard pages keep 1-100. Default 20. Cont

  • quotes (Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Quotes)

    Quote mode.

  • quotes_of_tweet_id (String)

    Only quotes of this tweet ID.

  • replies (Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Replies)

    Reply mode.

  • retweets (Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Retweets)

    Retweet mode.

  • retweets_of_tweet_id (String)

    Only retweets of this tweet ID.

  • safe (Boolean)

    Enable the safe-search filter.

  • since_date (Date)

    Start date in YYYY-MM-DD format.

  • since_id (String)

    Return Tweets newer than this Tweet ID.

  • source (String)

    Match the source application.

  • to_user (String)

    Filter replies sent to a username.

  • until_date (Date)

    End date in YYYY-MM-DD format.

  • url (String)

    URL substring or domain filter.

  • verified_only (Boolean)

    Only return tweets from verified authors.

  • within (String)

    Set the radius for the near filter.

  • within_time (String)

    Match Tweets inside a recent time window.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 1120

def retrieve_tweets(id, params = {})
  parsed, options = XTwitterScraper::X::UserRetrieveTweetsParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["x/users/%1$s/tweets", id],
    query: query.transform_keys(
      any_words: "anyWords",
      blue_verified_only: "blueVerifiedOnly",
      card_name: "cardName",
      conversation_id: "conversationId",
      exact_phrase: "exactPhrase",
      exclude_source: "excludeSource",
      exclude_words: "excludeWords",
      from_user: "fromUser",
      include_parent_tweet: "includeParentTweet",
      include_replies: "includeReplies",
      in_reply_to_tweet_id: "inReplyToTweetId",
      max_faves: "maxFaves",
      max_id: "maxId",
      max_quotes: "maxQuotes",
      max_replies: "maxReplies",
      max_retweets: "maxRetweets",
      media_type: "mediaType",
      min_bookmarks: "minBookmarks",
      min_faves: "minFaves",
      min_quotes: "minQuotes",
      min_replies: "minReplies",
      min_retweets: "minRetweets",
      min_views: "minViews",
      native_retweets: "nativeRetweets",
      page_size: "pageSize",
      quotes_of_tweet_id: "quotesOfTweetId",
      retweets_of_tweet_id: "retweetsOfTweetId",
      since_date: "sinceDate",
      since_id: "sinceId",
      to_user: "toUser",
      until_date: "untilDate",
      verified_only: "verifiedOnly",
      within_time: "withinTime"
    ),
    model: XTwitterScraper::PaginatedTweets,
    options: options
  )
end

#retrieve_verified_followers(id, after: nil, bio_contains: nil, cursor: nil, has_location: nil, has_website: nil, limit: nil, location_contains: nil, max_followers: nil, max_following: nil, max_statuses: nil, min_account_age_days: nil, min_followers: nil, min_following: nil, min_statuses: nil, mode: nil, page_size: nil, username_contains: nil, verified_only: nil, verified_type: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedUsers, XTwitterScraper::Models::X::UserRetrieveVerifiedFollowersResponse::UserListCoverageResponse

Some parameter documentations has been truncated, see Models::X::UserRetrieveVerifiedFollowersParams for more details.

List verified followers of a user

Parameters:

  • id (String)

    User ID or username for verified followers

  • after (String)

    Legacy cursor alias. Prefer cursor.

  • bio_contains (String)

    Match any comma-separated or line-separated bio term, ignoring case.

  • cursor (String)

    Cursor from the previous response. Xquik cursors resume automatic coverage. Exis

  • has_location (Boolean)

    Only return profiles with a location.

  • has_website (Boolean)

    Only return profiles with a website.

  • limit (Integer)

    Legacy page-size alias outside explicit coverage mode. Coverage accepts 1-10000.

  • location_contains (String)

    Match a location substring, ignoring case.

  • max_followers (Integer)

    Maximum follower count. Missing counts pass this maximum.

  • max_following (Integer)

    Maximum following count.

  • max_statuses (Integer)

    Maximum post count. maxPosts is also accepted.

  • min_account_age_days (Integer)

    Minimum account age in whole days.

  • min_followers (Integer)

    Minimum follower count. Filtering happens before billing.

  • min_following (Integer)

    Minimum following count.

  • min_statuses (Integer)

    Minimum post count. minPosts is also accepted.

  • mode (Symbol, XTwitterScraper::Models::X::UserRetrieveVerifiedFollowersParams::Mode)

    Omit mode for resumable maximum coverage. Standard keeps legacy pagination. Cove

  • page_size (Integer)

    Maximum user profiles: automatic 300; standard 200. Sources return fewer profile

  • username_contains (String)

    Match a username substring, ignoring case.

  • verified_only (Boolean)

    Only return verified profiles.

  • verified_type (String)

    Match the verification type exactly, ignoring case.

  • request_options (XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
# File 'lib/x_twitter_scraper/resources/x/users.rb', line 1219

def retrieve_verified_followers(id, params = {})
  parsed, options = XTwitterScraper::X::UserRetrieveVerifiedFollowersParams.dump_request(params)
  query = XTwitterScraper::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["x/users/%1$s/verified-followers", id],
    query: query.transform_keys(
      bio_contains: "bioContains",
      has_location: "hasLocation",
      has_website: "hasWebsite",
      location_contains: "locationContains",
      max_followers: "maxFollowers",
      max_following: "maxFollowing",
      max_statuses: "maxStatuses",
      min_account_age_days: "minAccountAgeDays",
      min_followers: "minFollowers",
      min_following: "minFollowing",
      min_statuses: "minStatuses",
      page_size: "pageSize",
      username_contains: "usernameContains",
      verified_only: "verifiedOnly",
      verified_type: "verifiedType"
    ),
    model: XTwitterScraper::Models::X::UserRetrieveVerifiedFollowersResponse,
    options: options
  )
end