context.dev 2.21.0 → 2.22.0

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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +4 -9
  5. data/lib/context_dev/models/batch_cancel_params.rb +2 -2
  6. data/lib/context_dev/models/batch_cancel_response.rb +16 -21
  7. data/lib/context_dev/models/batch_delete_params.rb +2 -2
  8. data/lib/context_dev/models/batch_delete_response.rb +8 -8
  9. data/lib/context_dev/models/batch_get_results_params.rb +2 -2
  10. data/lib/context_dev/models/batch_get_results_response.rb +17 -22
  11. data/lib/context_dev/models/batch_list_response.rb +38 -47
  12. data/lib/context_dev/models/batch_retrieve_params.rb +2 -2
  13. data/lib/context_dev/models/batch_retrieve_response.rb +37 -46
  14. data/lib/context_dev/models/batch_submit_params.rb +80 -109
  15. data/lib/context_dev/models/batch_submit_response.rb +18 -28
  16. data/lib/context_dev/models/brand_retrieve_params.rb +90 -149
  17. data/lib/context_dev/models/brand_retrieve_response.rb +18 -22
  18. data/lib/context_dev/models/brand_search_params.rb +2 -3
  19. data/lib/context_dev/models/brand_search_response.rb +8 -8
  20. data/lib/context_dev/models/crawl_controls.rb +1 -2
  21. data/lib/context_dev/models/feedback_submit_params.rb +2 -2
  22. data/lib/context_dev/models/feedback_submit_response.rb +8 -8
  23. data/lib/context_dev/models/industry_retrieve_naics_params.rb +17 -32
  24. data/lib/context_dev/models/industry_retrieve_naics_response.rb +10 -10
  25. data/lib/context_dev/models/industry_retrieve_sic_params.rb +20 -39
  26. data/lib/context_dev/models/industry_retrieve_sic_response.rb +10 -10
  27. data/lib/context_dev/models/intake.rb +7 -13
  28. data/lib/context_dev/models/log_list_response.rb +14 -10
  29. data/lib/context_dev/models/log_retrieve_response.rb +15 -41
  30. data/lib/context_dev/models/monitor_create_params.rb +238 -72
  31. data/lib/context_dev/models/monitor_create_response.rb +364 -175
  32. data/lib/context_dev/models/monitor_delete_params.rb +3 -1
  33. data/lib/context_dev/models/monitor_delete_response.rb +44 -1
  34. data/lib/context_dev/models/monitor_get_credit_usage_response.rb +43 -1
  35. data/lib/context_dev/models/monitor_get_limits_response.rb +47 -7
  36. data/lib/context_dev/models/monitor_list_account_changes_response.rb +143 -20
  37. data/lib/context_dev/models/monitor_list_account_runs_response.rb +50 -8
  38. data/lib/context_dev/models/monitor_list_changes_params.rb +2 -1
  39. data/lib/context_dev/models/monitor_list_changes_response.rb +143 -20
  40. data/lib/context_dev/models/monitor_list_params.rb +3 -3
  41. data/lib/context_dev/models/monitor_list_response.rb +304 -106
  42. data/lib/context_dev/models/monitor_list_runs_params.rb +2 -1
  43. data/lib/context_dev/models/monitor_list_runs_response.rb +50 -8
  44. data/lib/context_dev/models/monitor_retrieve_change_params.rb +3 -1
  45. data/lib/context_dev/models/monitor_retrieve_change_response.rb +45 -15
  46. data/lib/context_dev/models/monitor_retrieve_params.rb +3 -1
  47. data/lib/context_dev/models/monitor_retrieve_response.rb +361 -171
  48. data/lib/context_dev/models/monitor_retrieve_run_params.rb +6 -2
  49. data/lib/context_dev/models/monitor_retrieve_run_response.rb +45 -8
  50. data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +3 -1
  51. data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +364 -172
  52. data/lib/context_dev/models/monitor_run_params.rb +3 -1
  53. data/lib/context_dev/models/monitor_run_response.rb +42 -4
  54. data/lib/context_dev/models/monitor_update_params.rb +239 -71
  55. data/lib/context_dev/models/monitor_update_response.rb +361 -171
  56. data/lib/context_dev/models/news_search_params.rb +10 -6
  57. data/lib/context_dev/models/news_search_response.rb +8 -8
  58. data/lib/context_dev/models/parse_handle_params.rb +9 -20
  59. data/lib/context_dev/models/parse_handle_response.rb +8 -8
  60. data/lib/context_dev/models/person_enrich_params.rb +76 -50
  61. data/lib/context_dev/models/person_enrich_response.rb +8 -8
  62. data/lib/context_dev/models/utility_prefetch_params.rb +15 -29
  63. data/lib/context_dev/models/utility_prefetch_response.rb +10 -10
  64. data/lib/context_dev/models/web_answers_params.rb +28 -47
  65. data/lib/context_dev/models/web_answers_response.rb +9 -8
  66. data/lib/context_dev/models/web_extract_competitors_params.rb +17 -32
  67. data/lib/context_dev/models/web_extract_competitors_response.rb +8 -8
  68. data/lib/context_dev/models/web_extract_styleguide_params.rb +22 -44
  69. data/lib/context_dev/models/web_extract_styleguide_response.rb +34 -44
  70. data/lib/context_dev/models/web_map_urls_params.rb +30 -51
  71. data/lib/context_dev/models/web_map_urls_response.rb +8 -8
  72. data/lib/context_dev/models/web_scrape_params.rb +193 -191
  73. data/lib/context_dev/models/web_scrape_response.rb +219 -95
  74. data/lib/context_dev/models/web_screenshot_params.rb +20 -39
  75. data/lib/context_dev/models/web_screenshot_response.rb +18 -28
  76. data/lib/context_dev/models/web_search_params.rb +76 -65
  77. data/lib/context_dev/models/web_search_response.rb +68 -27
  78. data/lib/context_dev/models/web_web_crawl_md_params.rb +41 -70
  79. data/lib/context_dev/models/web_web_crawl_md_response.rb +11 -15
  80. data/lib/context_dev/models/webhook_delivery.rb +3 -7
  81. data/lib/context_dev/models/webhooks/attempt.rb +3 -3
  82. data/lib/context_dev/models/webhooks/delivery.rb +16 -11
  83. data/lib/context_dev/models/webhooks/delivery_list_attempts_params.rb +2 -6
  84. data/lib/context_dev/models/webhooks/delivery_list_attempts_response.rb +8 -8
  85. data/lib/context_dev/models/webhooks/delivery_list_params.rb +4 -4
  86. data/lib/context_dev/models/webhooks/delivery_list_response.rb +8 -8
  87. data/lib/context_dev/models/webhooks/delivery_retrieve_params.rb +2 -6
  88. data/lib/context_dev/models/webhooks/delivery_retrieve_response.rb +8 -8
  89. data/lib/context_dev/models/webhooks/delivery_retry_params.rb +4 -4
  90. data/lib/context_dev/models/webhooks/delivery_retry_response.rb +8 -8
  91. data/lib/context_dev/models/webhooks/delivery_summary.rb +16 -11
  92. data/lib/context_dev/resources/batch.rb +17 -16
  93. data/lib/context_dev/resources/brand.rb +6 -8
  94. data/lib/context_dev/resources/feedback.rb +4 -5
  95. data/lib/context_dev/resources/industry.rb +9 -11
  96. data/lib/context_dev/resources/logs.rb +4 -5
  97. data/lib/context_dev/resources/monitors.rb +50 -53
  98. data/lib/context_dev/resources/news.rb +4 -8
  99. data/lib/context_dev/resources/parse.rb +4 -5
  100. data/lib/context_dev/resources/people.rb +11 -13
  101. data/lib/context_dev/resources/utility.rb +4 -11
  102. data/lib/context_dev/resources/web.rb +69 -94
  103. data/lib/context_dev/resources/webhooks/deliveries.rb +10 -18
  104. data/lib/context_dev/resources/webhooks.rb +1 -1
  105. data/lib/context_dev/version.rb +1 -1
  106. data/rbi/context_dev/client.rbi +4 -9
  107. data/rbi/context_dev/models/batch_cancel_params.rbi +2 -2
  108. data/rbi/context_dev/models/batch_cancel_response.rbi +17 -21
  109. data/rbi/context_dev/models/batch_delete_params.rbi +2 -2
  110. data/rbi/context_dev/models/batch_delete_response.rbi +9 -9
  111. data/rbi/context_dev/models/batch_get_results_params.rbi +2 -2
  112. data/rbi/context_dev/models/batch_get_results_response.rbi +18 -26
  113. data/rbi/context_dev/models/batch_list_response.rbi +41 -53
  114. data/rbi/context_dev/models/batch_retrieve_params.rbi +2 -2
  115. data/rbi/context_dev/models/batch_retrieve_response.rbi +40 -52
  116. data/rbi/context_dev/models/batch_submit_params.rbi +87 -147
  117. data/rbi/context_dev/models/batch_submit_response.rbi +19 -31
  118. data/rbi/context_dev/models/brand_retrieve_params.rbi +99 -190
  119. data/rbi/context_dev/models/brand_retrieve_response.rbi +19 -25
  120. data/rbi/context_dev/models/brand_search_params.rbi +2 -4
  121. data/rbi/context_dev/models/brand_search_response.rbi +9 -9
  122. data/rbi/context_dev/models/crawl_controls.rbi +1 -2
  123. data/rbi/context_dev/models/feedback_submit_params.rbi +2 -2
  124. data/rbi/context_dev/models/feedback_submit_response.rbi +9 -9
  125. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +19 -42
  126. data/rbi/context_dev/models/industry_retrieve_naics_response.rbi +11 -11
  127. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +22 -51
  128. data/rbi/context_dev/models/industry_retrieve_sic_response.rbi +11 -11
  129. data/rbi/context_dev/models/intake.rbi +7 -19
  130. data/rbi/context_dev/models/log_list_response.rbi +13 -11
  131. data/rbi/context_dev/models/log_retrieve_response.rbi +13 -76
  132. data/rbi/context_dev/models/monitor_create_params.rbi +418 -78
  133. data/rbi/context_dev/models/monitor_create_response.rbi +654 -287
  134. data/rbi/context_dev/models/monitor_delete_params.rbi +6 -1
  135. data/rbi/context_dev/models/monitor_delete_response.rbi +89 -3
  136. data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +77 -3
  137. data/rbi/context_dev/models/monitor_get_limits_response.rbi +83 -10
  138. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +236 -24
  139. data/rbi/context_dev/models/monitor_list_account_runs_response.rbi +86 -12
  140. data/rbi/context_dev/models/monitor_list_changes_params.rbi +2 -0
  141. data/rbi/context_dev/models/monitor_list_changes_response.rbi +234 -24
  142. data/rbi/context_dev/models/monitor_list_params.rbi +4 -4
  143. data/rbi/context_dev/models/monitor_list_response.rbi +502 -130
  144. data/rbi/context_dev/models/monitor_list_runs_params.rbi +2 -0
  145. data/rbi/context_dev/models/monitor_list_runs_response.rbi +84 -12
  146. data/rbi/context_dev/models/monitor_retrieve_change_params.rbi +6 -1
  147. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +79 -15
  148. data/rbi/context_dev/models/monitor_retrieve_params.rbi +6 -1
  149. data/rbi/context_dev/models/monitor_retrieve_response.rbi +654 -283
  150. data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +9 -1
  151. data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +77 -9
  152. data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +6 -1
  153. data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +659 -288
  154. data/rbi/context_dev/models/monitor_run_params.rbi +6 -1
  155. data/rbi/context_dev/models/monitor_run_response.rbi +82 -9
  156. data/rbi/context_dev/models/monitor_update_params.rbi +420 -75
  157. data/rbi/context_dev/models/monitor_update_response.rbi +650 -281
  158. data/rbi/context_dev/models/news_search_params.rbi +10 -2
  159. data/rbi/context_dev/models/news_search_response.rbi +9 -9
  160. data/rbi/context_dev/models/parse_handle_params.rbi +10 -29
  161. data/rbi/context_dev/models/parse_handle_response.rbi +9 -9
  162. data/rbi/context_dev/models/person_enrich_params.rbi +86 -44
  163. data/rbi/context_dev/models/person_enrich_response.rbi +9 -9
  164. data/rbi/context_dev/models/utility_prefetch_params.rbi +15 -27
  165. data/rbi/context_dev/models/utility_prefetch_response.rbi +11 -11
  166. data/rbi/context_dev/models/web_answers_params.rbi +33 -63
  167. data/rbi/context_dev/models/web_answers_response.rbi +11 -9
  168. data/rbi/context_dev/models/web_extract_competitors_params.rbi +19 -42
  169. data/rbi/context_dev/models/web_extract_competitors_response.rbi +9 -9
  170. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +25 -61
  171. data/rbi/context_dev/models/web_extract_styleguide_response.rbi +36 -51
  172. data/rbi/context_dev/models/web_map_urls_params.rbi +33 -68
  173. data/rbi/context_dev/models/web_map_urls_response.rbi +9 -9
  174. data/rbi/context_dev/models/web_scrape_params.rbi +212 -206
  175. data/rbi/context_dev/models/web_scrape_response.rbi +296 -120
  176. data/rbi/context_dev/models/web_screenshot_params.rbi +22 -51
  177. data/rbi/context_dev/models/web_screenshot_response.rbi +20 -35
  178. data/rbi/context_dev/models/web_search_params.rbi +114 -82
  179. data/rbi/context_dev/models/web_search_response.rbi +145 -33
  180. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +45 -95
  181. data/rbi/context_dev/models/web_web_crawl_md_response.rbi +12 -18
  182. data/rbi/context_dev/models/webhook_delivery.rbi +3 -9
  183. data/rbi/context_dev/models/webhooks/attempt.rbi +3 -3
  184. data/rbi/context_dev/models/webhooks/delivery.rbi +14 -11
  185. data/rbi/context_dev/models/webhooks/delivery_list_attempts_params.rbi +2 -4
  186. data/rbi/context_dev/models/webhooks/delivery_list_attempts_response.rbi +9 -9
  187. data/rbi/context_dev/models/webhooks/delivery_list_params.rbi +4 -4
  188. data/rbi/context_dev/models/webhooks/delivery_list_response.rbi +9 -9
  189. data/rbi/context_dev/models/webhooks/delivery_retrieve_params.rbi +2 -4
  190. data/rbi/context_dev/models/webhooks/delivery_retrieve_response.rbi +9 -9
  191. data/rbi/context_dev/models/webhooks/delivery_retry_params.rbi +4 -4
  192. data/rbi/context_dev/models/webhooks/delivery_retry_response.rbi +9 -9
  193. data/rbi/context_dev/models/webhooks/delivery_summary.rbi +14 -11
  194. data/rbi/context_dev/resources/batch.rbi +19 -18
  195. data/rbi/context_dev/resources/brand.rbi +6 -9
  196. data/rbi/context_dev/resources/feedback.rbi +4 -5
  197. data/rbi/context_dev/resources/industry.rbi +11 -27
  198. data/rbi/context_dev/resources/logs.rbi +4 -5
  199. data/rbi/context_dev/resources/monitors.rbi +71 -49
  200. data/rbi/context_dev/resources/news.rbi +4 -8
  201. data/rbi/context_dev/resources/parse.rbi +7 -14
  202. data/rbi/context_dev/resources/people.rbi +15 -13
  203. data/rbi/context_dev/resources/utility.rbi +4 -11
  204. data/rbi/context_dev/resources/web.rbi +89 -190
  205. data/rbi/context_dev/resources/webhooks/deliveries.rbi +10 -12
  206. data/rbi/context_dev/resources/webhooks.rbi +1 -1
  207. data/sig/context_dev/models/log_retrieve_response.rbs +0 -28
  208. data/sig/context_dev/models/monitor_create_params.rbs +113 -0
  209. data/sig/context_dev/models/monitor_create_response.rbs +203 -53
  210. data/sig/context_dev/models/monitor_delete_response.rbs +46 -3
  211. data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +36 -3
  212. data/sig/context_dev/models/monitor_get_limits_response.rbs +36 -3
  213. data/sig/context_dev/models/monitor_list_account_changes_response.rbs +111 -8
  214. data/sig/context_dev/models/monitor_list_account_runs_response.rbs +36 -3
  215. data/sig/context_dev/models/monitor_list_changes_response.rbs +111 -8
  216. data/sig/context_dev/models/monitor_list_response.rbs +149 -3
  217. data/sig/context_dev/models/monitor_list_runs_response.rbs +36 -3
  218. data/sig/context_dev/models/monitor_retrieve_change_response.rbs +33 -0
  219. data/sig/context_dev/models/monitor_retrieve_response.rbs +203 -53
  220. data/sig/context_dev/models/monitor_retrieve_run_response.rbs +33 -0
  221. data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +203 -53
  222. data/sig/context_dev/models/monitor_run_response.rbs +48 -3
  223. data/sig/context_dev/models/monitor_update_params.rbs +113 -0
  224. data/sig/context_dev/models/monitor_update_response.rbs +203 -53
  225. data/sig/context_dev/models/web_scrape_response.rbs +204 -27
  226. data/sig/context_dev/models/web_search_params.rbs +25 -0
  227. data/sig/context_dev/models/web_search_response.rbs +48 -0
  228. data/sig/context_dev/resources/web.rbs +1 -0
  229. metadata +2 -2
