context.dev 2.3.0 → 2.5.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/README.md +9 -9
- data/lib/context_dev/models/ai_extract_product_params.rb +9 -1
- data/lib/context_dev/models/ai_extract_products_params.rb +18 -2
- data/lib/context_dev/models/brand_retrieve_params.rb +109 -22
- data/lib/context_dev/models/brand_retrieve_response.rb +4 -6
- data/lib/context_dev/models/brand_retrieve_simplified_params.rb +32 -3
- data/lib/context_dev/models/industry_retrieve_naics_params.rb +11 -1
- data/lib/context_dev/models/industry_retrieve_sic_params.rb +11 -1
- data/lib/context_dev/models/monitor_create_params.rb +6 -5
- data/lib/context_dev/models/monitor_create_response.rb +6 -5
- data/lib/context_dev/models/monitor_get_credit_usage_params.rb +30 -0
- data/lib/context_dev/models/monitor_get_credit_usage_response.rb +59 -0
- data/lib/context_dev/models/monitor_get_limits_params.rb +14 -0
- data/lib/context_dev/models/monitor_get_limits_response.rb +52 -0
- data/lib/context_dev/models/monitor_list_account_changes_params.rb +16 -7
- data/lib/context_dev/models/monitor_list_account_changes_response.rb +2 -1
- data/lib/context_dev/models/monitor_list_account_runs_params.rb +7 -10
- data/lib/context_dev/models/monitor_list_changes_params.rb +8 -4
- data/lib/context_dev/models/monitor_list_changes_response.rb +2 -1
- data/lib/context_dev/models/monitor_list_params.rb +18 -19
- data/lib/context_dev/models/monitor_list_response.rb +6 -5
- data/lib/context_dev/models/monitor_list_runs_params.rb +7 -10
- data/lib/context_dev/models/monitor_retrieve_change_response.rb +2 -1
- data/lib/context_dev/models/monitor_retrieve_response.rb +6 -5
- data/lib/context_dev/models/monitor_update_params.rb +6 -5
- data/lib/context_dev/models/monitor_update_response.rb +6 -5
- data/lib/context_dev/models/parse_handle_params.rb +296 -46
- data/lib/context_dev/models/utility_prefetch_params.rb +9 -1
- data/lib/context_dev/models/web_extract_competitors_params.rb +11 -1
- data/lib/context_dev/models/web_extract_fonts_params.rb +14 -4
- data/lib/context_dev/models/web_extract_params.rb +19 -1
- data/lib/context_dev/models/web_extract_styleguide_params.rb +14 -4
- data/lib/context_dev/models/web_screenshot_params.rb +69 -18
- data/lib/context_dev/models/web_screenshot_response.rb +3 -2
- data/lib/context_dev/models/web_search_params.rb +9 -1
- data/lib/context_dev/models/web_web_crawl_md_params.rb +34 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +268 -29
- data/lib/context_dev/models/web_web_scrape_images_params.rb +208 -19
- data/lib/context_dev/models/web_web_scrape_md_params.rb +352 -38
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +45 -1
- data/lib/context_dev/models.rb +4 -0
- data/lib/context_dev/resources/ai.rb +3 -1
- data/lib/context_dev/resources/brand.rb +6 -2
- data/lib/context_dev/resources/industry.rb +6 -2
- data/lib/context_dev/resources/monitors.rb +70 -32
- data/lib/context_dev/resources/parse.rb +11 -11
- data/lib/context_dev/resources/utility.rb +3 -1
- data/lib/context_dev/resources/web.rb +104 -55
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +4 -0
- data/rbi/context_dev/models/ai_extract_product_params.rbi +11 -0
- data/rbi/context_dev/models/ai_extract_products_params.rbi +22 -0
- data/rbi/context_dev/models/brand_retrieve_params.rbi +175 -64
- data/rbi/context_dev/models/brand_retrieve_response.rbi +8 -11
- data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +68 -5
- data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +15 -0
- data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +15 -0
- data/rbi/context_dev/models/monitor_create_params.rbi +6 -4
- data/rbi/context_dev/models/monitor_create_response.rbi +6 -4
- data/rbi/context_dev/models/monitor_get_credit_usage_params.rbi +60 -0
- data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +111 -0
- data/rbi/context_dev/models/monitor_get_limits_params.rbi +30 -0
- data/rbi/context_dev/models/monitor_get_limits_response.rbi +105 -0
- data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +16 -0
- data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +2 -0
- data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +7 -6
- data/rbi/context_dev/models/monitor_list_changes_params.rbi +8 -0
- data/rbi/context_dev/models/monitor_list_changes_response.rbi +2 -0
- data/rbi/context_dev/models/monitor_list_params.rbi +23 -31
- data/rbi/context_dev/models/monitor_list_response.rbi +6 -4
- data/rbi/context_dev/models/monitor_list_runs_params.rbi +7 -6
- data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +2 -0
- data/rbi/context_dev/models/monitor_retrieve_response.rbi +6 -4
- data/rbi/context_dev/models/monitor_update_params.rbi +6 -4
- data/rbi/context_dev/models/monitor_update_response.rbi +6 -4
- data/rbi/context_dev/models/parse_handle_params.rbi +601 -71
- data/rbi/context_dev/models/utility_prefetch_params.rbi +11 -0
- data/rbi/context_dev/models/web_extract_competitors_params.rbi +15 -0
- data/rbi/context_dev/models/web_extract_fonts_params.rbi +19 -7
- data/rbi/context_dev/models/web_extract_params.rbi +26 -0
- data/rbi/context_dev/models/web_extract_styleguide_params.rbi +19 -7
- data/rbi/context_dev/models/web_screenshot_params.rbi +108 -37
- data/rbi/context_dev/models/web_screenshot_response.rbi +4 -2
- data/rbi/context_dev/models/web_search_params.rbi +11 -0
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +53 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +554 -49
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +426 -30
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +742 -61
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +82 -0
- data/rbi/context_dev/models.rbi +4 -0
- data/rbi/context_dev/resources/ai.rbi +3 -0
- data/rbi/context_dev/resources/brand.rbi +9 -1
- data/rbi/context_dev/resources/industry.rbi +10 -0
- data/rbi/context_dev/resources/monitors.rbi +55 -11
- data/rbi/context_dev/resources/parse.rbi +44 -24
- data/rbi/context_dev/resources/utility.rbi +3 -0
- data/rbi/context_dev/resources/web.rbi +224 -48
- data/sig/context_dev/models/ai_extract_product_params.rbs +12 -1
- data/sig/context_dev/models/ai_extract_products_params.rbs +14 -0
- data/sig/context_dev/models/brand_retrieve_params.rbs +97 -51
- data/sig/context_dev/models/brand_retrieve_response.rbs +2 -2
- data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +34 -5
- data/sig/context_dev/models/industry_retrieve_naics_params.rbs +7 -0
- data/sig/context_dev/models/industry_retrieve_sic_params.rbs +7 -0
- data/sig/context_dev/models/monitor_get_credit_usage_params.rbs +32 -0
- data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +52 -0
- data/sig/context_dev/models/monitor_get_limits_params.rbs +15 -0
- data/sig/context_dev/models/monitor_get_limits_response.rbs +43 -0
- data/sig/context_dev/models/monitor_list_params.rbs +8 -14
- data/sig/context_dev/models/parse_handle_params.rbs +297 -50
- data/sig/context_dev/models/utility_prefetch_params.rbs +7 -0
- data/sig/context_dev/models/web_extract_competitors_params.rbs +12 -1
- data/sig/context_dev/models/web_extract_fonts_params.rbs +10 -5
- data/sig/context_dev/models/web_extract_params.rbs +14 -0
- data/sig/context_dev/models/web_extract_styleguide_params.rbs +10 -5
- data/sig/context_dev/models/web_screenshot_params.rbs +41 -20
- data/sig/context_dev/models/web_search_params.rbs +7 -0
- data/sig/context_dev/models/web_web_crawl_md_params.rbs +28 -1
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +175 -47
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +128 -38
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +229 -62
- data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +35 -1
- data/sig/context_dev/models.rbs +4 -0
- data/sig/context_dev/resources/ai.rbs +1 -0
- data/sig/context_dev/resources/brand.rbs +3 -1
- data/sig/context_dev/resources/industry.rbs +2 -0
- data/sig/context_dev/resources/monitors.rbs +12 -2
- data/sig/context_dev/resources/parse.rbs +10 -10
- data/sig/context_dev/resources/utility.rbs +1 -0
- data/sig/context_dev/resources/web.rbs +47 -26
- metadata +14 -2
|
@@ -17,7 +17,9 @@ module ContextDev
|
|
|
17
17
|
max_depth: Integer,
|
|
18
18
|
max_pages: Integer,
|
|
19
19
|
pdf: ContextDev::WebExtractParams::Pdf::OrHash,
|
|
20
|
+
settle_animations: T::Boolean,
|
|
20
21
|
stop_after_ms: Integer,
|
|
22
|
+
tags: T::Array[String],
|
|
21
23
|
timeout_ms: Integer,
|
|
22
24
|
wait_for_ms: Integer,
|
|
23
25
|
request_options: ContextDev::RequestOptions::OrHash
|
|
@@ -54,9 +56,15 @@ module ContextDev
|
|
|
54
56
|
# Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5.
|
|
55
57
|
max_pages: nil,
|
|
56
58
|
pdf: nil,
|
|
59
|
+
# When true, waits briefly for CSS and transition animations to settle before
|
|
60
|
+
# extracting each crawled page. Defaults to false. This adds a bit of latency in
|
|
61
|
+
# exchange for more stable output on animated pages.
|
|
62
|
+
settle_animations: nil,
|
|
57
63
|
# Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
|
|
58
64
|
# (110s). Default: 80000 (80s).
|
|
59
65
|
stop_after_ms: nil,
|
|
66
|
+
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
67
|
+
tags: nil,
|
|
60
68
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
61
69
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
62
70
|
# value is 300000ms (5 minutes).
|
|
@@ -74,6 +82,7 @@ module ContextDev
|
|
|
74
82
|
params(
|
|
75
83
|
domain: String,
|
|
76
84
|
num_competitors: Integer,
|
|
85
|
+
tags: T::Array[String],
|
|
77
86
|
timeout_ms: Integer,
|
|
78
87
|
request_options: ContextDev::RequestOptions::OrHash
|
|
79
88
|
).returns(ContextDev::Models::WebExtractCompetitorsResponse)
|
|
@@ -84,6 +93,10 @@ module ContextDev
|
|
|
84
93
|
domain:,
|
|
85
94
|
# Exact number of direct competitors to return. Defaults to 5.
|
|
86
95
|
num_competitors: nil,
|
|
96
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
97
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
98
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
99
|
+
tags: nil,
|
|
87
100
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
88
101
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
89
102
|
# value is 300000ms (5 minutes).
|
|
@@ -98,7 +111,8 @@ module ContextDev
|
|
|
98
111
|
params(
|
|
99
112
|
direct_url: String,
|
|
100
113
|
domain: String,
|
|
101
|
-
max_age_ms: Integer,
|
|
114
|
+
max_age_ms: T.nilable(Integer),
|
|
115
|
+
tags: T::Array[String],
|
|
102
116
|
timeout_ms: Integer,
|
|
103
117
|
request_options: ContextDev::RequestOptions::OrHash
|
|
104
118
|
).returns(ContextDev::Models::WebExtractFontsResponse)
|
|
@@ -112,11 +126,15 @@ module ContextDev
|
|
|
112
126
|
# domain will be automatically normalized and validated. You must provide either
|
|
113
127
|
# 'domain' or 'directUrl', but not both.
|
|
114
128
|
domain: nil,
|
|
115
|
-
# Maximum age in milliseconds for cached data before the API performs a hard
|
|
129
|
+
# Maximum age in milliseconds for cached brand data before the API performs a hard
|
|
116
130
|
# refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
|
|
117
131
|
# are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
|
|
118
132
|
# year.
|
|
119
133
|
max_age_ms: nil,
|
|
134
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
135
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
136
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
137
|
+
tags: nil,
|
|
120
138
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
121
139
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
122
140
|
# value is 300000ms (5 minutes).
|
|
@@ -133,7 +151,8 @@ module ContextDev
|
|
|
133
151
|
ContextDev::WebExtractStyleguideParams::ColorScheme::OrSymbol,
|
|
134
152
|
direct_url: String,
|
|
135
153
|
domain: String,
|
|
136
|
-
max_age_ms: Integer,
|
|
154
|
+
max_age_ms: T.nilable(Integer),
|
|
155
|
+
tags: T::Array[String],
|
|
137
156
|
timeout_ms: Integer,
|
|
138
157
|
request_options: ContextDev::RequestOptions::OrHash
|
|
139
158
|
).returns(ContextDev::Models::WebExtractStyleguideResponse)
|
|
@@ -151,11 +170,15 @@ module ContextDev
|
|
|
151
170
|
# domain will be automatically normalized and validated. You must provide either
|
|
152
171
|
# 'domain' or 'directUrl', but not both.
|
|
153
172
|
domain: nil,
|
|
154
|
-
# Maximum age in milliseconds for cached data before the API performs a hard
|
|
173
|
+
# Maximum age in milliseconds for cached brand data before the API performs a hard
|
|
155
174
|
# refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
|
|
156
175
|
# are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
|
|
157
176
|
# year.
|
|
158
177
|
max_age_ms: nil,
|
|
178
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
179
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
180
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
181
|
+
tags: nil,
|
|
159
182
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
160
183
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
161
184
|
# value is 300000ms (5 minutes).
|
|
@@ -174,13 +197,18 @@ module ContextDev
|
|
|
174
197
|
full_screenshot:
|
|
175
198
|
ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol,
|
|
176
199
|
handle_cookie_popup:
|
|
177
|
-
|
|
178
|
-
|
|
200
|
+
T.any(
|
|
201
|
+
T::Boolean,
|
|
202
|
+
ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol
|
|
203
|
+
),
|
|
204
|
+
max_age_ms: T.nilable(Integer),
|
|
179
205
|
page: ContextDev::WebScreenshotParams::Page::OrSymbol,
|
|
180
|
-
scroll_offset: Integer,
|
|
206
|
+
scroll_offset: T.nilable(Integer),
|
|
207
|
+
tags: T::Array[String],
|
|
181
208
|
timeout_ms: Integer,
|
|
182
209
|
viewport: ContextDev::WebScreenshotParams::Viewport::OrHash,
|
|
183
|
-
wait_for_ms: Integer,
|
|
210
|
+
wait_for_ms: T.nilable(Integer),
|
|
211
|
+
zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol,
|
|
184
212
|
request_options: ContextDev::RequestOptions::OrHash
|
|
185
213
|
).returns(ContextDev::Models::WebScreenshotResponse)
|
|
186
214
|
end
|
|
@@ -188,8 +216,9 @@ module ContextDev
|
|
|
188
216
|
# Optional parameter to choose the site's visual theme in the screenshot. Use
|
|
189
217
|
# 'light' or 'dark' when the site offers both appearances.
|
|
190
218
|
color_scheme: nil,
|
|
191
|
-
# Two-letter ISO 3166-1 alpha-2 country code
|
|
192
|
-
#
|
|
219
|
+
# Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
|
|
220
|
+
# residential proxy exit location. Must be one of Context.dev's supported
|
|
221
|
+
# countries. When provided, Context.dev fetches the target page from that country.
|
|
193
222
|
country: nil,
|
|
194
223
|
# A specific URL to screenshot directly, bypassing domain resolution (e.g.,
|
|
195
224
|
# 'https://example.com/pricing'). When provided, the screenshot is taken of this
|
|
@@ -224,6 +253,10 @@ module ContextDev
|
|
|
224
253
|
# top to bottom). The final slice may be shorter than the viewport height. Takes
|
|
225
254
|
# precedence over fullScreenshot. Max: 100000.
|
|
226
255
|
scroll_offset: nil,
|
|
256
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
257
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
258
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
259
|
+
tags: nil,
|
|
227
260
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
228
261
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
229
262
|
# value is 300000ms (5 minutes).
|
|
@@ -234,6 +267,11 @@ module ContextDev
|
|
|
234
267
|
# the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
|
|
235
268
|
# omitted.
|
|
236
269
|
wait_for_ms: nil,
|
|
270
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
271
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
272
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
273
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
274
|
+
zdr: nil,
|
|
237
275
|
request_options: {}
|
|
238
276
|
)
|
|
239
277
|
end
|
|
@@ -250,6 +288,7 @@ module ContextDev
|
|
|
250
288
|
ContextDev::WebSearchParams::MarkdownOptions::OrHash,
|
|
251
289
|
num_results: Integer,
|
|
252
290
|
query_fanout: T::Boolean,
|
|
291
|
+
tags: T::Array[String],
|
|
253
292
|
timeout_ms: Integer,
|
|
254
293
|
request_options: ContextDev::RequestOptions::OrHash
|
|
255
294
|
).returns(ContextDev::Models::WebSearchResponse)
|
|
@@ -275,6 +314,8 @@ module ContextDev
|
|
|
275
314
|
num_results: nil,
|
|
276
315
|
# Expand the query into multiple parallel variants for broader recall.
|
|
277
316
|
query_fanout: nil,
|
|
317
|
+
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
318
|
+
tags: nil,
|
|
278
319
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
279
320
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
280
321
|
# value is 300000ms (5 minutes).
|
|
@@ -302,10 +343,12 @@ module ContextDev
|
|
|
302
343
|
settle_animations: T::Boolean,
|
|
303
344
|
shorten_base64_images: T::Boolean,
|
|
304
345
|
stop_after_ms: Integer,
|
|
346
|
+
tags: T::Array[String],
|
|
305
347
|
timeout_ms: Integer,
|
|
306
348
|
url_regex: String,
|
|
307
349
|
use_main_content_only: T::Boolean,
|
|
308
350
|
wait_for_ms: Integer,
|
|
351
|
+
zdr: ContextDev::WebWebCrawlMdParams::Zdr::OrSymbol,
|
|
309
352
|
request_options: ContextDev::RequestOptions::OrHash
|
|
310
353
|
).returns(ContextDev::Models::WebWebCrawlMdResponse)
|
|
311
354
|
end
|
|
@@ -358,6 +401,8 @@ module ContextDev
|
|
|
358
401
|
# instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000
|
|
359
402
|
# (80s).
|
|
360
403
|
stop_after_ms: nil,
|
|
404
|
+
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
405
|
+
tags: nil,
|
|
361
406
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
362
407
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
363
408
|
# value is 300000ms (5 minutes).
|
|
@@ -370,33 +415,67 @@ module ContextDev
|
|
|
370
415
|
# Optional browser wait time in milliseconds after initial page load for each
|
|
371
416
|
# crawled page. Min: 0. Max: 30000 (30 seconds).
|
|
372
417
|
wait_for_ms: nil,
|
|
418
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
419
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
420
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
421
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
422
|
+
zdr: nil,
|
|
373
423
|
request_options: {}
|
|
374
424
|
)
|
|
375
425
|
end
|
|
376
426
|
|
|
377
|
-
# Scrapes the given URL and returns the raw HTML content of the page.
|
|
427
|
+
# Scrapes the given URL and returns the raw HTML content of the page. The base
|
|
428
|
+
# request costs 1 credit; requests with browser actions cost 2 credits.
|
|
378
429
|
sig do
|
|
379
430
|
params(
|
|
380
431
|
url: String,
|
|
432
|
+
actions:
|
|
433
|
+
T.nilable(
|
|
434
|
+
T::Array[
|
|
435
|
+
T.any(
|
|
436
|
+
ContextDev::WebWebScrapeHTMLParams::Action::Wait::OrHash,
|
|
437
|
+
ContextDev::WebWebScrapeHTMLParams::Action::Perform::OrHash
|
|
438
|
+
)
|
|
439
|
+
]
|
|
440
|
+
),
|
|
381
441
|
country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol,
|
|
382
|
-
exclude_selectors: T::Array[String],
|
|
442
|
+
exclude_selectors: T.nilable(T::Array[String]),
|
|
383
443
|
headers: T::Hash[Symbol, String],
|
|
384
|
-
include_frames:
|
|
385
|
-
|
|
386
|
-
|
|
444
|
+
include_frames:
|
|
445
|
+
T.any(
|
|
446
|
+
T::Boolean,
|
|
447
|
+
ContextDev::WebWebScrapeHTMLParams::IncludeFrames::OrSymbol
|
|
448
|
+
),
|
|
449
|
+
include_selectors: T.nilable(T::Array[String]),
|
|
450
|
+
max_age_ms: T.nilable(Integer),
|
|
387
451
|
pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash,
|
|
388
|
-
settle_animations:
|
|
452
|
+
settle_animations:
|
|
453
|
+
T.any(
|
|
454
|
+
T::Boolean,
|
|
455
|
+
ContextDev::WebWebScrapeHTMLParams::SettleAnimations::OrSymbol
|
|
456
|
+
),
|
|
457
|
+
tags: T::Array[String],
|
|
389
458
|
timeout_ms: Integer,
|
|
390
|
-
use_main_content_only:
|
|
391
|
-
|
|
459
|
+
use_main_content_only:
|
|
460
|
+
T.any(
|
|
461
|
+
T::Boolean,
|
|
462
|
+
ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol
|
|
463
|
+
),
|
|
464
|
+
wait_for_ms: T.nilable(Integer),
|
|
465
|
+
zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol,
|
|
392
466
|
request_options: ContextDev::RequestOptions::OrHash
|
|
393
467
|
).returns(ContextDev::Models::WebWebScrapeHTMLResponse)
|
|
394
468
|
end
|
|
395
469
|
def web_scrape_html(
|
|
396
470
|
# Full URL to scrape (must include http:// or https:// protocol)
|
|
397
471
|
url:,
|
|
398
|
-
#
|
|
399
|
-
#
|
|
472
|
+
# Optional browser actions executed in array order after the page loads and before
|
|
473
|
+
# content is captured. Requires a paid plan. Send a JSON array in the query
|
|
474
|
+
# parameter. Maximum: 5 actions.
|
|
475
|
+
actions: nil,
|
|
476
|
+
# Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
|
|
477
|
+
# residential proxy exit location. Must be one of Context.dev's supported
|
|
478
|
+
# countries. When provided, Context.dev fetches the target page from that country.
|
|
400
479
|
country: nil,
|
|
401
480
|
# CSS selectors to remove from the result. Applied after includeSelectors.
|
|
402
481
|
# Exclusion takes precedence: an element matching both is removed. Examples:
|
|
@@ -423,6 +502,10 @@ module ContextDev
|
|
|
423
502
|
# extracting HTML. Defaults to false. This adds a bit of latency in exchange for
|
|
424
503
|
# more stable output on animated pages.
|
|
425
504
|
settle_animations: nil,
|
|
505
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
506
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
507
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
508
|
+
tags: nil,
|
|
426
509
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
427
510
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
428
511
|
# value is 300000ms (5 minutes).
|
|
@@ -433,29 +516,54 @@ module ContextDev
|
|
|
433
516
|
# Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
|
|
434
517
|
# 30000 (30 seconds).
|
|
435
518
|
wait_for_ms: nil,
|
|
519
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
520
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
521
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
522
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
523
|
+
zdr: nil,
|
|
436
524
|
request_options: {}
|
|
437
525
|
)
|
|
438
526
|
end
|
|
439
527
|
|
|
440
528
|
# Extract image assets from a web page, including standard URLs, inline SVGs, data
|
|
441
529
|
# URIs, responsive image sources, metadata, CSS backgrounds, video posters, and
|
|
442
|
-
# embeds. The base request costs 1 credit
|
|
443
|
-
# call costs 5 credits
|
|
530
|
+
# embeds. The base request costs 1 credit, or 2 credits with browser actions. When
|
|
531
|
+
# enrichment is enabled, the entire call costs 5 credits, including requests that
|
|
532
|
+
# also use actions.
|
|
444
533
|
sig do
|
|
445
534
|
params(
|
|
446
535
|
url: String,
|
|
447
|
-
|
|
448
|
-
|
|
536
|
+
actions:
|
|
537
|
+
T.nilable(
|
|
538
|
+
T::Array[
|
|
539
|
+
T.any(
|
|
540
|
+
ContextDev::WebWebScrapeImagesParams::Action::Wait::OrHash,
|
|
541
|
+
ContextDev::WebWebScrapeImagesParams::Action::Perform::OrHash
|
|
542
|
+
)
|
|
543
|
+
]
|
|
544
|
+
),
|
|
545
|
+
dedupe:
|
|
546
|
+
T.any(
|
|
547
|
+
T::Boolean,
|
|
548
|
+
ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol
|
|
549
|
+
),
|
|
550
|
+
enrichment:
|
|
551
|
+
T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash),
|
|
449
552
|
headers: T::Hash[Symbol, String],
|
|
450
|
-
max_age_ms: Integer,
|
|
553
|
+
max_age_ms: T.nilable(Integer),
|
|
554
|
+
tags: T::Array[String],
|
|
451
555
|
timeout_ms: Integer,
|
|
452
|
-
wait_for_ms: Integer,
|
|
556
|
+
wait_for_ms: T.nilable(Integer),
|
|
453
557
|
request_options: ContextDev::RequestOptions::OrHash
|
|
454
558
|
).returns(ContextDev::Models::WebWebScrapeImagesResponse)
|
|
455
559
|
end
|
|
456
560
|
def web_scrape_images(
|
|
457
561
|
# Page URL to inspect. Must include http:// or https://.
|
|
458
562
|
url:,
|
|
563
|
+
# Optional browser actions executed in array order after the page loads and before
|
|
564
|
+
# content is captured. Requires a paid plan. Send a JSON array in the query
|
|
565
|
+
# parameter. Maximum: 5 actions.
|
|
566
|
+
actions: nil,
|
|
459
567
|
# When true, visually duplicate images are removed: every image is loaded and
|
|
460
568
|
# perceptually hashed, and only the highest-resolution copy of each duplicate
|
|
461
569
|
# group is kept. Images that cannot be downloaded or hashed are kept. Default:
|
|
@@ -471,6 +579,10 @@ module ContextDev
|
|
|
471
579
|
# Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
|
|
472
580
|
# day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
|
|
473
581
|
max_age_ms: nil,
|
|
582
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
583
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
584
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
585
|
+
tags: nil,
|
|
474
586
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
475
587
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
476
588
|
# value is 300000ms (5 minutes).
|
|
@@ -488,33 +600,68 @@ module ContextDev
|
|
|
488
600
|
#
|
|
489
601
|
# ### Billing & errors
|
|
490
602
|
#
|
|
491
|
-
# | HTTP status | Billed?
|
|
492
|
-
# | ----------- |
|
|
493
|
-
# | 200 | Yes — 1 credit | Successful scrape, including a zero-length result when includeSelectors matched nothing |
|
|
494
|
-
# | 400 | No
|
|
495
|
-
# | 401 / 403 | No
|
|
496
|
-
# | 404 | No
|
|
497
|
-
# | 408 | No
|
|
498
|
-
# | 415 | No
|
|
499
|
-
# | 429 | No
|
|
500
|
-
# | 500 | No
|
|
603
|
+
# | HTTP status | Billed? | Meaning |
|
|
604
|
+
# | ----------- | ----------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
605
|
+
# | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing |
|
|
606
|
+
# | 400 | No | Invalid input, skipped PDF, or the page could not be scraped |
|
|
607
|
+
# | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |
|
|
608
|
+
# | 404 | No | Target page returned or fingerprinted as not found |
|
|
609
|
+
# | 408 | No | Request timed out |
|
|
610
|
+
# | 415 | No | Unsupported content type |
|
|
611
|
+
# | 429 | No | Per-minute rate limit exceeded; honor Retry-After |
|
|
612
|
+
# | 500 | No | Internal error |
|
|
501
613
|
sig do
|
|
502
614
|
params(
|
|
503
615
|
url: String,
|
|
616
|
+
actions:
|
|
617
|
+
T.nilable(
|
|
618
|
+
T::Array[
|
|
619
|
+
T.any(
|
|
620
|
+
ContextDev::WebWebScrapeMdParams::Action::Wait::OrHash,
|
|
621
|
+
ContextDev::WebWebScrapeMdParams::Action::Perform::OrHash
|
|
622
|
+
)
|
|
623
|
+
]
|
|
624
|
+
),
|
|
504
625
|
country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol,
|
|
505
|
-
exclude_selectors: T::Array[String],
|
|
626
|
+
exclude_selectors: T.nilable(T::Array[String]),
|
|
506
627
|
headers: T::Hash[Symbol, String],
|
|
507
|
-
include_frames:
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
628
|
+
include_frames:
|
|
629
|
+
T.any(
|
|
630
|
+
T::Boolean,
|
|
631
|
+
ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol
|
|
632
|
+
),
|
|
633
|
+
include_images:
|
|
634
|
+
T.any(
|
|
635
|
+
T::Boolean,
|
|
636
|
+
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
637
|
+
),
|
|
638
|
+
include_links:
|
|
639
|
+
T.any(
|
|
640
|
+
T::Boolean,
|
|
641
|
+
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
642
|
+
),
|
|
643
|
+
include_selectors: T.nilable(T::Array[String]),
|
|
644
|
+
max_age_ms: T.nilable(Integer),
|
|
512
645
|
pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash,
|
|
513
|
-
settle_animations:
|
|
514
|
-
|
|
646
|
+
settle_animations:
|
|
647
|
+
T.any(
|
|
648
|
+
T::Boolean,
|
|
649
|
+
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
650
|
+
),
|
|
651
|
+
shorten_base64_images:
|
|
652
|
+
T.any(
|
|
653
|
+
T::Boolean,
|
|
654
|
+
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
655
|
+
),
|
|
656
|
+
tags: T::Array[String],
|
|
515
657
|
timeout_ms: Integer,
|
|
516
|
-
use_main_content_only:
|
|
517
|
-
|
|
658
|
+
use_main_content_only:
|
|
659
|
+
T.any(
|
|
660
|
+
T::Boolean,
|
|
661
|
+
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
662
|
+
),
|
|
663
|
+
wait_for_ms: T.nilable(Integer),
|
|
664
|
+
zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol,
|
|
518
665
|
request_options: ContextDev::RequestOptions::OrHash
|
|
519
666
|
).returns(ContextDev::Models::WebWebScrapeMdResponse)
|
|
520
667
|
end
|
|
@@ -522,8 +669,13 @@ module ContextDev
|
|
|
522
669
|
# Full URL to scrape into LLM usable Markdown (must include http:// or https://
|
|
523
670
|
# protocol)
|
|
524
671
|
url:,
|
|
525
|
-
#
|
|
526
|
-
#
|
|
672
|
+
# Optional browser actions executed in array order after the page loads and before
|
|
673
|
+
# content is captured. Requires a paid plan. Send a JSON array in the query
|
|
674
|
+
# parameter. Maximum: 5 actions.
|
|
675
|
+
actions: nil,
|
|
676
|
+
# Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
|
|
677
|
+
# residential proxy exit location. Must be one of Context.dev's supported
|
|
678
|
+
# countries. When provided, Context.dev fetches the target page from that country.
|
|
527
679
|
country: nil,
|
|
528
680
|
# CSS selectors to remove before conversion to Markdown. Applied after
|
|
529
681
|
# includeSelectors. Exclusion takes precedence: an element matching both is
|
|
@@ -556,6 +708,10 @@ module ContextDev
|
|
|
556
708
|
settle_animations: nil,
|
|
557
709
|
# Shorten base64-encoded image data in the Markdown output
|
|
558
710
|
shorten_base64_images: nil,
|
|
711
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
712
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
713
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
714
|
+
tags: nil,
|
|
559
715
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
560
716
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
561
717
|
# value is 300000ms (5 minutes).
|
|
@@ -566,6 +722,11 @@ module ContextDev
|
|
|
566
722
|
# Optional browser wait time in milliseconds after initial page load before
|
|
567
723
|
# converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
|
|
568
724
|
wait_for_ms: nil,
|
|
725
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
726
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
727
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
728
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
729
|
+
zdr: nil,
|
|
569
730
|
request_options: {}
|
|
570
731
|
)
|
|
571
732
|
end
|
|
@@ -576,8 +737,11 @@ module ContextDev
|
|
|
576
737
|
domain: String,
|
|
577
738
|
headers: T::Hash[Symbol, String],
|
|
578
739
|
max_links: Integer,
|
|
740
|
+
sitemap_url: String,
|
|
741
|
+
tags: T::Array[String],
|
|
579
742
|
timeout_ms: Integer,
|
|
580
743
|
url_regex: String,
|
|
744
|
+
zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol,
|
|
581
745
|
request_options: ContextDev::RequestOptions::OrHash
|
|
582
746
|
).returns(ContextDev::Models::WebWebScrapeSitemapResponse)
|
|
583
747
|
end
|
|
@@ -591,6 +755,13 @@ module ContextDev
|
|
|
591
755
|
# Maximum number of links to return from the sitemap crawl. Defaults to 10,000.
|
|
592
756
|
# Minimum is 1, maximum is 100,000.
|
|
593
757
|
max_links: nil,
|
|
758
|
+
# Optional explicit sitemap URL. When provided, exactly this sitemap is crawled
|
|
759
|
+
# instead of discovering the domain's sitemaps.
|
|
760
|
+
sitemap_url: nil,
|
|
761
|
+
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
762
|
+
# recorded on the request's usage log and can be used to filter usage on the
|
|
763
|
+
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
764
|
+
tags: nil,
|
|
594
765
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
595
766
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
596
767
|
# value is 300000ms (5 minutes).
|
|
@@ -598,6 +769,11 @@ module ContextDev
|
|
|
598
769
|
# Optional RE2-compatible regex pattern. Only URLs matching this pattern are
|
|
599
770
|
# returned and counted against maxLinks.
|
|
600
771
|
url_regex: nil,
|
|
772
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
773
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
774
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
775
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
776
|
+
zdr: nil,
|
|
601
777
|
request_options: {}
|
|
602
778
|
)
|
|
603
779
|
end
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
module ContextDev
|
|
2
2
|
module Models
|
|
3
3
|
type ai_extract_product_params =
|
|
4
|
-
{
|
|
4
|
+
{
|
|
5
|
+
url: String,
|
|
6
|
+
max_age_ms: Integer,
|
|
7
|
+
tags: ::Array[String],
|
|
8
|
+
timeout_ms: Integer
|
|
9
|
+
}
|
|
5
10
|
& ContextDev::Internal::Type::request_parameters
|
|
6
11
|
|
|
7
12
|
class AIExtractProductParams < ContextDev::Internal::Type::BaseModel
|
|
@@ -14,6 +19,10 @@ module ContextDev
|
|
|
14
19
|
|
|
15
20
|
def max_age_ms=: (Integer) -> Integer
|
|
16
21
|
|
|
22
|
+
attr_reader tags: ::Array[String]?
|
|
23
|
+
|
|
24
|
+
def tags=: (::Array[String]) -> ::Array[String]
|
|
25
|
+
|
|
17
26
|
attr_reader timeout_ms: Integer?
|
|
18
27
|
|
|
19
28
|
def timeout_ms=: (Integer) -> Integer
|
|
@@ -21,6 +30,7 @@ module ContextDev
|
|
|
21
30
|
def initialize: (
|
|
22
31
|
url: String,
|
|
23
32
|
?max_age_ms: Integer,
|
|
33
|
+
?tags: ::Array[String],
|
|
24
34
|
?timeout_ms: Integer,
|
|
25
35
|
?request_options: ContextDev::request_opts
|
|
26
36
|
) -> void
|
|
@@ -28,6 +38,7 @@ module ContextDev
|
|
|
28
38
|
def to_hash: -> {
|
|
29
39
|
url: String,
|
|
30
40
|
max_age_ms: Integer,
|
|
41
|
+
tags: ::Array[String],
|
|
31
42
|
timeout_ms: Integer,
|
|
32
43
|
request_options: ContextDev::RequestOptions
|
|
33
44
|
}
|
|
@@ -32,6 +32,7 @@ module ContextDev
|
|
|
32
32
|
domain: String,
|
|
33
33
|
max_age_ms: Integer,
|
|
34
34
|
max_products: Integer,
|
|
35
|
+
tags: ::Array[String],
|
|
35
36
|
timeout_ms: Integer
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -46,6 +47,10 @@ module ContextDev
|
|
|
46
47
|
|
|
47
48
|
def max_products=: (Integer) -> Integer
|
|
48
49
|
|
|
50
|
+
attr_reader tags: ::Array[String]?
|
|
51
|
+
|
|
52
|
+
def tags=: (::Array[String]) -> ::Array[String]
|
|
53
|
+
|
|
49
54
|
attr_reader timeout_ms: Integer?
|
|
50
55
|
|
|
51
56
|
def timeout_ms=: (Integer) -> Integer
|
|
@@ -54,6 +59,7 @@ module ContextDev
|
|
|
54
59
|
domain: String,
|
|
55
60
|
?max_age_ms: Integer,
|
|
56
61
|
?max_products: Integer,
|
|
62
|
+
?tags: ::Array[String],
|
|
57
63
|
?timeout_ms: Integer
|
|
58
64
|
) -> void
|
|
59
65
|
|
|
@@ -61,6 +67,7 @@ module ContextDev
|
|
|
61
67
|
domain: String,
|
|
62
68
|
max_age_ms: Integer,
|
|
63
69
|
max_products: Integer,
|
|
70
|
+
tags: ::Array[String],
|
|
64
71
|
timeout_ms: Integer
|
|
65
72
|
}
|
|
66
73
|
end
|
|
@@ -70,6 +77,7 @@ module ContextDev
|
|
|
70
77
|
direct_url: String,
|
|
71
78
|
max_age_ms: Integer,
|
|
72
79
|
max_products: Integer,
|
|
80
|
+
tags: ::Array[String],
|
|
73
81
|
timeout_ms: Integer
|
|
74
82
|
}
|
|
75
83
|
|
|
@@ -84,6 +92,10 @@ module ContextDev
|
|
|
84
92
|
|
|
85
93
|
def max_products=: (Integer) -> Integer
|
|
86
94
|
|
|
95
|
+
attr_reader tags: ::Array[String]?
|
|
96
|
+
|
|
97
|
+
def tags=: (::Array[String]) -> ::Array[String]
|
|
98
|
+
|
|
87
99
|
attr_reader timeout_ms: Integer?
|
|
88
100
|
|
|
89
101
|
def timeout_ms=: (Integer) -> Integer
|
|
@@ -92,6 +104,7 @@ module ContextDev
|
|
|
92
104
|
direct_url: String,
|
|
93
105
|
?max_age_ms: Integer,
|
|
94
106
|
?max_products: Integer,
|
|
107
|
+
?tags: ::Array[String],
|
|
95
108
|
?timeout_ms: Integer
|
|
96
109
|
) -> void
|
|
97
110
|
|
|
@@ -99,6 +112,7 @@ module ContextDev
|
|
|
99
112
|
direct_url: String,
|
|
100
113
|
max_age_ms: Integer,
|
|
101
114
|
max_products: Integer,
|
|
115
|
+
tags: ::Array[String],
|
|
102
116
|
timeout_ms: Integer
|
|
103
117
|
}
|
|
104
118
|
end
|