x-twitter-scraper 0.4.5 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -0
  3. data/README.md +8 -41
  4. data/lib/x_twitter_scraper/client.rb +1 -1
  5. data/lib/x_twitter_scraper/internal/type/union.rb +13 -0
  6. data/lib/x_twitter_scraper/models/account_retrieve_response.rb +4 -4
  7. data/lib/x_twitter_scraper/models/compose_create_params.rb +194 -122
  8. data/lib/x_twitter_scraper/models/compose_create_response.rb +326 -33
  9. data/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb +2 -2
  10. data/lib/x_twitter_scraper/models/error.rb +99 -3
  11. data/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb +8 -8
  12. data/lib/x_twitter_scraper/models/guest_wallet_create_params.rb +2 -2
  13. data/lib/x_twitter_scraper/models/guest_wallet_create_response.rb +27 -7
  14. data/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb +2 -2
  15. data/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb +27 -7
  16. data/lib/x_twitter_scraper/models/search_tweet.rb +12 -12
  17. data/lib/x_twitter_scraper/models/support/ticket_create_params.rb +7 -1
  18. data/lib/x_twitter_scraper/models/support/ticket_create_response.rb +40 -3
  19. data/lib/x_twitter_scraper/models/support/ticket_reply_params.rb +7 -1
  20. data/lib/x_twitter_scraper/models/support/ticket_reply_response.rb +40 -3
  21. data/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +114 -1
  22. data/lib/x_twitter_scraper/models/x/communities/join_create_params.rb +8 -1
  23. data/lib/x_twitter_scraper/models/x/communities/join_create_response.rb +577 -4
  24. data/lib/x_twitter_scraper/models/x/communities/join_delete_all_params.rb +8 -1
  25. data/lib/x_twitter_scraper/models/x/communities/join_delete_all_response.rb +585 -4
  26. data/lib/x_twitter_scraper/models/x/community_create_params.rb +8 -1
  27. data/lib/x_twitter_scraper/models/x/community_create_response.rb +568 -8
  28. data/lib/x_twitter_scraper/models/x/community_delete_params.rb +8 -1
  29. data/lib/x_twitter_scraper/models/x/community_delete_response.rb +576 -4
  30. data/lib/x_twitter_scraper/models/x/dm_send_params.rb +8 -1
  31. data/lib/x_twitter_scraper/models/x/dm_send_response.rb +573 -7
  32. data/lib/x_twitter_scraper/models/x/media_upload_params.rb +8 -1
  33. data/lib/x_twitter_scraper/models/x/media_upload_response.rb +568 -11
  34. data/lib/x_twitter_scraper/models/x/profile_update_avatar_params.rb +8 -1
  35. data/lib/x_twitter_scraper/models/x/profile_update_avatar_response.rb +576 -4
  36. data/lib/x_twitter_scraper/models/x/profile_update_banner_params.rb +8 -1
  37. data/lib/x_twitter_scraper/models/x/profile_update_banner_response.rb +576 -4
  38. data/lib/x_twitter_scraper/models/x/profile_update_params.rb +8 -1
  39. data/lib/x_twitter_scraper/models/x/profile_update_response.rb +576 -4
  40. data/lib/x_twitter_scraper/models/x/tweet_author.rb +1 -14
  41. data/lib/x_twitter_scraper/models/x/tweet_create_params.rb +5 -5
  42. data/lib/x_twitter_scraper/models/x/tweet_create_response.rb +551 -12
  43. data/lib/x_twitter_scraper/models/x/tweet_delete_params.rb +8 -1
  44. data/lib/x_twitter_scraper/models/x/tweet_delete_response.rb +576 -4
  45. data/lib/x_twitter_scraper/models/x/tweets/like_create_params.rb +8 -1
  46. data/lib/x_twitter_scraper/models/x/tweets/like_create_response.rb +576 -4
  47. data/lib/x_twitter_scraper/models/x/tweets/like_delete_params.rb +8 -1
  48. data/lib/x_twitter_scraper/models/x/tweets/like_delete_response.rb +576 -4
  49. data/lib/x_twitter_scraper/models/x/tweets/retweet_create_params.rb +8 -1
  50. data/lib/x_twitter_scraper/models/x/tweets/retweet_create_response.rb +576 -4
  51. data/lib/x_twitter_scraper/models/x/tweets/retweet_delete_params.rb +8 -1
  52. data/lib/x_twitter_scraper/models/x/tweets/retweet_delete_response.rb +576 -4
  53. data/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb +8 -1
  54. data/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb +576 -4
  55. data/lib/x_twitter_scraper/models/x/user_retrieve_following_params.rb +2 -2
  56. data/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +2 -2
  57. data/lib/x_twitter_scraper/models/x/users/follow_create_params.rb +8 -1
  58. data/lib/x_twitter_scraper/models/x/users/follow_create_response.rb +576 -4
  59. data/lib/x_twitter_scraper/models/x/users/follow_delete_all_params.rb +8 -1
  60. data/lib/x_twitter_scraper/models/x/users/follow_delete_all_response.rb +576 -4
  61. data/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb +469 -52
  62. data/lib/x_twitter_scraper/models/x/x_account.rb +7 -7
  63. data/lib/x_twitter_scraper/models/x/x_account_detail.rb +1 -1
  64. data/lib/x_twitter_scraper/resources/compose.rb +8 -26
  65. data/lib/x_twitter_scraper/resources/credits.rb +1 -1
  66. data/lib/x_twitter_scraper/resources/extractions.rb +4 -4
  67. data/lib/x_twitter_scraper/resources/guest_wallets.rb +2 -2
  68. data/lib/x_twitter_scraper/resources/monitors/keywords.rb +4 -5
  69. data/lib/x_twitter_scraper/resources/monitors.rb +3 -3
  70. data/lib/x_twitter_scraper/resources/support/tickets.rb +24 -8
  71. data/lib/x_twitter_scraper/resources/trends.rb +1 -1
  72. data/lib/x_twitter_scraper/resources/x/communities/join.rb +22 -8
  73. data/lib/x_twitter_scraper/resources/x/communities.rb +25 -11
  74. data/lib/x_twitter_scraper/resources/x/dm.rb +13 -6
  75. data/lib/x_twitter_scraper/resources/x/media.rb +17 -7
  76. data/lib/x_twitter_scraper/resources/x/profile.rb +46 -17
  77. data/lib/x_twitter_scraper/resources/x/tweets/like.rb +22 -8
  78. data/lib/x_twitter_scraper/resources/x/tweets/retweet.rb +22 -8
  79. data/lib/x_twitter_scraper/resources/x/tweets.rb +31 -16
  80. data/lib/x_twitter_scraper/resources/x/users/follow.rb +22 -8
  81. data/lib/x_twitter_scraper/resources/x/users.rb +16 -9
  82. data/lib/x_twitter_scraper/resources/x.rb +1 -2
  83. data/lib/x_twitter_scraper/version.rb +1 -1
  84. data/rbi/x_twitter_scraper/client.rbi +1 -1
  85. data/rbi/x_twitter_scraper/models/account_retrieve_response.rbi +4 -4
  86. data/rbi/x_twitter_scraper/models/compose_create_params.rbi +392 -215
  87. data/rbi/x_twitter_scraper/models/compose_create_response.rbi +537 -48
  88. data/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi +2 -2
  89. data/rbi/x_twitter_scraper/models/error.rbi +379 -13
  90. data/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi +8 -8
  91. data/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi +2 -2
  92. data/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi +87 -5
  93. data/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi +2 -2
  94. data/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi +87 -5
  95. data/rbi/x_twitter_scraper/models/search_tweet.rbi +12 -12
  96. data/rbi/x_twitter_scraper/models/support/ticket_create_params.rbi +9 -1
  97. data/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi +113 -7
  98. data/rbi/x_twitter_scraper/models/support/ticket_reply_params.rbi +9 -1
  99. data/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi +113 -7
  100. data/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +276 -5
  101. data/rbi/x_twitter_scraper/models/x/communities/join_create_params.rbi +6 -0
  102. data/rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi +1154 -3
  103. data/rbi/x_twitter_scraper/models/x/communities/join_delete_all_params.rbi +6 -0
  104. data/rbi/x_twitter_scraper/models/x/communities/join_delete_all_response.rbi +1154 -3
  105. data/rbi/x_twitter_scraper/models/x/community_create_params.rbi +6 -0
  106. data/rbi/x_twitter_scraper/models/x/community_create_response.rbi +1127 -5
  107. data/rbi/x_twitter_scraper/models/x/community_delete_params.rbi +6 -0
  108. data/rbi/x_twitter_scraper/models/x/community_delete_response.rbi +1148 -3
  109. data/rbi/x_twitter_scraper/models/x/dm_send_params.rbi +6 -0
  110. data/rbi/x_twitter_scraper/models/x/dm_send_response.rbi +1112 -6
  111. data/rbi/x_twitter_scraper/models/x/media_upload_params.rbi +6 -0
  112. data/rbi/x_twitter_scraper/models/x/media_upload_response.rbi +1124 -9
  113. data/rbi/x_twitter_scraper/models/x/profile_update_avatar_params.rbi +6 -0
  114. data/rbi/x_twitter_scraper/models/x/profile_update_avatar_response.rbi +1152 -3
  115. data/rbi/x_twitter_scraper/models/x/profile_update_banner_params.rbi +6 -0
  116. data/rbi/x_twitter_scraper/models/x/profile_update_banner_response.rbi +1152 -3
  117. data/rbi/x_twitter_scraper/models/x/profile_update_params.rbi +6 -0
  118. data/rbi/x_twitter_scraper/models/x/profile_update_response.rbi +1144 -3
  119. data/rbi/x_twitter_scraper/models/x/tweet_author.rbi +3 -13
  120. data/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi +5 -8
  121. data/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi +1108 -14
  122. data/rbi/x_twitter_scraper/models/x/tweet_delete_params.rbi +6 -0
  123. data/rbi/x_twitter_scraper/models/x/tweet_delete_response.rbi +1140 -3
  124. data/rbi/x_twitter_scraper/models/x/tweets/like_create_params.rbi +6 -0
  125. data/rbi/x_twitter_scraper/models/x/tweets/like_create_response.rbi +1154 -3
  126. data/rbi/x_twitter_scraper/models/x/tweets/like_delete_params.rbi +6 -0
  127. data/rbi/x_twitter_scraper/models/x/tweets/like_delete_response.rbi +1154 -3
  128. data/rbi/x_twitter_scraper/models/x/tweets/retweet_create_params.rbi +6 -0
  129. data/rbi/x_twitter_scraper/models/x/tweets/retweet_create_response.rbi +1154 -3
  130. data/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbi +6 -0
  131. data/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbi +1154 -3
  132. data/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi +6 -0
  133. data/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi +1152 -3
  134. data/rbi/x_twitter_scraper/models/x/user_retrieve_following_params.rbi +2 -2
  135. data/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +2 -2
  136. data/rbi/x_twitter_scraper/models/x/users/follow_create_params.rbi +6 -0
  137. data/rbi/x_twitter_scraper/models/x/users/follow_create_response.rbi +1154 -3
  138. data/rbi/x_twitter_scraper/models/x/users/follow_delete_all_params.rbi +6 -0
  139. data/rbi/x_twitter_scraper/models/x/users/follow_delete_all_response.rbi +1154 -3
  140. data/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi +930 -66
  141. data/rbi/x_twitter_scraper/models/x/x_account.rbi +9 -9
  142. data/rbi/x_twitter_scraper/models/x/x_account_detail.rbi +1 -1
  143. data/rbi/x_twitter_scraper/resources/compose.rbi +12 -38
  144. data/rbi/x_twitter_scraper/resources/credits.rbi +1 -1
  145. data/rbi/x_twitter_scraper/resources/extractions.rbi +4 -4
  146. data/rbi/x_twitter_scraper/resources/guest_wallets.rbi +2 -2
  147. data/rbi/x_twitter_scraper/resources/monitors/keywords.rbi +4 -5
  148. data/rbi/x_twitter_scraper/resources/monitors.rbi +3 -3
  149. data/rbi/x_twitter_scraper/resources/support/tickets.rbi +17 -2
  150. data/rbi/x_twitter_scraper/resources/trends.rbi +1 -1
  151. data/rbi/x_twitter_scraper/resources/x/communities/join.rbi +16 -4
  152. data/rbi/x_twitter_scraper/resources/x/communities.rbi +19 -7
  153. data/rbi/x_twitter_scraper/resources/x/dm.rbi +10 -3
  154. data/rbi/x_twitter_scraper/resources/x/media.rbi +9 -4
  155. data/rbi/x_twitter_scraper/resources/x/profile.rbi +27 -8
  156. data/rbi/x_twitter_scraper/resources/x/tweets/like.rbi +16 -4
  157. data/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi +16 -4
  158. data/rbi/x_twitter_scraper/resources/x/tweets.rbi +31 -12
  159. data/rbi/x_twitter_scraper/resources/x/users/follow.rbi +16 -4
  160. data/rbi/x_twitter_scraper/resources/x/users.rbi +13 -7
  161. data/rbi/x_twitter_scraper/resources/x.rbi +1 -2
  162. data/sig/x_twitter_scraper/models/compose_create_params.rbs +150 -90
  163. data/sig/x_twitter_scraper/models/compose_create_response.rbs +249 -27
  164. data/sig/x_twitter_scraper/models/error.rbs +170 -7
  165. data/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs +35 -5
  166. data/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs +35 -5
  167. data/sig/x_twitter_scraper/models/support/ticket_create_params.rbs +7 -1
  168. data/sig/x_twitter_scraper/models/support/ticket_create_response.rbs +49 -5
  169. data/sig/x_twitter_scraper/models/support/ticket_reply_params.rbs +7 -1
  170. data/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs +49 -5
  171. data/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +113 -2
  172. data/sig/x_twitter_scraper/models/x/communities/join_create_params.rbs +5 -1
  173. data/sig/x_twitter_scraper/models/x/communities/join_create_response.rbs +540 -4
  174. data/sig/x_twitter_scraper/models/x/communities/join_delete_all_params.rbs +5 -1
  175. data/sig/x_twitter_scraper/models/x/communities/join_delete_all_response.rbs +540 -4
  176. data/sig/x_twitter_scraper/models/x/community_create_params.rbs +10 -1
  177. data/sig/x_twitter_scraper/models/x/community_create_response.rbs +528 -7
  178. data/sig/x_twitter_scraper/models/x/community_delete_params.rbs +10 -1
  179. data/sig/x_twitter_scraper/models/x/community_delete_response.rbs +540 -4
  180. data/sig/x_twitter_scraper/models/x/dm_send_params.rbs +5 -0
  181. data/sig/x_twitter_scraper/models/x/dm_send_response.rbs +539 -5
  182. data/sig/x_twitter_scraper/models/x/media_upload_params.rbs +5 -1
  183. data/sig/x_twitter_scraper/models/x/media_upload_response.rbs +534 -7
  184. data/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs +5 -1
  185. data/sig/x_twitter_scraper/models/x/profile_update_avatar_response.rbs +540 -4
  186. data/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs +5 -1
  187. data/sig/x_twitter_scraper/models/x/profile_update_banner_response.rbs +540 -4
  188. data/sig/x_twitter_scraper/models/x/profile_update_params.rbs +5 -0
  189. data/sig/x_twitter_scraper/models/x/profile_update_response.rbs +540 -4
  190. data/sig/x_twitter_scraper/models/x/tweet_author.rbs +3 -11
  191. data/sig/x_twitter_scraper/models/x/tweet_create_params.rbs +4 -6
  192. data/sig/x_twitter_scraper/models/x/tweet_create_response.rbs +518 -11
  193. data/sig/x_twitter_scraper/models/x/tweet_delete_params.rbs +5 -1
  194. data/sig/x_twitter_scraper/models/x/tweet_delete_response.rbs +540 -4
  195. data/sig/x_twitter_scraper/models/x/tweets/like_create_params.rbs +5 -1
  196. data/sig/x_twitter_scraper/models/x/tweets/like_create_response.rbs +540 -4
  197. data/sig/x_twitter_scraper/models/x/tweets/like_delete_params.rbs +5 -1
  198. data/sig/x_twitter_scraper/models/x/tweets/like_delete_response.rbs +540 -4
  199. data/sig/x_twitter_scraper/models/x/tweets/retweet_create_params.rbs +5 -1
  200. data/sig/x_twitter_scraper/models/x/tweets/retweet_create_response.rbs +540 -4
  201. data/sig/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbs +5 -1
  202. data/sig/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbs +540 -4
  203. data/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs +5 -1
  204. data/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs +540 -4
  205. data/sig/x_twitter_scraper/models/x/users/follow_create_params.rbs +5 -1
  206. data/sig/x_twitter_scraper/models/x/users/follow_create_response.rbs +540 -4
  207. data/sig/x_twitter_scraper/models/x/users/follow_delete_all_params.rbs +5 -1
  208. data/sig/x_twitter_scraper/models/x/users/follow_delete_all_response.rbs +540 -4
  209. data/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs +428 -54
  210. data/sig/x_twitter_scraper/resources/compose.rbs +2 -12
  211. data/sig/x_twitter_scraper/resources/support/tickets.rbs +2 -0
  212. data/sig/x_twitter_scraper/resources/x/communities/join.rbs +2 -0
  213. data/sig/x_twitter_scraper/resources/x/communities.rbs +2 -0
  214. data/sig/x_twitter_scraper/resources/x/dm.rbs +1 -0
  215. data/sig/x_twitter_scraper/resources/x/media.rbs +1 -0
  216. data/sig/x_twitter_scraper/resources/x/profile.rbs +3 -0
  217. data/sig/x_twitter_scraper/resources/x/tweets/like.rbs +2 -0
  218. data/sig/x_twitter_scraper/resources/x/tweets/retweet.rbs +2 -0
  219. data/sig/x_twitter_scraper/resources/x/tweets.rbs +2 -1
  220. data/sig/x_twitter_scraper/resources/x/users/follow.rbs +2 -0
  221. data/sig/x_twitter_scraper/resources/x/users.rbs +1 -0
  222. metadata +17 -26
