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
@@ -20,10 +20,10 @@ module XTwitterScraper
20
20
  sig { returns(Time) }
21
21
  attr_accessor :created_at
22
22
 
23
- # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user
24
- # must submit fresh credentials. `locked` = X locked the account; unlock on x.com
23
+ # Derived connection health. `healthy` = session active. `needsReauth` = user must
24
+ # submit fresh credentials. `locked` = X locked the account; unlock on x.com
25
25
  # first. `suspended` = X banned the account. `recovering` = past cooldown, will
26
- # auto-retry on next use. `temporaryIssue` = transient backend problem; retry
26
+ # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry
27
27
  # shortly.
28
28
  sig { returns(XTwitterScraper::X::XAccount::Health::TaggedSymbol) }
29
29
  attr_accessor :health
@@ -62,10 +62,10 @@ module XTwitterScraper
62
62
  def self.new(
63
63
  id:,
64
64
  created_at:,
65
- # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user
66
- # must submit fresh credentials. `locked` = X locked the account; unlock on x.com
65
+ # Derived connection health. `healthy` = session active. `needsReauth` = user must
66
+ # submit fresh credentials. `locked` = X locked the account; unlock on x.com
67
67
  # first. `suspended` = X banned the account. `recovering` = past cooldown, will
68
- # auto-retry on next use. `temporaryIssue` = transient backend problem; retry
68
+ # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry
69
69
  # shortly.
70
70
  health:,
71
71
  status:,
@@ -93,10 +93,10 @@ module XTwitterScraper
93
93
  def to_hash
94
94
  end
95
95
 
96
- # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user
97
- # must submit fresh credentials. `locked` = X locked the account; unlock on x.com
96
+ # Derived connection health. `healthy` = session active. `needsReauth` = user must
97
+ # submit fresh credentials. `locked` = X locked the account; unlock on x.com
98
98
  # first. `suspended` = X banned the account. `recovering` = past cooldown, will
99
- # auto-retry on next use. `temporaryIssue` = transient backend problem; retry
99
+ # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry
100
100
  # shortly.
101
101
  module Health
102
102
  extend XTwitterScraper::Internal::Type::Enum
@@ -46,7 +46,7 @@ module XTwitterScraper
46
46
  sig { params(updated_at: Time).void }
47
47
  attr_writer :updated_at
48
48
 
49
- # Full X account details with status, cookies, and update timestamp.
49
+ # Connected X account details with health and timestamp metadata.
50
50
  sig do
51
51
  params(
52
52
  id: String,
@@ -4,48 +4,22 @@ module XTwitterScraper
4
4
  module Resources
5
5
  # AI tweet composition, drafts, writing styles, and radar
6
6
  class Compose
7
- # Compose, refine, or score a tweet
7
+ # Run one step of Xquik's three-step writing workflow. Compose returns questions
8
+ # and editorial rules. Refine returns goal-specific guidance. Score applies
9
+ # deterministic text checks. It does not predict reach or expose X ranking
10
+ # weights.
8
11
  sig do
9
12
  params(
10
- step: XTwitterScraper::ComposeCreateParams::Step::OrSymbol,
11
- additional_context: String,
12
- call_to_action: String,
13
- draft: String,
14
- goal: XTwitterScraper::ComposeCreateParams::Goal::OrSymbol,
15
- has_link: T::Boolean,
16
- has_media: T::Boolean,
17
- media_type: XTwitterScraper::ComposeCreateParams::MediaType::OrSymbol,
18
- style_username: String,
19
- tone: String,
20
- topic: String,
13
+ body:
14
+ T.any(
15
+ XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::OrHash,
16
+ XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::OrHash,
17
+ XTwitterScraper::ComposeCreateParams::Body::ComposeScoreRequest::OrHash
18
+ ),
21
19
  request_options: XTwitterScraper::RequestOptions::OrHash
22
- ).returns(XTwitterScraper::Models::ComposeCreateResponse)
20
+ ).returns(XTwitterScraper::Models::ComposeCreateResponse::Variants)
23
21
  end
24
- def create(
25
- # Workflow step
26
- step:,
27
- # Extra context or URLs (refine)
28
- additional_context: nil,
29
- # Desired call to action (refine)
30
- call_to_action: nil,
31
- # Tweet draft text to evaluate (score)
32
- draft: nil,
33
- # Optimization goal
34
- goal: nil,
35
- # Whether a link is attached (score)
36
- has_link: nil,
37
- # Whether media is attached (score)
38
- has_media: nil,
39
- # Media type (refine)
40
- media_type: nil,
41
- # Cached style username for voice matching (compose)
42
- style_username: nil,
43
- # Desired tone (refine)
44
- tone: nil,
45
- # Tweet topic (compose, refine)
46
- topic: nil,
47
- request_options: {}
48
- )
22
+ def create(body:, request_options: {})
49
23
  end
50
24
 
51
25
  # @api private
@@ -35,7 +35,7 @@ module XTwitterScraper
35
35
  ).returns(XTwitterScraper::Models::CreditRetrieveTopupStatusResponse)