@@ -11,18 +11,18 @@ module ContextDev
11
11
  T.any(ContextDev::WebScrapeParams, ContextDev::Internal::AnyHash)
12
12
  end
13
13
 
14
- # Outputs to return. Enable at least one; omitted formats are false.
14
+ # Outputs to return. Set at least one to `true`.
15
15
  sig { returns(ContextDev::WebScrapeParams::Formats) }
16
16
  attr_reader :formats
17
17
 
18
18
  sig { params(formats: ContextDev::WebScrapeParams::Formats::OrHash).void }
19
19
  attr_writer :formats
20
20
 
21
- # The URL to scrape.
21
+ # Public HTTP or HTTPS URL to scrape.
22
22
  sig { returns(String) }
23
23
  attr_accessor :url
24
24
 
25
- # Highlight options. Requires formats.highlights: true.
25
+ # Requires `formats.highlights: true`; required when it is set.
26
26
  sig { returns(T.nilable(ContextDev::WebScrapeParams::HighlightsParams)) }
27
27
  attr_reader :highlights_params
28
28
 
@@ -45,7 +45,7 @@ module ContextDev
45
45
  end
46
46
  attr_writer :image_params
47
47
 
48
- # Required when formats.json is true.
48
+ # Requires `formats.json: true`; required when it is set.
49
49
  sig { returns(T.nilable(ContextDev::WebScrapeParams::JsonParams)) }