@@ -16,7 +16,7 @@ module XTwitterScraper
16
16
  sig do
17
17
  params(
18
18
  account: String,
19
- attachment_url: String,
19
+ idempotency_key: String,
20
20
  community_id: String,
21
21
  is_note_tweet: T::Boolean,
22
22
  media: T::Array[String],
@@ -26,23 +26,30 @@ module XTwitterScraper
26
26
  ).returns(XTwitterScraper::Models::X::TweetCreateResponse)
27
27
  end
28
28
  def create(
29
- # X account (@username or account ID)
29
+ # Body param: X account (@username or account ID)
30
30
  account:,
31
- attachment_url: nil,
31
+ # Header param: Generate one unique value for each intended write. Reuse it only
32
+ # when retrying the exact same account, action, target, and payload. A reused key
33
+ # returns the original action. Reusing it with different input returns 409. Replay
34
+ # protection remains active for at least 90 days.
35
+ idempotency_key:,
36
+ # Body param
32
37
  community_id: nil,
38
+ # Body param
33
39
  is_note_tweet: nil,
34
- # Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4
35
- # video up to 100 MB. Each URL must be publicly reachable. Attached media adds 2
36
- # credits per started MB across all files.
40
+ # Body param: Array of public media URLs to attach. Supports up to 4 images or
41
+ # exactly 1 MP4 video up to 100 MB. Each URL must be publicly reachable. Attached
42
+ # media adds 2 credits per started MB across all files.
37
43
  media: nil,
44
+ # Body param
38
45
  reply_to_tweet_id: nil,
39
- # Tweet text (optional when media is provided)
46
+ # Body param: Tweet text (optional when media is provided)
40
47
  text: nil,
41
48
  request_options: {}
42
49
  )