36
36
  end
37
37
  def retrieve_topup_status(
38
- # Billing session ID returned by the top-up billing flow.
38
+ # Top-up session ID to inspect.
39
39
  session_id:,
40
40
  request_options: {}
41
41
  )
@@ -162,16 +162,16 @@ module XTwitterScraper
162
162
  retweets: nil,
163
163
  # Estimate only retweets of this tweet ID (tweet_search_extractor)
164
164
  retweets_of_tweet_id: nil,
165
- # Required for tweet_search_extractor & community_search.
165
+ # Query used to price tweet_search_extractor or community_search.
166
166
  search_query: nil,
167
167
  # Estimate start date in YYYY-MM-DD format (tweet_search_extractor)
168
168
  since_date: nil,
169
- # Required for community_post_extractor & community_search.
169
+ # Community ID used to price community_post_extractor or community_search.
170
170
  target_community_id: nil,
171
- # Required for list_follower_explorer, list_member_extractor &
171
+ # List ID used to price list_follower_explorer, list_member_extractor, or
172
172
  # list_post_extractor.
173
173
  target_list_id: nil,
174
- # Required for space_explorer.
174
+ # Space ID used to price space_explorer.
175
175
  target_space_id: nil,
176
176
  target_tweet_id: nil,
177
177
  target_username: nil,
@@ -18,7 +18,7 @@ module XTwitterScraper
18
18
  ).returns(XTwitterScraper::Models::GuestWalletCreateResponse)
19
19
  end
20
20
  def create(
21
- # Body param: Confirmed USD amount in cents.
21
+ # Body param: USD cents accepted for this checkout.
22
22
  amount_minor:,
23
23
  # Header param: Generate a cryptographically random UUID v4. Reuse it only to
24
24
  # retry the same wallet and amount request. Initial wallet creation can recover
@@ -55,7 +55,7 @@ module XTwitterScraper
55
55
  ).returns(XTwitterScraper::Models::GuestWalletTopupResponse)
56
56
  end