50
50
  attr_reader :json_params
51
51
 
@@ -56,7 +56,7 @@ module ContextDev
56
56
  end
57
57
  attr_writer :json_params
58
58
 
59
- # Markdown options. Requires formats.markdown: true.
59
+ # Markdown options. Requires `formats.markdown`.
60
60
  sig { returns(T.nilable(ContextDev::WebScrapeParams::MarkdownParams)) }
61
61
  attr_reader :markdown_params
62
62
 
@@ -67,17 +67,15 @@ module ContextDev
67
67
  end
68
68
  attr_writer :markdown_params
69
69
 
70
- # Maximum age of each cached output. Defaults to 1 day; 0 fetches fresh and
71
- # updates the requested outputs. Compatible outputs are shared with the individual
72
- # scrape endpoints. Image results with hosted files refresh after 23 hours; other
73
- # outputs retain their own freshness.
70
+ # Maximum age of a cached output, in milliseconds. `0` fetches fresh. Defaults to
71
+ # 3 days (259200000 ms). Maximum: 1 year (31536000000 ms).
74
72
  sig { returns(T.nilable(Integer)) }
75
73
  attr_reader :max_age_ms
76
74
 
77
75
  sig { params(max_age_ms: Integer).void }
78
76
  attr_writer :max_age_ms
79
77
 
80
- # Required when formats.parse is true.
78
+ # Requires `formats.parse: true`; required when it is set.
81
79
  sig { returns(T.nilable(ContextDev::WebScrapeParams::ParseParams)) }
82
80
  attr_reader :parse_params
83
81
 
@@ -111,8 +109,7 @@ module ContextDev
111
109
  end
112
110
  attr_writer :screenshot_params
113
111
 
114
- # Shared browser and content settings. Content filters leave screenshots and
115
- # original bytes unchanged.
112
+ # Browser and content settings shared by all outputs.
116
113
  sig { returns(T.nilable(ContextDev::WebScrapeParams::SharedParams)) }
117
114
  attr_reader :shared_params
118
115
 
@@ -130,17 +127,8 @@ module ContextDev
130
127
  sig { params(tags: T::Array[String]).void }
131
128
  attr_writer :tags
132
129
 
133
- # Total deadline, including navigation, actions, waiting, and all outputs.
134
- # Defaults to 60000 milliseconds with behavior fail. Individual outputs have
135
- # internal deadlines that reserve time to return completed outputs; timed-out
136
- # outputs have success: false and data: null under either behavior. The overall
137
- # request deadline remains enforced: fail returns an error if that deadline is
138
- # reached. Use return-partial to allow the current page state and available
139
- # outputs when the page is still loading. Partial responses set isPartial. Failed
140
- # retrievals and incomplete captures are not cached; valid captured pieces may be
141
- # cached independently. Fixed waits must fit before a response reserve of up to
142
- # 5000 milliseconds (at most one quarter of the timeout) when using
143
- # return-partial.
130
+ # Deadline for the whole request. Defaults to 60000 ms with `fail`. Fixed waits
131
+ # must end before it.
144
132
  sig { returns(T.nilable(ContextDev::WebScrapeParams::TimeoutOpts)) }
145
133
  attr_reader :timeout_opts
146
134
 
@@ -151,8 +139,7 @@ module ContextDev
151
139
  end
152
140
  attr_writer :timeout_opts
153
141
 
154
- # Zero data retention. Bypasses caches and uploads; excludes request/response
155
- # content and tags from logs. Must be enabled for your organization.
142
+ # `enabled` turns on zero data retention. Your organization must have ZDR enabled.
156
143
  sig { returns(T.nilable(ContextDev::WebScrapeParams::Zdr::OrSymbol)) }
157
144
  attr_reader :zdr
158
145
 
@@ -181,48 +168,35 @@ module ContextDev
181
168
  ).returns(T.attached_class)
182
169
  end
183
170
  def self.new(
184
- # Outputs to return. Enable at least one; omitted formats are false.
171
+ # Outputs to return. Set at least one to `true`.
185
172
  formats:,
186
- # The URL to scrape.
173
+ # Public HTTP or HTTPS URL to scrape.
187
174
  url:,
188
- # Highlight options. Requires formats.highlights: true.
175
+ # Requires `formats.highlights: true`; required when it is set.
189
176
  highlights_params: nil,
190
177
  # Image options. Requires formats.images: true.
191
178
  image_params: nil,
192
- # Required when formats.json is true.
179
+ # Requires `formats.json: true`; required when it is set.
193
180
  json_params: nil,
194
- # Markdown options. Requires formats.markdown: true.
181
+ # Markdown options. Requires `formats.markdown`.
195
182
  markdown_params: nil,
196
- # Maximum age of each cached output. Defaults to 1 day; 0 fetches fresh and
197
- # updates the requested outputs. Compatible outputs are shared with the individual
198
- # scrape endpoints. Image results with hosted files refresh after 23 hours; other
199
- # outputs retain their own freshness.
183
+ # Maximum age of a cached output, in milliseconds. `0` fetches fresh. Defaults to
184
+ # 3 days (259200000 ms). Maximum: 1 year (31536000000 ms).
200
185
  max_age_ms: nil,
201
- # Required when formats.parse is true.
186
+ # Requires `formats.parse: true`; required when it is set.
202
187
  parse_params: nil,
203
188
  # Product options. Requires formats.product: true.
204
189
  product_params: nil,
205
190
  # Screenshot options. Requires formats.screenshot: true.
206
191
  screenshot_params: nil,
207
- # Shared browser and content settings. Content filters leave screenshots and
208
- # original bytes unchanged.
192
+ # Browser and content settings shared by all outputs.
209
193
  shared_params: nil,
210
194
  # Labels for tracking request usage. Not retained when zdr is enabled.
211
195
  tags: nil,
212
- # Total deadline, including navigation, actions, waiting, and all outputs.
213
- # Defaults to 60000 milliseconds with behavior fail. Individual outputs have
214
- # internal deadlines that reserve time to return completed outputs; timed-out
215
- # outputs have success: false and data: null under either behavior. The overall
216
- # request deadline remains enforced: fail returns an error if that deadline is
217
- # reached. Use return-partial to allow the current page state and available
218
- # outputs when the page is still loading. Partial responses set isPartial. Failed
219
- # retrievals and incomplete captures are not cached; valid captured pieces may be
220
- # cached independently. Fixed waits must fit before a response reserve of up to
221
- # 5000 milliseconds (at most one quarter of the timeout) when using
222
- # return-partial.
196
+ # Deadline for the whole request. Defaults to 60000 ms with `fail`. Fixed waits
197
+ # must end before it.
223
198
  timeout_opts: nil,
224
- # Zero data retention. Bypasses caches and uploads; excludes request/response
225
- # content and tags from logs. Must be enabled for your organization.
199
+ # `enabled` turns on zero data retention. Your organization must have ZDR enabled.
226
200
  zdr: nil,
227
201
  request_options: {}
228
202
  )