43
50
  end
44
51
 
45
- # Get tweet with full text, author, metrics and media
52
+ # Get tweet with full text, author, metrics & media
46
53
  sig do
47
54
  params(
48
55
  id: String,
@@ -75,19 +82,27 @@ module XTwitterScraper
75
82
  params(
76
83
  id: String,
77
84
  account: String,
85
+ idempotency_key: String,
78
86
  request_options: XTwitterScraper::RequestOptions::OrHash
79
87
  ).returns(XTwitterScraper::Models::X::TweetDeleteResponse)
80
88
  end
81
89
  def delete(
82
- # Tweet ID to delete
90
+ # Path param: Tweet ID to delete
83
91
  id,
84
- # X account identifier (@username or account ID)
92
+ # Body param: X account identifier (@username or account ID)
85
93
  account:,
94
+ # Header param: Generate one unique value for each intended write. Reuse it only
95
+ # when retrying the exact same account, action, target, and payload. A reused key
96
+ # returns the original action. Reusing it with different input returns 409. Replay
97
+ # protection remains active for at least 90 days.
98
+ idempotency_key:,
86
99
  request_options: {}
87
100
  )
88
101
  end
89
102
 
90
- # List users who liked a tweet
103
+ # Returns liker profiles that X makes visible for the post. X can withhold liker
104
+ # identities even when the post reports likes. In that case this endpoint returns
105
+ # 424 `favoriters_unavailable` instead of a misleading empty success.
91
106
  sig do
92
107
  params(
93
108
  id: String,
@@ -222,7 +237,11 @@ module XTwitterScraper
222
237
  )
223
238
  end
224
239
 
225
- # List replies to a tweet
240
+ # Returns visible replies. For an unfiltered first page, Xquik compares a terminal
241
+ # page with the post's reported reply count. If the page is visibly incomplete,
242
+ # the endpoint returns 424 `replies_incomplete` instead of presenting partial
243
+ # coverage as complete. Use tweet search with a `conversation_id:{id}` query as
244
+ # the broader fallback.
226
245
  sig do
227
246
  params(
228
247
  id: String,
@@ -11,14 +11,20 @@ module XTwitterScraper
11
11
  params(
12
12
  id: String,
13
13
  account: String,
14
+ idempotency_key: String,
14
15
  request_options: XTwitterScraper::RequestOptions::OrHash
15
16
  ).returns(XTwitterScraper::Models::X::Users::FollowCreateResponse)
16
17
  end
17
18
  def create(
18
- # User ID to follow
19
+ # Path param: User ID to follow
19
20
  id,
20
- # X account identifier (@username or account ID)
21
+ # Body param: X account identifier (@username or account ID)
21
22
  account:,
23
+ # Header param: Generate one unique value for each intended write. Reuse it only
24
+ # when retrying the exact same account, action, target, and payload. A reused key
25
+ # returns the original action. Reusing it with different input returns 409. Replay
26
+ # protection remains active for at least 90 days.
27
+ idempotency_key:,
22
28
  request_options: {}
23
29
  )
24
30
  end
@@ -28,16 +34,22 @@ module XTwitterScraper
28
34
  params(
29
35
  id: String,
30
36
  account: String,
37
+ idempotency_key: String,
31
38
  request_options: XTwitterScraper::RequestOptions::OrHash
32
39
  ).returns(
33
40
  XTwitterScraper::Models::X::Users::FollowDeleteAllResponse
34
41
  )
35
42
  end
36
43
  def delete_all(
37
- # User ID to unfollow
44
+ # Path param: User ID to unfollow
38
45
  id,
39
- # X account identifier (@username or account ID)
46
+ # Body param: X account identifier (@username or account ID)
40
47
  account:,
48
+ # Header param: Generate one unique value for each intended write. Reuse it only
49
+ # when retrying the exact same account, action, target, and payload. A reused key
50
+ # returns the original action. Reusing it with different input returns 409. Replay
51
+ # protection remains active for at least 90 days.
52
+ idempotency_key:,
41
53
  request_options: {}
42
54
  )
43
55
  end
@@ -8,7 +8,7 @@ module XTwitterScraper
8
8
  sig { returns(XTwitterScraper::Resources::X::Users::Follow) }
9
9
  attr_reader :follow
10
10
 
11
- # Get user profile with follower counts and verification
11
+ # Get user profile with follower counts & verification
12
12
  sig do
13
13
  params(
14
14
  id: String,
@@ -27,14 +27,20 @@ module XTwitterScraper
27
27
  params(
28
28
  id: String,
29
29
  account: String,
30
+ idempotency_key: String,
30
31
  request_options: XTwitterScraper::RequestOptions::OrHash
31
32
  ).returns(XTwitterScraper::Models::X::UserRemoveFollowerResponse)
32
33
  end
33
34
  def remove_follower(
34
- # User ID to remove from your followers
35
+ # Path param: User ID to remove from your followers
35
36
  id,
36
- # X account identifier (@username or account ID)
37
+ # Body param: X account identifier (@username or account ID)
37
38
  account:,
39
+ # Header param: Generate one unique value for each intended write. Reuse it only
40
+ # when retrying the exact same account, action, target, and payload. A reused key
41
+ # returns the original action. Reusing it with different input returns 409. Replay
42
+ # protection remains active for at least 90 days.
43
+ idempotency_key:,
38
44
  request_options: {}
39
45
  )
40
46
  end
@@ -66,7 +72,7 @@ module XTwitterScraper
66
72
  ).returns(XTwitterScraper::PaginatedUsers)
67
73
  end
68
74
  def retrieve_followers(
69
- # User ID or username
75
+ # Target user ID or username for follower lookup.
70
76
  id,
71
77
  # Legacy cursor alias. Prefer cursor.
72
78
  after: nil,
@@ -120,7 +126,7 @@ module XTwitterScraper
120
126
  def retrieve_following(
121
127
  # User ID or username for following lookup
122
128
  id,
123
- # Legacy cursor alias. Prefer cursor.
129
+ # Deprecated following cursor alias. Prefer cursor.
124
130
  after: nil,
125
131
  # Pagination cursor for following list
126
132
  cursor: nil,
@@ -493,7 +499,7 @@ module XTwitterScraper
493
499
  ).returns(XTwitterScraper::PaginatedTweets)
494
500
  end
495
501
  def retrieve_replies(
496
- # X user ID or username
502
+ # Target user ID or username for the replies timeline.
497
503
  id,
498
504
  # Words or quoted phrases where any one can match. Separate with spaces, commas,
499
505
  # or lines.
@@ -512,7 +518,7 @@ module XTwitterScraper
512
518
  from_user: nil,
513
519
  # Hashtags separated by spaces, commas, or lines.
514
520
  hashtags: nil,
515
- # Include parent tweet for replies
521
+ # Include each reply's parent tweet.
516
522
  include_parent_tweet: nil,
517
523
  # Only replies to this tweet ID.
518
524
  in_reply_to_tweet_id: nil,
@@ -20,7 +20,6 @@ module XTwitterScraper
20
20
  sig { returns(XTwitterScraper::Resources::X::Dm) }
21
21
  attr_reader :dm
22
22
 
23
- # Media upload and download
24
23
  sig { returns(XTwitterScraper::Resources::X::Media) }
25
24
  attr_reader :media
26
25
 
@@ -99,7 +98,7 @@ module XTwitterScraper
99
98
  )
100
99
  end
101
100
 
102
- # Get trending hashtags and topics from X by region
101
+ # Get trending hashtags & topics from X by region
103
102
  sig do
104
103
  params(
105
104
  count: Integer,
@@ -1,136 +1,196 @@
1
1
  module XTwitterScraper
2
2
  module Models
3
3
  type compose_create_params =
4
- {
5
- step: XTwitterScraper::Models::ComposeCreateParams::step,
6
- additional_context: String,
7
- call_to_action: String,
8
- draft: String,
9
- goal: XTwitterScraper::Models::ComposeCreateParams::goal,
10
- has_link: bool,
11
- has_media: bool,
12
- media_type: XTwitterScraper::Models::ComposeCreateParams::media_type,
13
- style_username: String,
14
- tone: String,
15
- topic: String
16
- }
4
+ { body: XTwitterScraper::Models::ComposeCreateParams::body }
17
5
  & XTwitterScraper::Internal::Type::request_parameters
18
6
 
19
7
  class ComposeCreateParams < XTwitterScraper::Internal::Type::BaseModel
20
8
  extend XTwitterScraper::Internal::Type::RequestParameters::Converter
21
9
  include XTwitterScraper::Internal::Type::RequestParameters
22
10
 
23
- attr_accessor step: XTwitterScraper::Models::ComposeCreateParams::step
11
+ attr_accessor body: XTwitterScraper::Models::ComposeCreateParams::body
24
12
 
25
- attr_reader additional_context: String?
13
+ def initialize: (
14
+ body: XTwitterScraper::Models::ComposeCreateParams::body,
15
+ ?request_options: XTwitterScraper::request_opts
16
+ ) -> void
26
17
 
27
- def additional_context=: (String) -> String
18
+ def to_hash: -> {
19
+ body: XTwitterScraper::Models::ComposeCreateParams::body,
20
+ request_options: XTwitterScraper::RequestOptions
21
+ }
28
22
 
29
- attr_reader call_to_action: String?
23
+ type body =
24
+ XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest
25
+ | XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest
26
+ | XTwitterScraper::ComposeCreateParams::Body::ComposeScoreRequest
30
27
 
31
- def call_to_action=: (String) -> String
28
+ module Body
29
+ extend XTwitterScraper::Internal::Type::Union
32
30
 
33
- attr_reader draft: String?
31
+ type compose_prepare_request =
32
+ {
33
+ step: :compose,
34
+ topic: String,
35
+ goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal,
36
+ style_username: String
37
+ }
34
38
 
35
- def draft=: (String) -> String
39
+ class ComposePrepareRequest < XTwitterScraper::Internal::Type::BaseModel
40
+ attr_accessor step: :compose
36
41
 
37
- attr_reader goal: XTwitterScraper::Models::ComposeCreateParams::goal?
42
+ attr_accessor topic: String
38
43
 
39
- def goal=: (
40
- XTwitterScraper::Models::ComposeCreateParams::goal
41
- ) -> XTwitterScraper::Models::ComposeCreateParams::goal
44
+ attr_reader goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal?
42
45
 
43
- attr_reader has_link: bool?
46
+ def goal=: (
47
+ XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal
48
+ ) -> XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal
44
49
 
45
- def has_link=: (bool) -> bool
50
+ attr_reader style_username: String?
46
51
 
47
- attr_reader has_media: bool?
52
+ def style_username=: (String) -> String
48
53
 
49
- def has_media=: (bool) -> bool
54
+ def initialize: (
55
+ topic: String,
56
+ ?goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal,
57
+ ?style_username: String,
58
+ ?step: :compose
59
+ ) -> void
50
60
 
51
- attr_reader media_type: XTwitterScraper::Models::ComposeCreateParams::media_type?
61
+ def to_hash: -> {
62
+ step: :compose,
63
+ topic: String,
64
+ goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal,
65
+ style_username: String
66
+ }
52
67
 
53
- def media_type=: (
54
- XTwitterScraper::Models::ComposeCreateParams::media_type
55
- ) -> XTwitterScraper::Models::ComposeCreateParams::media_type
68
+ type goal = :engagement | :followers | :authority | :conversation
56
69
 
57
- attr_reader style_username: String?
70
+ module Goal
71
+ extend XTwitterScraper::Internal::Type::Enum
58
72
 
59
- def style_username=: (String) -> String
73
+ ENGAGEMENT: :engagement
74
+ FOLLOWERS: :followers
75
+ AUTHORITY: :authority
76
+ CONVERSATION: :conversation
60
77
 
61
- attr_reader tone: String?
78
+ def self?.values: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal]
79
+ end
80
+ end
62
81
 
63
- def tone=: (String) -> String
82
+ type compose_refine_request =
83
+ {
84
+ goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal,
85
+ step: :refine,
86
+ tone: String,
87
+ topic: String,
88
+ additional_context: String,
89
+ call_to_action: String,
90
+ media_type: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type
91
+ }
64
92
 
65
- attr_reader topic: String?
93
+ class ComposeRefineRequest < XTwitterScraper::Internal::Type::BaseModel
94
+ attr_accessor goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal
66
95
 
67
- def topic=: (String) -> String
96
+ attr_accessor step: :refine
68
97
 
69
- def initialize: (
70
- step: XTwitterScraper::Models::ComposeCreateParams::step,
71
- ?additional_context: String,
72
- ?call_to_action: String,
73
- ?draft: String,
74
- ?goal: XTwitterScraper::Models::ComposeCreateParams::goal,
75
- ?has_link: bool,
76
- ?has_media: bool,
77
- ?media_type: XTwitterScraper::Models::ComposeCreateParams::media_type,
78
- ?style_username: String,
79
- ?tone: String,
80
- ?topic: String,
81
- ?request_options: XTwitterScraper::request_opts
82
- ) -> void
98
+ attr_accessor tone: String
83
99
 
84
- def to_hash: -> {
85
- step: XTwitterScraper::Models::ComposeCreateParams::step,
86
- additional_context: String,
87
- call_to_action: String,
88
- draft: String,
89
- goal: XTwitterScraper::Models::ComposeCreateParams::goal,
90
- has_link: bool,
91
- has_media: bool,
92
- media_type: XTwitterScraper::Models::ComposeCreateParams::media_type,
93
- style_username: String,
94
- tone: String,
95
- topic: String,
96
- request_options: XTwitterScraper::RequestOptions
97
- }
100
+ attr_accessor topic: String
98
101
 
99
- type step = :compose | :refine | :score
102
+ attr_reader additional_context: String?
100
103
 
101
- module Step
102
- extend XTwitterScraper::Internal::Type::Enum
104
+ def additional_context=: (String) -> String
103
105
 
104
- COMPOSE: :compose
105
- REFINE: :refine
106
- SCORE: :score
106
+ attr_reader call_to_action: String?
107
107
 
108
- def self?.values: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::step]
109
- end
108
+ def call_to_action=: (String) -> String
110
109
 
111
- type goal = :engagement | :followers | :authority | :conversation
110
+ attr_reader media_type: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type?
112
111
 
113
- module Goal
114
- extend XTwitterScraper::Internal::Type::Enum
112
+ def media_type=: (
113
+ XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type
114
+ ) -> XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type
115
115
 
116
- ENGAGEMENT: :engagement
117
- FOLLOWERS: :followers
118
- AUTHORITY: :authority
119
- CONVERSATION: :conversation
116
+ def initialize: (
117
+ goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal,
118
+ tone: String,
119
+ topic: String,
120
+ ?additional_context: String,
121
+ ?call_to_action: String,
122
+ ?media_type: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type,
123
+ ?step: :refine
124
+ ) -> void
120
125
 
121
- def self?.values: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::goal]
122
- end
126
+ def to_hash: -> {
127
+ goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal,
128
+ step: :refine,
129
+ tone: String,
130
+ topic: String,
131
+ additional_context: String,
132
+ call_to_action: String,
133
+ media_type: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type
134
+ }
135
+
136
+ type goal = :engagement | :followers | :authority | :conversation
137
+
138
+ module Goal
139
+ extend XTwitterScraper::Internal::Type::Enum
140
+
141
+ ENGAGEMENT: :engagement
142
+ FOLLOWERS: :followers
143
+ AUTHORITY: :authority
144
+ CONVERSATION: :conversation
145
+
146
+ def self?.values: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal]
147
+ end
148
+
149
+ type media_type = :photo | :video | :none
150
+
151
+ module MediaType
152
+ extend XTwitterScraper::Internal::Type::Enum
153
+
154
+ PHOTO: :photo
155
+ VIDEO: :video
156
+ NONE: :none
157
+
158
+ def self?.values: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type]
159
+ end
160
+ end
161
+
162
+ type compose_score_request =
163
+ { draft: String, step: :score, has_link: bool, has_media: bool }
164
+
165
+ class ComposeScoreRequest < XTwitterScraper::Internal::Type::BaseModel
166
+ attr_accessor draft: String
167
+
168
+ attr_accessor step: :score
169
+
170
+ attr_reader has_link: bool?
171
+
172
+ def has_link=: (bool) -> bool
173
+
174
+ attr_reader has_media: bool?
123
175
 
124
- type media_type = :photo | :video | :none
176
+ def has_media=: (bool) -> bool
125
177
 
126
- module MediaType
127
- extend XTwitterScraper::Internal::Type::Enum
178
+ def initialize: (
179
+ draft: String,
180
+ ?has_link: bool,
181
+ ?has_media: bool,
182
+ ?step: :score
183
+ ) -> void
128
184
 
129
- PHOTO: :photo
130
- VIDEO: :video
131
- NONE: :none
185
+ def to_hash: -> {
186
+ draft: String,
187
+ step: :score,
188
+ has_link: bool,
189
+ has_media: bool
190
+ }
191
+ end
132
192
 
133
- def self?.values: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::media_type]
193
+ def self?.variants: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::body]
134
194
  end
135
195
  end
136
196
  end