57
57
  def topup(
58
- # Body param: Confirmed USD amount in cents.
58
+ # Body param: USD cents accepted for this checkout.
59
59
  amount_minor:,
60
60
  # Header param: Generate a cryptographically random UUID v4. Reuse it only to
61
61
  # retry the same wallet and amount request. Initial wallet creation can recover
@@ -3,12 +3,11 @@
3
3
  module XTwitterScraper
4
4
  module Resources
5
5
  class Monitors
6
- # Real-time X account monitoring
6
+ # X account monitoring with 1-second checks
7
7
  class Keywords
8
- # Creates an instant keyword monitor. Keyword monitors are unlimited. Active
9
- # monitors check every 1 second and cost 21 credits per hour. Events and webhook
10
- # deliveries are included. Creation requires available credits for the first
11
- # hourly charge.
8
+ # Creates a keyword monitor. Keyword monitors are unlimited. Active monitors check
9
+ # every 1 second and cost 21 credits per hour. Events and webhook deliveries are
10
+ # included. Creation requires available credits for the first hourly charge.
12
11
  sig do
13
12
  params(
14
13
  event_types: T::Array[XTwitterScraper::EventType::OrSymbol],
@@ -2,13 +2,13 @@
2
2
 
3
3
  module XTwitterScraper
4
4
  module Resources
5
- # Real-time X account monitoring
5
+ # X account monitoring with 1-second checks
6
6
  class Monitors
7
- # Real-time X account monitoring
7
+ # X account monitoring with 1-second checks
8
8
  sig { returns(XTwitterScraper::Resources::Monitors::Keywords) }
9
9
  attr_reader :keywords
10
10
 
11
- # Creates an instant monitor. Monitors are unlimited. Active monitors check every
11
+ # Creates an account monitor. Monitors are unlimited. Active monitors check every
12
12
  # 1 second and cost 21 credits per hour. Events and webhook deliveries are
13
13
  # included. Creation requires available credits for the first hourly charge and
14
14
  # username lookup.
@@ -10,10 +10,20 @@ module XTwitterScraper
10
10
  params(
11
11
  body: String,
12
12
  subject: String,
13
+ idempotency_key: String,
13
14
  request_options: XTwitterScraper::RequestOptions::OrHash
14
15
  ).returns(XTwitterScraper::Models::Support::TicketCreateResponse)
15
16
  end
16
- def create(body:, subject:, request_options: {})
17
+ def create(
18
+ # Body param
19
+ body:,
20
+ # Body param
21
+ subject:,
22
+ # Header param: Generate one random value per ticket or reply. Reuse it only when
23
+ # retrying identical text and attachments. Never log this value.
24
+ idempotency_key: nil,
25
+ request_options: {}
26
+ )
17
27
  end
18
28
 
19
29
  # Get ticket with all messages
@@ -61,13 +71,18 @@ module XTwitterScraper
61
71
  params(
62
72
  id: String,
63
73
  body: String,
74
+ idempotency_key: String,
64
75
  request_options: XTwitterScraper::RequestOptions::OrHash
65
76
  ).returns(XTwitterScraper::Models::Support::TicketReplyResponse)
66
77
  end
67
78
  def reply(
68
- # Support ticket public ID for the reply
79
+ # Path param: Support ticket public ID for the reply
69
80
  id,
81
+ # Body param
70
82
  body:,
83
+ # Header param: Generate one random value per ticket or reply. Reuse it only when
84
+ # retrying identical text and attachments. Never log this value.
85
+ idempotency_key: nil,
71
86
  request_options: {}
72
87
  )
73
88
  end
@@ -4,7 +4,7 @@ module XTwitterScraper
4
4
  module Resources
5
5
  # Trending topics and hashtags by region
6
6
  class Trends
7
- # Get trending hashtags and topics by region (alias)
7
+ # Get trending hashtags & topics by region (alias)
8
8
  sig do
9
9
  params(
10
10
  count: Integer,
@@ -11,16 +11,22 @@ 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(
16
17
  XTwitterScraper::Models::X::Communities::JoinCreateResponse
17
18
  )
18
19
  end
19
20
  def create(
20
- # Resource ID returned by the matching create or list endpoint.
21
+ # Path param: Resource ID returned by the matching create or list endpoint.
21
22
  id,
22
- # X account identifier (@username or account ID)
23
+ # Body param: X account identifier (@username or account ID)
23
24
  account:,
25
+ # Header param: Generate one unique value for each intended write. Reuse it only
26
+ # when retrying the exact same account, action, target, and payload. A reused key
27
+ # returns the original action. Reusing it with different input returns 409. Replay
28
+ # protection remains active for at least 90 days.
29
+ idempotency_key:,
24
30
  request_options: {}
25
31
  )
26
32
  end
@@ -30,16 +36,22 @@ module XTwitterScraper
30
36
  params(
31
37
  id: String,
32
38
  account: String,
39
+ idempotency_key: String,
33
40
  request_options: XTwitterScraper::RequestOptions::OrHash
34
41
  ).returns(
35
42
  XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse
36
43
  )
37
44
  end
38
45
  def delete_all(
39
- # Resource ID returned by the matching create or list endpoint.
46
+ # Path param: Resource ID returned by the matching create or list endpoint.
40
47
  id,
41
- # X account identifier (@username or account ID)
48
+ # Body param: X account identifier (@username or account ID)
42
49
  account:,
50
+ # Header param: Generate one unique value for each intended write. Reuse it only
51
+ # when retrying the exact same account, action, target, and payload. A reused key
52
+ # returns the original action. Reusing it with different input returns 409. Replay
53
+ # protection remains active for at least 90 days.
54
+ idempotency_key:,
43
55
  request_options: {}
44
56
  )
45
57
  end
@@ -17,16 +17,22 @@ module XTwitterScraper
17
17
  params(
18
18
  account: String,
19
19
  name: String,
20
+ idempotency_key: String,
20
21
  description: String,
21
22
  request_options: XTwitterScraper::RequestOptions::OrHash
22
23
  ).returns(XTwitterScraper::Models::X::CommunityCreateResponse)
23
24
  end
24
25
  def create(
25
- # X account (@username or ID) creating the community
26
+ # Body param: X account (@username or ID) creating the community
26
27
  account:,
27
- # Community name
28
+ # Body param: Community name
28
29
  name:,
29
- # Community description
30
+ # Header param: Generate one unique value for each intended write. Reuse it only
31
+ # when retrying the exact same account, action, target, and payload. A reused key
32
+ # returns the original action. Reusing it with different input returns 409. Replay
33
+ # protection remains active for at least 90 days.
34
+ idempotency_key:,
35
+ # Body param: Community description
30
36
  description: nil,
31
37
  request_options: {}
32
38
  )
@@ -38,21 +44,27 @@ module XTwitterScraper
38
44
  id: String,
39
45
  account: String,
40
46
  community_name: String,
47
+ idempotency_key: String,
41
48
  request_options: XTwitterScraper::RequestOptions::OrHash
42
49
  ).returns(XTwitterScraper::Models::X::CommunityDeleteResponse)
43
50
  end
44
51
  def delete(
45
- # Resource ID returned by the matching create or list endpoint.
52
+ # Path param: Resource ID returned by the matching create or list endpoint.
46
53
  id,
47
- # X account (@username or ID) deleting the community
54
+ # Body param: X account (@username or ID) deleting the community
48
55
  account:,
49
- # Community name for confirmation
56
+ # Body param: Community name for confirmation
50
57
  community_name:,
58
+ # Header param: Generate one unique value for each intended write. Reuse it only
59
+ # when retrying the exact same account, action, target, and payload. A reused key
60
+ # returns the original action. Reusing it with different input returns 409. Replay
61
+ # protection remains active for at least 90 days.
62
+ idempotency_key:,
51
63
  request_options: {}
52
64
  )
53
65
  end
54
66
 
55
- # Get community name, description and member count
67
+ # Get community name, description & member count
56
68
  sig do
57
69
  params(
58
70
  id: String,
@@ -34,17 +34,24 @@ module XTwitterScraper
34
34
  user_id: String,
35
35
  account: String,
36
36
  text: String,
37
+ idempotency_key: String,
37
38
  media_ids: T::Array[String],
38
39
  request_options: XTwitterScraper::RequestOptions::OrHash
39
40
  ).returns(XTwitterScraper::Models::X::DmSendResponse)
40
41
  end
41
42
  def send_(
42
- # Recipient user ID
43
+ # Path param: Recipient user ID
43
44
  user_id,
44
- # X account (@username or ID) sending the DM
45
+ # Body param: X account (@username or ID) sending the DM
45
46
  account:,
47
+ # Body param
46
48
  text:,
47
- # Optional array containing exactly 1 uploaded media ID.
49
+ # Header param: Generate one unique value for each intended write. Reuse it only
50
+ # when retrying the exact same account, action, target, and payload. A reused key
51
+ # returns the original action. Reusing it with different input returns 409. Replay
52
+ # protection remains active for at least 90 days.
53
+ idempotency_key:,
54
+ # Body param: Optional array containing exactly 1 uploaded media ID.
48
55
  media_ids: nil,
49
56
  request_options: {}
50
57
  )
@@ -3,9 +3,8 @@
3
3
  module XTwitterScraper
4
4
  module Resources
5
5
  class X
6
- # Media upload and download
7
6
  class Media
8
- # Download images and videos from tweets
7
+ # Download images & videos from tweets
9
8
  sig do
10
9
  params(
11
10
  tweet_id: String,
@@ -33,14 +32,20 @@ module XTwitterScraper
33
32
  params(
34
33
  account: String,
35
34
  url: String,
35
+ idempotency_key: String,
36
36
  request_options: XTwitterScraper::RequestOptions::OrHash
37
37
  ).returns(XTwitterScraper::Models::X::MediaUploadResponse)
38
38
  end
39
39
  def upload(
40
- # X account (@username or ID) uploading media from URL
40
+ # Body param: X account (@username or ID) uploading media from URL
41
41
  account:,
42
- # HTTPS URL to download and upload as media
42
+ # Body param: HTTPS URL to download and upload as media
43
43
  url:,
44
+ # Header param: Generate one unique value for each intended write. Reuse it only
45
+ # when retrying the exact same account, action, target, and payload. A reused key
46
+ # returns the original action. Reusing it with different input returns 409. Replay
47
+ # protection remains active for at least 90 days.
48
+ idempotency_key:,
44
49
  request_options: {}
45
50
  )
46
51
  end
@@ -9,6 +9,7 @@ module XTwitterScraper
9
9
  sig do
10
10
  params(
11
11
  account: String,
12
+ idempotency_key: String,
12
13
  description: String,
13
14
  location: String,
14
15
  name: String,
@@ -17,14 +18,20 @@ module XTwitterScraper
17
18
  ).returns(XTwitterScraper::Models::X::ProfileUpdateResponse)
18
19
  end
19
20
  def update(
20
- # X account (@username or ID) to update profile
21
+ # Body param: X account (@username or ID) to update profile
21
22
  account:,
22
- # Bio description
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:,
28
+ # Body param: Bio description
23
29
  description: nil,
30
+ # Body param
24
31
  location: nil,
25
- # Display name
32
+ # Body param: Display name
26
33
  name: nil,
27
- # Website URL
34
+ # Body param: Website URL
28
35
  url: nil,
29
36
  request_options: {}
30
37
  )
@@ -35,14 +42,20 @@ module XTwitterScraper
35
42
  params(
36
43
  account: String,
37
44
  url: String,
45
+ idempotency_key: String,
38
46
  request_options: XTwitterScraper::RequestOptions::OrHash
39
47
  ).returns(XTwitterScraper::Models::X::ProfileUpdateAvatarResponse)
40
48
  end
41
49
  def update_avatar(
42
- # X account (@username or ID) receiving avatar from URL
50
+ # Body param: X account (@username or ID) receiving avatar from URL
43
51
  account:,
44
- # HTTPS URL to the avatar image to download
52
+ # Body param: HTTPS URL to the avatar image to download
45
53
  url:,
54
+ # Header param: Generate one unique value for each intended write. Reuse it only
55
+ # when retrying the exact same account, action, target, and payload. A reused key
56
+ # returns the original action. Reusing it with different input returns 409. Replay
57
+ # protection remains active for at least 90 days.
58
+ idempotency_key:,
46
59
  request_options: {}
47
60
  )
48
61
  end
@@ -52,14 +65,20 @@ module XTwitterScraper
52
65
  params(
53
66
  account: String,
54
67
  url: String,
68
+ idempotency_key: String,
55
69
  request_options: XTwitterScraper::RequestOptions::OrHash
56
70
  ).returns(XTwitterScraper::Models::X::ProfileUpdateBannerResponse)
57
71
  end
58
72
  def update_banner(
59
- # X account (@username or ID) receiving banner from URL
73
+ # Body param: X account (@username or ID) receiving banner from URL
60
74
  account:,
61
- # HTTPS URL to the banner image to download
75
+ # Body param: HTTPS URL to the banner image to download
62
76
  url:,
77
+ # Header param: Generate one unique value for each intended write. Reuse it only
78
+ # when retrying the exact same account, action, target, and payload. A reused key
79
+ # returns the original action. Reusing it with different input returns 409. Replay
80
+ # protection remains active for at least 90 days.
81
+ idempotency_key:,
63
82
  request_options: {}
64
83
  )
65
84
  end
@@ -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::Tweets::LikeCreateResponse)
16
17
  end
17
18
  def create(
18
- # Tweet ID to like
19
+ # Path param: Tweet ID to like
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,14 +34,20 @@ 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(XTwitterScraper::Models::X::Tweets::LikeDeleteResponse)
33
40
  end
34
41
  def delete(
35
- # Tweet ID to unlike
42
+ # Path param: Tweet ID to unlike
36
43
  id,
37
- # X account identifier (@username or account ID)
44
+ # Body param: X account identifier (@username or account ID)
38
45
  account:,
46
+ # Header param: Generate one unique value for each intended write. Reuse it only
47
+ # when retrying the exact same account, action, target, and payload. A reused key
48
+ # returns the original action. Reusing it with different input returns 409. Replay
49
+ # protection remains active for at least 90 days.
50
+ idempotency_key:,
39
51
  request_options: {}
40
52
  )
41
53
  end
@@ -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::Tweets::RetweetCreateResponse)
16
17
  end
17
18
  def create(
18
- # Tweet ID to retweet
19
+ # Path param: Tweet ID to retweet
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,14 +34,20 @@ 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(XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse)
33
40
  end
34
41
  def delete(
35
- # Tweet ID to unretweet
42
+ # Path param: Tweet ID to unretweet
36
43
  id,
37
- # X account identifier (@username or account ID)
44
+ # Body param: X account identifier (@username or account ID)
38
45
  account:,
46
+ # Header param: Generate one unique value for each intended write. Reuse it only
47
+ # when retrying the exact same account, action, target, and payload. A reused key
48
+ # returns the original action. Reusing it with different input returns 409. Replay
49
+ # protection remains active for at least 90 days.
50
+ idempotency_key:,
39
51
  request_options: {}
40
52
  )
41
53
  end