@@ -268,9 +242,7 @@ module ContextDev
268
242
  sig { params(bytes: T::Boolean).void }
269
243
  attr_writer :bytes
270
244
 
271
- # Relevant Markdown excerpts for your question or topic, preserving code, lists,
272
- # and tables, with headings included when needed for context. Adds 3 credits when
273
- # passages are returned.
245
+ # Markdown excerpts relevant to `highlightsParams.query`.
274
246
  sig { returns(T.nilable(T::Boolean)) }
275
247
  attr_reader :highlights
276
248
 
@@ -291,8 +263,7 @@ module ContextDev
291
263
  sig { params(images: T::Boolean).void }
292
264
  attr_writer :images
293
265
 
294
- # Page data extracted using your schema. Adds 4 credits when extraction succeeds
295
- # and its result is returned.
266
+ # An object matching `jsonParams.schema`, extracted from the page.
296
267
  sig { returns(T.nilable(T::Boolean)) }
297
268
  attr_reader :json
298
269
 
@@ -306,29 +277,28 @@ module ContextDev
306
277
  sig { params(markdown: T::Boolean).void }
307
278
  attr_writer :markdown
308
279
 
309
- # Fields selected by parseParams.rules.
280
+ # Fields extracted with `parseParams.rules`, returned as `parsed`.
310
281
  sig { returns(T.nilable(T::Boolean)) }
311
282
  attr_reader :parse
312
283
 
313
284
  sig { params(parse: T::Boolean).void }
314
285
  attr_writer :parse
315
286
 
316
- # Product details such as name, price, and availability. Adds 1 credit when its
317
- # successful result is returned or the target page is missing.
287
+ # Product details such as name, price, and availability.
318
288
  sig { returns(T.nilable(T::Boolean)) }
319
289
  attr_reader :product
320
290
 
321
291
  sig { params(product: T::Boolean).void }
322
292
  attr_writer :product
323
293
 
324
- # An inline image of the page.
294
+ # A screenshot of the page.
325
295
  sig { returns(T.nilable(T::Boolean)) }
326
296
  attr_reader :screenshot
327
297
 
328
298
  sig { params(screenshot: T::Boolean).void }
329
299
  attr_writer :screenshot
330
300
 
331
- # Outputs to return. Enable at least one; omitted formats are false.
301
+ # Outputs to return. Set at least one to `true`.
332
302
  sig do
333
303
  params(
334
304
  bytes: T::Boolean,
@@ -345,25 +315,21 @@ module ContextDev
345
315
  def self.new(
346
316
  # The original HTTP response body.
347
317
  bytes: nil,
348
- # Relevant Markdown excerpts for your question or topic, preserving code, lists,
349
- # and tables, with headings included when needed for context. Adds 3 credits when
350
- # passages are returned.
318
+ # Markdown excerpts relevant to `highlightsParams.query`.
351
319
  highlights: nil,
352
320
  # Rendered HTML.
353
321
  html: nil,
354
322
  # Images found on the page.
355
323
  images: nil,
356
- # Page data extracted using your schema. Adds 4 credits when extraction succeeds
357
- # and its result is returned.
324
+ # An object matching `jsonParams.schema`, extracted from the page.
358
325
  json: nil,
359
326
  # Page content as Markdown.
360
327
  markdown: nil,
361
- # Fields selected by parseParams.rules.
328
+ # Fields extracted with `parseParams.rules`, returned as `parsed`.
362
329
  parse: nil,
363
- # Product details such as name, price, and availability. Adds 1 credit when its
364
- # successful result is returned or the target page is missing.
330
+ # Product details such as name, price, and availability.
365
331
  product: nil,
366
- # An inline image of the page.
332
+ # A screenshot of the page.
367
333
  screenshot: nil
368
334
  )
369
335
  end
@@ -400,14 +366,14 @@ module ContextDev
400
366
  sig { returns(String) }
401
367
  attr_accessor :query
402
368
 
403
- # Maximum combined length of the returned passages, in characters.
369
+ # Maximum combined length of returned passages.
404
370
  sig { returns(T.nilable(Integer)) }
405
371
  attr_reader :max_characters
406
372
 
407
373
  sig { params(max_characters: Integer).void }
408
374
  attr_writer :max_characters
409
375
 
410
- # Highlight options. Requires formats.highlights: true.
376
+ # Requires `formats.highlights: true`; required when it is set.
411
377
  sig do
412
378
  params(query: String, max_characters: Integer).returns(
413
379
  T.attached_class
@@ -416,7 +382,7 @@ module ContextDev
416
382
  def self.new(
417
383
  # The question or topic to find passages for.
418
384
  query:,
419
- # Maximum combined length of the returned passages, in characters.
385
+ # Maximum combined length of returned passages.
420
386
  max_characters: nil
421
387
  )
422
388
  end
@@ -435,7 +401,7 @@ module ContextDev
435
401
  )
436
402
  end
437
403
 
438
- # For visual duplicates, keep the largest image.
404
+ # Set `visual` to drop visual duplicates, keeping the largest copy.
439
405
  sig do
440
406
  returns(
441
407
  T.nilable(
@@ -452,9 +418,7 @@ module ContextDev
452
418
  end
453
419
  attr_writer :dedupe
454
420
 
455
- # Add dimensions, a visual category, or a hosted file URL. Each image has a
456
- # maximum processing time of 30000 milliseconds, bounded by the remaining request
457
- # deadline.
421
+ # Extra data per image: `dimensions`, `classification`, or a hosted `file` URL.
458
422
  sig do
459
423
  returns(
460
424
  T.nilable(
@@ -487,11 +451,9 @@ module ContextDev
487
451
  ).returns(T.attached_class)
488
452
  end
489
453
  def self.new(
490
- # For visual duplicates, keep the largest image.
454
+ # Set `visual` to drop visual duplicates, keeping the largest copy.
491
455
  dedupe: nil,
492
- # Add dimensions, a visual category, or a hosted file URL. Each image has a
493
- # maximum processing time of 30000 milliseconds, bounded by the remaining request
494
- # deadline.
456
+ # Extra data per image: `dimensions`, `classification`, or a hosted `file` URL.
495
457
  enrich: nil
496
458
  )
497
459
  end
@@ -511,7 +473,7 @@ module ContextDev
511
473
  def to_hash
512
474
  end
513
475
 
514
- # For visual duplicates, keep the largest image.
476
+ # Set `visual` to drop visual duplicates, keeping the largest copy.
515
477
  module Dedupe
516
478
  extend ContextDev::Internal::Type::Enum
517
479
 
@@ -589,23 +551,19 @@ module ContextDev
589
551
  )
590
552
  end
591
553
 
592
- # JSON Schema for the returned object. Must describe a top-level object; at most
593
- # 50 KB serialized. Optional fields the page does not state are omitted, or null
594
- # when their type allows null, while required non-nullable fields always receive a
595
- # best-effort value, so prefer nullable or optional fields for data a page may
596
- # omit. Zod users can pass the output of z.toJSONSchema().
554
+ # JSON Schema (not an example object) for a top-level object, up to 50 KB. Use
555
+ # optional or nullable fields for missing facts.
597
556
  sig { returns(T::Hash[Symbol, T.anything]) }
598
557
  attr_accessor :schema
599
558
 
600
- # Optional guidance on which facts to prioritize or how to interpret schema
601
- # fields.
559
+ # Extra guidance, such as which facts to prefer or how to read a field.
602
560
  sig { returns(T.nilable(String)) }
603
561
  attr_reader :instructions
604
562
 
605
563
  sig { params(instructions: String).void }
606
564
  attr_writer :instructions
607
565
 
608
- # Required when formats.json is true.
566
+ # Requires `formats.json: true`; required when it is set.
609
567
  sig do
610
568
  params(
611
569
  schema: T::Hash[Symbol, T.anything],
@@ -613,14 +571,10 @@ module ContextDev
613
571
  ).returns(T.attached_class)
614
572
  end
615
573
  def self.new(
616
- # JSON Schema for the returned object. Must describe a top-level object; at most
617
- # 50 KB serialized. Optional fields the page does not state are omitted, or null
618
- # when their type allows null, while required non-nullable fields always receive a
619
- # best-effort value, so prefer nullable or optional fields for data a page may
620
- # omit. Zod users can pass the output of z.toJSONSchema().
574
+ # JSON Schema (not an example object) for a top-level object, up to 50 KB. Use
575
+ # optional or nullable fields for missing facts.
621
576
  schema:,
622
- # Optional guidance on which facts to prioritize or how to interpret schema
623
- # fields.
577
+ # Extra guidance, such as which facts to prefer or how to read a field.
624
578
  instructions: nil
625
579
  )
626
580
  end
@@ -643,19 +597,22 @@ module ContextDev
643
597
  )
644
598
  end
645
599
 
600
+ # Include images in the Markdown using image syntax with URLs and alt text.
646
601
  sig { returns(T.nilable(T::Boolean)) }
647
602
  attr_reader :include_images
648
603
 
649
604
  sig { params(include_images: T::Boolean).void }
650
605
  attr_writer :include_images
651
606
 
607
+ # Keep link URLs in the Markdown. Set false to return link text without URLs.
652
608
  sig { returns(T.nilable(T::Boolean)) }
653
609
  attr_reader :include_links
654
610
 
655
611
  sig { params(include_links: T::Boolean).void }
656
612
  attr_writer :include_links
657
613
 
658
- # Base64 images use placeholders by default. Requires includeImages: true.
614
+ # How base64 images appear: `placeholder` (default) or `preserve`. Requires
615
+ # `includeImages`.
659
616
  sig do
660
617
  returns(
661
618
  T.nilable(
@@ -673,7 +630,7 @@ module ContextDev
673
630
  end
674
631
  attr_writer :inline_images
675
632
 
676
- # Markdown options. Requires formats.markdown: true.
633
+ # Markdown options. Requires `formats.markdown`.
677
634
  sig do
678
635
  params(
679
636
  include_images: T::Boolean,
@@ -683,9 +640,12 @@ module ContextDev
683
640
  ).returns(T.attached_class)
684
641
  end
685
642
  def self.new(
643
+ # Include images in the Markdown using image syntax with URLs and alt text.
686
644
  include_images: nil,
645
+ # Keep link URLs in the Markdown. Set false to return link text without URLs.
687
646
  include_links: nil,
688
- # Base64 images use placeholders by default. Requires includeImages: true.
647
+ # How base64 images appear: `placeholder` (default) or `preserve`. Requires
648
+ # `includeImages`.
689
649
  inline_images: nil
690
650
  )
691
651
  end
@@ -703,7 +663,8 @@ module ContextDev
703
663
  def to_hash
704
664
  end
705
665
 
706
- # Base64 images use placeholders by default. Requires includeImages: true.
666
+ # How base64 images appear: `placeholder` (default) or `preserve`. Requires
667
+ # `includeImages`.
707
668
  module InlineImages
708
669
  extend ContextDev::Internal::Type::Enum
709
670
 
@@ -748,8 +709,8 @@ module ContextDev
748
709
  )
749
710
  end
750
711
 
751
- # Map field names to CSS selectors or rules. Missing items return null; missing
752
- # lists return [].
712
+ # Field names mapped to CSS selectors (`h1`, `a@href`) or rule objects. Max 100
713
+ # fields, 5 levels.
753
714
  sig do
754
715
  returns(
755
716
  T::Hash[
@@ -763,7 +724,7 @@ module ContextDev
763
724
  end
764
725
  attr_accessor :rules
765
726
 
766
- # Required when formats.parse is true.
727
+ # Requires `formats.parse: true`; required when it is set.
767
728
  sig do
768
729
  params(
769
730
  rules:
@@ -777,8 +738,8 @@ module ContextDev
777
738
  ).returns(T.attached_class)
778
739
  end
779
740
  def self.new(
780
- # Map field names to CSS selectors or rules. Missing items return null; missing
781
- # lists return [].
741
+ # Field names mapped to CSS selectors (`h1`, `a@href`) or rule objects. Max 100
742
+ # fields, 5 levels.
782
743
  rules:
783
744
  )
784
745
  end
@@ -820,9 +781,12 @@ module ContextDev
820
781
  )
821
782
  end
822
783
 
784
+ # CSS selector to match within the current page or parent rule.
823
785
  sig { returns(String) }
824
786
  attr_accessor :selector
825
787
 
788
+ # Return text, HTML, an attribute such as `@href`, or nested field rules. Defaults
789
+ # to text.
826
790
  sig do
827
791
  returns(
828
792
  T.nilable(
@@ -848,6 +812,7 @@ module ContextDev
848
812
  end
849
813
  attr_writer :output
850
814
 
815
+ # Return the first match with `item` or all matches with `list`.
851
816
  sig do
852
817
  returns(
853
818
  T.nilable(
@@ -878,7 +843,15 @@ module ContextDev
878
843
  ContextDev::WebScrapeParams::ParseParams::Rule::UnionMember1::Type::OrSymbol
879
844
  ).returns(T.attached_class)
880
845
  end
881
- def self.new(selector:, output: nil, type: nil)
846
+ def self.new(
847
+ # CSS selector to match within the current page or parent rule.
848
+ selector:,
849
+ # Return text, HTML, an attribute such as `@href`, or nested field rules. Defaults
850
+ # to text.
851
+ output: nil,
852
+ # Return the first match with `item` or all matches with `list`.
853
+ type: nil
854
+ )
882
855
  end
883
856
 
884
857
  sig do
@@ -899,6 +872,8 @@ module ContextDev
899
872
  def to_hash
900
873
  end
901
874
 
875
+ # Return text, HTML, an attribute such as `@href`, or nested field rules. Defaults
876
+ # to text.
902
877
  module Output
903
878
  extend ContextDev::Internal::Type::Union
904
879
 
@@ -942,6 +917,7 @@ module ContextDev
942
917
  )
943
918
  end
944
919
 
920
+ # Return the first match with `item` or all matches with `list`.
945
921
  module Type
946
922
  extend ContextDev::Internal::Type::Enum
947
923
 
@@ -996,11 +972,7 @@ module ContextDev
996
972
  )
997
973
  end
998
974
 
999
- # Extract the product with a specialized model when the page has no structured
1000
- # product data. Adds six credits when the model verdict is returned successfully.
1001
- # If the fallback fails, the product output has success: false and data: null with
1002
- # no fallback charge; other outputs remain available. Request deadlines and client
1003
- # disconnects still apply.
975
+ # Use an AI model when the page has no structured product data.
1004
976
  sig { returns(T.nilable(T::Boolean)) }
1005
977
  attr_reader :use_ai_fallback
1006
978
 
@@ -1010,11 +982,7 @@ module ContextDev
1010
982
  # Product options. Requires formats.product: true.
1011
983
  sig { params(use_ai_fallback: T::Boolean).returns(T.attached_class) }
1012
984
  def self.new(
1013
- # Extract the product with a specialized model when the page has no structured
1014
- # product data. Adds six credits when the model verdict is returned successfully.
1015
- # If the fallback fails, the product output has success: false and data: null with
1016
- # no fallback charge; other outputs remain available. Request deadlines and client
1017
- # disconnects still apply.
985
+ # Use an AI model when the page has no structured product data.
1018
986
  use_ai_fallback: nil
1019
987
  )
1020
988
  end
@@ -1033,7 +1001,8 @@ module ContextDev
1033
1001
  )
1034
1002
  end
1035
1003
 
1036
- # Viewport, full page, one visible element, or a rectangle. Maximum 40 megapixels.
1004
+ # What to capture: `viewport`, `fullPage`, one element, or a rectangle. Max 40
1005
+ # megapixels.
1037
1006
  sig do
1038
1007
  returns(
1039
1008
  T.nilable(
@@ -1059,6 +1028,7 @@ module ContextDev
1059
1028
  end
1060
1029
  attr_writer :area
1061
1030
 
1031
+ # Image format for the screenshot.
1062
1032
  sig do
1063
1033
  returns(
1064
1034
  T.nilable(
@@ -1090,8 +1060,10 @@ module ContextDev
1090
1060
  ).returns(T.attached_class)
1091
1061
  end
1092
1062
  def self.new(
1093
- # Viewport, full page, one visible element, or a rectangle. Maximum 40 megapixels.
1063
+ # What to capture: `viewport`, `fullPage`, one element, or a rectangle. Max 40
1064
+ # megapixels.
1094
1065
  area: nil,
1066
+ # Image format for the screenshot.
1095
1067
  format_: nil
1096
1068
  )
1097
1069
  end
@@ -1113,7 +1085,8 @@ module ContextDev
1113
1085
  def to_hash
1114
1086
  end
1115
1087
 
1116
- # Viewport, full page, one visible element, or a rectangle. Maximum 40 megapixels.
1088
+ # What to capture: `viewport`, `fullPage`, one element, or a rectangle. Max 40
1089
+ # megapixels.
1117
1090
  module Area
1118
1091
  extend ContextDev::Internal::Type::Union
1119
1092
 
@@ -1169,13 +1142,13 @@ module ContextDev
1169
1142
  )
1170
1143
  end
1171
1144
 
1172
- # Must match one visible element.
1145
+ # CSS selector matching exactly one visible element.
1173
1146
  sig { returns(String) }
1174
1147
  attr_accessor :selector
1175
1148
 
1176
1149
  sig { params(selector: String).returns(T.attached_class) }
1177
1150
  def self.new(
1178
- # Must match one visible element.
1151
+ # CSS selector matching exactly one visible element.
1179
1152
  selector:
1180
1153
  )
1181
1154
  end
@@ -1194,15 +1167,19 @@ module ContextDev
1194
1167
  )
1195
1168
  end
1196
1169
 
1170
+ # Height of the capture in pixels.
1197
1171
  sig { returns(Integer) }
1198
1172
  attr_accessor :height
1199
1173
 
1174
+ # Width of the capture in pixels.
1200
1175
  sig { returns(Integer) }
1201
1176
  attr_accessor :width
1202
1177
 
1178
+ # Left edge of the capture, in pixels from the document origin.
1203
1179
  sig { returns(Integer) }
1204
1180
  attr_accessor :x
1205
1181
 
1182
+ # Top edge of the capture, in pixels from the document origin.
1206
1183
  sig { returns(Integer) }
1207
1184
  attr_accessor :y_
1208
1185
 
@@ -1215,7 +1192,16 @@ module ContextDev
1215
1192
  y_: Integer
1216
1193
  ).returns(T.attached_class)
1217
1194
  end
1218
- def self.new(height:, width:, x:, y_:)
1195
+ def self.new(
1196
+ # Height of the capture in pixels.
1197
+ height:,
1198
+ # Width of the capture in pixels.
1199
+ width:,
1200
+ # Left edge of the capture, in pixels from the document origin.
1201
+ x:,
1202
+ # Top edge of the capture, in pixels from the document origin.
1203
+ y_:
1204
+ )
1219
1205
  end
1220
1206
 
1221
1207
  sig do
@@ -1238,6 +1224,7 @@ module ContextDev
1238
1224
  end
1239
1225
  end
1240
1226
 
1227
+ # Image format for the screenshot.
1241
1228
  module Format
1242
1229
  extend ContextDev::Internal::Type::Enum
1243
1230
 
@@ -1287,8 +1274,8 @@ module ContextDev
1287
1274
  )
1288
1275
  end
1289
1276
 
1290
- # Run in order before capture. A failed action fails the request. Bypasses
1291
- # caching.
1277
+ # Browser steps run in order before capture. Requires a paid plan. Skips the
1278
+ # cache.
1292
1279
  sig do
1293
1280
  returns(
1294
1281
  T.nilable(
@@ -1320,58 +1307,57 @@ module ContextDev
1320
1307
  end
1321
1308
  attr_writer :actions
1322
1309
 
1323
- # Supported two-letter country code, case-insensitive. Applies to every output,
1324
- # including image downloads.
1310
+ # Proxy country as a two-letter code, such as `US`. Case-insensitive.
1325
1311
  sig { returns(T.nilable(String)) }
1326
1312
  attr_reader :country
1327
1313
 
1328
1314
  sig { params(country: String).void }
1329
1315
  attr_writer :country
1330
1316
 
1331
- # Dismiss cookie banners by accepting cookies before actions.
1317
+ # Accept cookie banners before actions and capture.
1332
1318
  sig { returns(T.nilable(T::Boolean)) }
1333
1319
  attr_reader :dismiss_cookies
1334
1320
 
1335
1321
  sig { params(dismiss_cookies: T::Boolean).void }
1336
1322
  attr_writer :dismiss_cookies
1337
1323
 
1338
- # Dismiss other popups before actions.
1324
+ # Close other popups before actions and capture.
1339
1325
  sig { returns(T.nilable(T::Boolean)) }
1340
1326
  attr_reader :dismiss_popups
1341
1327
 
1342
1328
  sig { params(dismiss_popups: T::Boolean).void }
1343
1329
  attr_writer :dismiss_popups
1344
1330
 
1345
- # Remove matching content. Exclusions win.
1331
+ # Remove elements matching these CSS selectors. Overrides `includeSelectors`.
1346
1332
  sig { returns(T.nilable(T::Array[String])) }
1347
1333
  attr_reader :exclude_selectors
1348
1334
 
1349
1335
  sig { params(exclude_selectors: T::Array[String]).void }
1350
1336
  attr_writer :exclude_selectors
1351
1337
 
1352
- # Headers for the target origin. Requests with custom headers bypass caching.
1338
+ # HTTP headers to send to the target site. Requests with headers skip the cache.
1353
1339
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
1354
1340
  attr_reader :headers
1355
1341
 
1356
1342
  sig { params(headers: T::Hash[Symbol, String]).void }
1357
1343
  attr_writer :headers
1358
1344
 
1359
- # Include iframe content in extraction. Screenshots show visible frames
1360
- # regardless.
1345
+ # Include iframe content in HTML and text outputs. Screenshots always show visible
1346
+ # frames.
1361
1347
  sig { returns(T.nilable(T::Boolean)) }
1362
1348
  attr_reader :include_frames
1363
1349
 
1364
1350
  sig { params(include_frames: T::Boolean).void }
1365
1351
  attr_writer :include_frames
1366
1352
 
1367
- # Keep matching content after mainContentOnly.
1353
+ # Keep only elements matching these CSS selectors.
1368
1354
  sig { returns(T.nilable(T::Array[String])) }
1369
1355
  attr_reader :include_selectors
1370
1356
 
1371
1357
  sig { params(include_selectors: T::Array[String]).void }
1372
1358
  attr_writer :include_selectors
1373
1359
 
1374
- # Keep only main content in HTML, Markdown, images, and parsed fields.
1360
+ # Keep only the main content. Doesn't affect `screenshot`, `bytes`, or `product`.
1375
1361
  sig { returns(T.nilable(T::Boolean)) }
1376
1362
  attr_reader :main_content_only
1377
1363
 
@@ -1391,15 +1377,15 @@ module ContextDev
1391
1377
  end
1392
1378
  attr_writer :parsers
1393
1379
 
1394
- # Settle animations before capture. Defaults to true with screenshots, otherwise
1395
- # false.
1380
+ # Wait for CSS animations to finish before capture. Defaults to `true` when
1381
+ # `screenshot` is requested.
1396
1382
  sig { returns(T.nilable(T::Boolean)) }
1397
1383
  attr_reader :settle_animations
1398
1384
 
1399
1385
  sig { params(settle_animations: T::Boolean).void }
1400
1386
  attr_writer :settle_animations
1401
1387
 
1402
- # Override the browser color scheme.
1388
+ # Emulate a light or dark color scheme.
1403
1389
  sig do
1404
1390
  returns(
1405
1391
  T.nilable(
@@ -1416,7 +1402,8 @@ module ContextDev
1416
1402
  end
1417
1403
  attr_writer :theme
1418
1404
 
1419
- # Browser dimensions in pixels.
1405
+ # Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions
1406
+ # default to 1440 × 900.
1420
1407
  sig do
1421
1408
  returns(
1422
1409
  T.nilable(ContextDev::WebScrapeParams::SharedParams::Viewport)
@@ -1432,8 +1419,8 @@ module ContextDev
1432
1419
  end
1433
1420
  attr_writer :viewport
1434
1421
 
1435
- # After actions, wait this many milliseconds or until a CSS selector is visible.
1436
- # Defaults to 500 ms, or 2000 ms with frames or an XML URL. Set 0 to skip.
1422
+ # Milliseconds, or a CSS selector to wait for, after actions. Defaults to 500
1423
+ # (2000 with frames or XML).
1437
1424
  sig do
1438
1425
  returns(
1439
1426
  T.nilable(
@@ -1451,8 +1438,7 @@ module ContextDev
1451
1438
  end
1452
1439
  attr_writer :wait_for
1453
1440
 
1454
- # Shared browser and content settings. Content filters leave screenshots and
1455
- # original bytes unchanged.
1441
+ # Browser and content settings shared by all outputs.
1456
1442
  sig do
1457
1443
  params(
1458
1444
  actions:
@@ -1482,38 +1468,38 @@ module ContextDev
1482
1468
  ).returns(T.attached_class)
1483
1469
  end
1484
1470
  def self.new(
1485
- # Run in order before capture. A failed action fails the request. Bypasses
1486
- # caching.
1471
+ # Browser steps run in order before capture. Requires a paid plan. Skips the
1472
+ # cache.
1487
1473
  actions: nil,
1488
- # Supported two-letter country code, case-insensitive. Applies to every output,
1489
- # including image downloads.
1474
+ # Proxy country as a two-letter code, such as `US`. Case-insensitive.
1490
1475
  country: nil,
1491
- # Dismiss cookie banners by accepting cookies before actions.
1476
+ # Accept cookie banners before actions and capture.
1492
1477
  dismiss_cookies: nil,
1493
- # Dismiss other popups before actions.
1478
+ # Close other popups before actions and capture.
1494
1479
  dismiss_popups: nil,
1495
- # Remove matching content. Exclusions win.
1480
+ # Remove elements matching these CSS selectors. Overrides `includeSelectors`.
1496
1481
  exclude_selectors: nil,
1497
- # Headers for the target origin. Requests with custom headers bypass caching.
1482
+ # HTTP headers to send to the target site. Requests with headers skip the cache.
1498
1483
  headers: nil,
1499
- # Include iframe content in extraction. Screenshots show visible frames
1500
- # regardless.
1484
+ # Include iframe content in HTML and text outputs. Screenshots always show visible
1485
+ # frames.
1501
1486
  include_frames: nil,
1502
- # Keep matching content after mainContentOnly.
1487
+ # Keep only elements matching these CSS selectors.
1503
1488
  include_selectors: nil,
1504
- # Keep only main content in HTML, Markdown, images, and parsed fields.
1489
+ # Keep only the main content. Doesn't affect `screenshot`, `bytes`, or `product`.
1505
1490
  main_content_only: nil,
1506
1491
  # Document parsing options.
1507
1492
  parsers: nil,
1508
- # Settle animations before capture. Defaults to true with screenshots, otherwise
1509
- # false.
1493
+ # Wait for CSS animations to finish before capture. Defaults to `true` when
1494
+ # `screenshot` is requested.
1510
1495
  settle_animations: nil,
1511
- # Override the browser color scheme.
1496
+ # Emulate a light or dark color scheme.
1512
1497
  theme: nil,
1513
- # Browser dimensions in pixels.
1498
+ # Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions
1499
+ # default to 1440 × 900.
1514
1500
  viewport: nil,
1515
- # After actions, wait this many milliseconds or until a CSS selector is visible.
1516
- # Defaults to 500 ms, or 2000 ms with frames or an XML URL. Set 0 to skip.
1501
+ # Milliseconds, or a CSS selector to wait for, after actions. Defaults to 500
1502
+ # (2000 with frames or XML).
1517
1503
  wait_for: nil
1518
1504
  )
1519
1505
  end
@@ -1572,16 +1558,23 @@ module ContextDev
1572
1558
  )
1573
1559
  end
1574
1560
 
1561
+ # One browser instruction, such as clicking a button or entering text.
1575
1562
  sig { returns(String) }
1576
1563
  attr_accessor :action
1577
1564
 
1565
+ # Use `perform` for a plain-language browser instruction.
1578
1566
  sig { returns(Symbol) }
1579
1567
  attr_accessor :type
1580
1568
 
1581
1569
  sig do
1582
1570
  params(action: String, type: Symbol).returns(T.attached_class)
1583
1571
  end
1584
- def self.new(action:, type: :perform)
1572
+ def self.new(
1573
+ # One browser instruction, such as clicking a button or entering text.
1574
+ action:,
1575
+ # Use `perform` for a plain-language browser instruction.
1576
+ type: :perform
1577
+ )
1585
1578
  end
1586
1579
 
1587
1580
  sig { override.returns({ action: String, type: Symbol }) }
@@ -1598,9 +1591,11 @@ module ContextDev
1598
1591
  )
1599
1592
  end
1600
1593
 
1594
+ # Use `scroll` to move through the page or a container.
1601
1595
  sig { returns(Symbol) }
1602
1596
  attr_accessor :type
1603
1597
 
1598
+ # Distance per scroll: pixels, one `viewport`, or `max` to reach the end.
1604
1599
  sig do
1605
1600
  returns(
1606
1601
  T.nilable(
@@ -1624,6 +1619,7 @@ module ContextDev
1624
1619
  end
1625
1620
  attr_writer :amount
1626
1621
 
1622
+ # Direction to scroll.
1627
1623
  sig do
1628
1624
  returns(
1629
1625
  T.nilable(
@@ -1641,6 +1637,7 @@ module ContextDev
1641
1637
  end
1642
1638
  attr_writer :direction
1643
1639
 
1640
+ # Maximum number of scroll steps for this action.
1644
1641
  sig { returns(T.nilable(Integer)) }
1645
1642
  attr_reader :max_scrolls
1646
1643
 
@@ -1669,11 +1666,15 @@ module ContextDev
1669
1666
  ).returns(T.attached_class)
1670
1667
  end
1671
1668
  def self.new(
1669
+ # Distance per scroll: pixels, one `viewport`, or `max` to reach the end.
1672
1670
  amount: nil,
1671
+ # Direction to scroll.
1673
1672
  direction: nil,
1673
+ # Maximum number of scroll steps for this action.
1674
1674
  max_scrolls: nil,
1675
1675
  # Scroll this container. Omit to scroll the page.
1676
1676
  selector: nil,
1677
+ # Use `scroll` to move through the page or a container.
1677
1678
  type: :scroll
1678
1679
  )
1679
1680
  end
@@ -1697,6 +1698,7 @@ module ContextDev
1697
1698
  def to_hash
1698
1699
  end
1699
1700
 
1701
+ # Distance per scroll: pixels, one `viewport`, or `max` to reach the end.
1700
1702
  module Amount
1701
1703
  extend ContextDev::Internal::Type::Union
1702
1704
 
@@ -1739,6 +1741,7 @@ module ContextDev
1739
1741
  )
1740
1742
  end
1741
1743
 
1744
+ # Direction to scroll.
1742
1745
  module Direction
1743
1746
  extend ContextDev::Internal::Type::Enum
1744
1747
 
@@ -1793,9 +1796,11 @@ module ContextDev
1793
1796
  )
1794
1797
  end
1795
1798
 
1799
+ # Time to pause in milliseconds before the next action.
1796
1800
  sig { returns(Integer) }
1797
1801
  attr_accessor :milliseconds
1798
1802
 
1803
+ # Use `wait` to pause for a fixed duration.
1799
1804
  sig { returns(Symbol) }
1800
1805
  attr_accessor :type
1801
1806
 
@@ -1804,7 +1809,12 @@ module ContextDev
1804
1809
  T.attached_class
1805
1810
  )
1806
1811
  end
1807
- def self.new(milliseconds:, type: :wait)
1812
+ def self.new(
1813
+ # Time to pause in milliseconds before the next action.
1814
+ milliseconds:,
1815
+ # Use `wait` to pause for a fixed duration.
1816
+ type: :wait
1817
+ )
1808
1818
  end
1809
1819
 
1810
1820
  sig { override.returns({ milliseconds: Integer, type: Symbol }) }
@@ -1821,16 +1831,23 @@ module ContextDev
1821
1831
  )
1822
1832
  end
1823
1833
 
1834
+ # CSS selector to wait for before continuing.
1824
1835
  sig { returns(String) }
1825
1836
  attr_accessor :selector
1826
1837
 
1838
+ # Use `waitFor` to wait for a matching element.
1827
1839
  sig { returns(Symbol) }
1828
1840
  attr_accessor :type
1829
1841
 
1830
1842
  sig do
1831
1843
  params(selector: String, type: Symbol).returns(T.attached_class)
1832
1844
  end
1833
- def self.new(selector:, type: :waitFor)
1845
+ def self.new(
1846
+ # CSS selector to wait for before continuing.
1847
+ selector:,
1848
+ # Use `waitFor` to wait for a matching element.
1849
+ type: :waitFor
1850
+ )
1834
1851
  end
1835
1852
 
1836
1853
  sig { override.returns({ selector: String, type: Symbol }) }
@@ -1858,7 +1875,7 @@ module ContextDev
1858
1875
  )
1859
1876
  end
1860
1877
 
1861
- # PDF text options for HTML, Markdown, and parsed fields.
1878
+ # PDF page range and OCR.
1862
1879
  sig do
1863
1880
  returns(
1864
1881
  T.nilable(ContextDev::WebScrapeParams::SharedParams::Parsers::Pdf)
@@ -1882,7 +1899,7 @@ module ContextDev
1882
1899
  ).returns(T.attached_class)
1883
1900
  end
1884
1901
  def self.new(
1885
- # PDF text options for HTML, Markdown, and parsed fields.
1902
+ # PDF page range and OCR.
1886
1903
  pdf: nil
1887
1904
  )
1888
1905
  end
@@ -1904,14 +1921,14 @@ module ContextDev
1904
1921
  )
1905
1922
  end
1906
1923
 
1907
- # Last page to parse. Must be at least startPage.
1924
+ # Last page to parse. Must be at least `startPage`.
1908
1925
  sig { returns(T.nilable(Integer)) }
1909
1926
  attr_reader :end_page
1910
1927
 
1911
1928
  sig { params(end_page: Integer).void }
1912
1929
  attr_writer :end_page
1913
1930
 
1914
- # Read text from scanned pages.
1931
+ # Set `auto` to read scanned pages with OCR.
1915
1932
  sig do
1916
1933
  returns(
1917
1934
  T.nilable(
@@ -1936,7 +1953,7 @@ module ContextDev
1936
1953
  sig { params(start_page: Integer).void }
1937
1954
  attr_writer :start_page
1938
1955
 
1939
- # PDF text options for HTML, Markdown, and parsed fields.
1956
+ # PDF page range and OCR.
1940
1957
  sig do
1941
1958
  params(
1942
1959
  end_page: Integer,
@@ -1946,9 +1963,9 @@ module ContextDev
1946
1963
  ).returns(T.attached_class)
1947
1964
  end
1948
1965
  def self.new(
1949
- # Last page to parse. Must be at least startPage.
1966
+ # Last page to parse. Must be at least `startPage`.
1950
1967
  end_page: nil,
1951
- # Read text from scanned pages.
1968
+ # Set `auto` to read scanned pages with OCR.
1952
1969
  ocr: nil,
1953
1970
  # First page to parse, starting at 1.
1954
1971
  start_page: nil
@@ -1968,7 +1985,7 @@ module ContextDev
1968
1985
  def to_hash
1969
1986
  end
1970
1987
 
1971
- # Read text from scanned pages.
1988
+ # Set `auto` to read scanned pages with OCR.
1972
1989
  module Ocr
1973
1990
  extend ContextDev::Internal::Type::Enum
1974
1991
 
@@ -2005,7 +2022,7 @@ module ContextDev
2005
2022
  end
2006
2023
  end
2007
2024
 
2008
- # Override the browser color scheme.
2025
+ # Emulate a light or dark color scheme.
2009
2026
  module Theme
2010
2027
  extend ContextDev::Internal::Type::Enum
2011
2028
 
@@ -2046,23 +2063,31 @@ module ContextDev
2046
2063
  )
2047
2064
  end
2048
2065
 
2066
+ # Browser viewport height in pixels.
2049
2067
  sig { returns(T.nilable(Integer)) }
2050
2068
  attr_reader :height
2051
2069
 
2052
2070
  sig { params(height: Integer).void }
2053
2071
  attr_writer :height
2054
2072
 
2073
+ # Browser viewport width in pixels.
2055
2074
  sig { returns(T.nilable(Integer)) }
2056
2075
  attr_reader :width
2057
2076
 
2058
2077
  sig { params(width: Integer).void }
2059
2078
  attr_writer :width
2060
2079
 
2061
- # Browser dimensions in pixels.
2080
+ # Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions
2081
+ # default to 1440 × 900.
2062
2082
  sig do
2063
2083
  params(height: Integer, width: Integer).returns(T.attached_class)
2064
2084
  end
2065
- def self.new(height: nil, width: nil)
2085
+ def self.new(
2086
+ # Browser viewport height in pixels.
2087
+ height: nil,
2088
+ # Browser viewport width in pixels.
2089
+ width: nil
2090
+ )
2066
2091
  end
2067
2092
 
2068
2093
  sig { override.returns({ height: Integer, width: Integer }) }
@@ -2070,8 +2095,8 @@ module ContextDev
2070
2095
  end
2071
2096
  end
2072
2097
 
2073
- # After actions, wait this many milliseconds or until a CSS selector is visible.
2074
- # Defaults to 500 ms, or 2000 ms with frames or an XML URL. Set 0 to skip.
2098
+ # Milliseconds, or a CSS selector to wait for, after actions. Defaults to 500
2099
+ # (2000 with frames or XML).
2075
2100
  module WaitFor
2076
2101
  extend ContextDev::Internal::Type::Union
2077
2102
 
@@ -2098,15 +2123,12 @@ module ContextDev
2098
2123
  )
2099
2124
  end
2100
2125
 
2101
- # Request deadline in milliseconds. Maximum: 300000 (5 minutes).
2126
+ # Deadline in milliseconds.
2102
2127
  sig { returns(Integer) }
2103
2128
  attr_accessor :milliseconds
2104
2129
 
2105
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
2106
- # credits. "return-partial" returns usable results collected so far; if none are
2107
- # available, the request still fails without charging credits. Partial results are
2108
- # not cached as complete results. "return-partial" requires milliseconds of at
2109
- # least 5000.
2130
+ # "fail" returns 408 at the deadline. "return-partial" returns available results;
2131
+ # inspect the response’s partial flag. "return-partial" requires at least 5000 ms.
2110
2132
  sig do
2111
2133
  returns(
2112
2134
  T.nilable(
@@ -2124,17 +2146,8 @@ module ContextDev
2124
2146
  end
2125
2147
  attr_writer :behavior
2126
2148
 
2127
- # Total deadline, including navigation, actions, waiting, and all outputs.
2128
- # Defaults to 60000 milliseconds with behavior fail. Individual outputs have
2129
- # internal deadlines that reserve time to return completed outputs; timed-out
2130
- # outputs have success: false and data: null under either behavior. The overall
2131
- # request deadline remains enforced: fail returns an error if that deadline is
2132
- # reached. Use return-partial to allow the current page state and available
2133
- # outputs when the page is still loading. Partial responses set isPartial. Failed
2134
- # retrievals and incomplete captures are not cached; valid captured pieces may be
2135
- # cached independently. Fixed waits must fit before a response reserve of up to
2136
- # 5000 milliseconds (at most one quarter of the timeout) when using
2137
- # return-partial.
2149
+ # Deadline for the whole request. Defaults to 60000 ms with `fail`. Fixed waits
2150
+ # must end before it.
2138
2151
  sig do
2139
2152
  params(
2140
2153
  milliseconds: Integer,
@@ -2143,13 +2156,10 @@ module ContextDev
2143
2156
  ).returns(T.attached_class)
2144
2157
  end
2145
2158
  def self.new(
2146
- # Request deadline in milliseconds. Maximum: 300000 (5 minutes).
2159
+ # Deadline in milliseconds.
2147
2160
  milliseconds:,
2148
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
2149
- # credits. "return-partial" returns usable results collected so far; if none are
2150
- # available, the request still fails without charging credits. Partial results are
2151
- # not cached as complete results. "return-partial" requires milliseconds of at
2152
- # least 5000.
2161
+ # "fail" returns 408 at the deadline. "return-partial" returns available results;
2162
+ # inspect the response’s partial flag. "return-partial" requires at least 5000 ms.
2153
2163
  behavior: nil
2154
2164
  )
2155
2165
  end
@@ -2166,11 +2176,8 @@ module ContextDev
2166
2176
  def to_hash
2167
2177
  end
2168
2178
 
2169
- # What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
2170
- # credits. "return-partial" returns usable results collected so far; if none are
2171
- # available, the request still fails without charging credits. Partial results are
2172
- # not cached as complete results. "return-partial" requires milliseconds of at
2173
- # least 5000.
2179
+ # "fail" returns 408 at the deadline. "return-partial" returns available results;
2180
+ # inspect the response’s partial flag. "return-partial" requires at least 5000 ms.
2174
2181
  module Behavior
2175
2182
  extend ContextDev::Internal::Type::Enum
2176
2183
 
@@ -2203,8 +2210,7 @@ module ContextDev
2203
2210
  end
2204
2211
  end
2205
2212
 
2206
- # Zero data retention. Bypasses caches and uploads; excludes request/response
2207
- # content and tags from logs. Must be enabled for your organization.
2213
+ # `enabled` turns on zero data retention. Your organization must have ZDR enabled.
2208
2214
  module Zdr
2209
2215
  extend ContextDev::Internal::Type::Enum
2210
2216