context.dev 2.9.0 → 2.10.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 +13 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +5 -0
- data/lib/context_dev/models/batch_get_results_response.rb +33 -3
- data/lib/context_dev/models/batch_submit_params.rb +44 -316
- data/lib/context_dev/models/brand_search_params.rb +41 -3
- data/lib/context_dev/models/news_search_params.rb +467 -0
- data/lib/context_dev/models/news_search_response.rb +238 -0
- data/lib/context_dev/models/parse_handle_params.rb +15 -144
- data/lib/context_dev/models/person_enrich_response.rb +61 -1
- data/lib/context_dev/models/utility_prefetch_params.rb +19 -16
- data/lib/context_dev/models/utility_prefetch_response.rb +4 -5
- data/lib/context_dev/models/web_screenshot_params.rb +3 -30
- data/lib/context_dev/models/web_web_crawl_md_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +15 -153
- data/lib/context_dev/models/web_web_scrape_html_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -124
- data/lib/context_dev/models/web_web_scrape_md_params.rb +35 -238
- data/lib/context_dev/models/web_web_scrape_md_response.rb +41 -2
- data/lib/context_dev/models.rb +2 -0
- data/lib/context_dev/resources/brand.rb +10 -11
- data/lib/context_dev/resources/news.rb +51 -0
- data/lib/context_dev/resources/parse.rb +5 -5
- data/lib/context_dev/resources/utility.rb +7 -6
- data/lib/context_dev/resources/web.rb +26 -23
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +3 -0
- data/rbi/context_dev/client.rbi +4 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +71 -2
- data/rbi/context_dev/models/batch_submit_params.rbi +58 -592
- data/rbi/context_dev/models/brand_search_params.rbi +71 -2
- data/rbi/context_dev/models/news_search_params.rbi +1294 -0
- data/rbi/context_dev/models/news_search_response.rbi +423 -0
- data/rbi/context_dev/models/parse_handle_params.rbi +20 -316
- data/rbi/context_dev/models/person_enrich_response.rbi +87 -0
- data/rbi/context_dev/models/utility_prefetch_params.rbi +24 -16
- data/rbi/context_dev/models/utility_prefetch_response.rbi +8 -6
- data/rbi/context_dev/models/web_screenshot_params.rbi +4 -71
- data/rbi/context_dev/models/web_web_crawl_md_response.rbi +67 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +20 -356
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +65 -0
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +16 -287
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +47 -551
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +80 -0
- data/rbi/context_dev/models.rbi +2 -0
- data/rbi/context_dev/resources/brand.rbi +14 -9
- data/rbi/context_dev/resources/news.rbi +46 -0
- data/rbi/context_dev/resources/parse.rbi +5 -21
- data/rbi/context_dev/resources/utility.rbi +8 -6
- data/rbi/context_dev/resources/web.rbi +27 -66
- data/sig/context_dev/client.rbs +2 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +21 -0
- data/sig/context_dev/models/batch_submit_params.rbs +54 -144
- data/sig/context_dev/models/brand_search_params.rbs +38 -1
- data/sig/context_dev/models/news_search_params.rbs +532 -0
- data/sig/context_dev/models/news_search_response.rbs +206 -0
- data/sig/context_dev/models/parse_handle_params.rbs +25 -90
- data/sig/context_dev/models/person_enrich_response.rbs +31 -0
- data/sig/context_dev/models/utility_prefetch_params.rbs +2 -1
- data/sig/context_dev/models/utility_prefetch_response.rbs +2 -1
- data/sig/context_dev/models/web_screenshot_params.rbs +5 -18
- data/sig/context_dev/models/web_web_crawl_md_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +24 -94
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +20 -72
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +46 -148
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +28 -0
- data/sig/context_dev/models.rbs +2 -0
- data/sig/context_dev/resources/brand.rbs +3 -0
- data/sig/context_dev/resources/news.rbs +17 -0
- data/sig/context_dev/resources/parse.rbs +5 -5
- data/sig/context_dev/resources/web.rbs +12 -11
- metadata +11 -2
|
@@ -72,6 +72,15 @@ module ContextDev
|
|
|
72
72
|
sig { params(actions_html_stale: T::Boolean).void }
|
|
73
73
|
attr_writer :actions_html_stale
|
|
74
74
|
|
|
75
|
+
# Only present when includeHTML=true: the page HTML the Markdown was converted
|
|
76
|
+
# from — the same body the Scrape HTML endpoint returns for the equivalent
|
|
77
|
+
# request.
|
|
78
|
+
sig { returns(T.nilable(String)) }
|
|
79
|
+
attr_reader :html
|
|
80
|
+
|
|
81
|
+
sig { params(html: String).void }
|
|
82
|
+
attr_writer :html
|
|
83
|
+
|
|
75
84
|
# Metadata about the API key used for the request. Included in every response
|
|
76
85
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
77
86
|
sig do
|
|
@@ -103,6 +112,7 @@ module ContextDev
|
|
|
103
112
|
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::OrHash
|
|
104
113
|
],
|
|
105
114
|
actions_html_stale: T::Boolean,
|
|
115
|
+
html: String,
|
|
106
116
|
key_metadata:
|
|
107
117
|
ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata::OrHash
|
|
108
118
|
).returns(T.attached_class)
|
|
@@ -125,6 +135,10 @@ module ContextDev
|
|
|
125
135
|
# True when an action was applied but the returned content could not be refreshed
|
|
126
136
|
# afterward.
|
|
127
137
|
actions_html_stale: nil,
|
|
138
|
+
# Only present when includeHTML=true: the page HTML the Markdown was converted
|
|
139
|
+
# from — the same body the Scrape HTML endpoint returns for the equivalent
|
|
140
|
+
# request.
|
|
141
|
+
html: nil,
|
|
128
142
|
# Metadata about the API key used for the request. Included in every response
|
|
129
143
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
130
144
|
key_metadata: nil
|
|
@@ -145,6 +159,7 @@ module ContextDev
|
|
|
145
159
|
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied
|
|
146
160
|
],
|
|
147
161
|
actions_html_stale: T::Boolean,
|
|
162
|
+
html: String,
|
|
148
163
|
key_metadata:
|
|
149
164
|
ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata
|
|
150
165
|
}
|
|
@@ -245,6 +260,29 @@ module ContextDev
|
|
|
245
260
|
sig { params(favicon: String).void }
|
|
246
261
|
attr_writer :favicon
|
|
247
262
|
|
|
263
|
+
# Page headings (h1–h6) in document order, extracted from the unfiltered document.
|
|
264
|
+
# Capped at the first 500 headings. Omitted when the page has none.
|
|
265
|
+
sig do
|
|
266
|
+
returns(
|
|
267
|
+
T.nilable(
|
|
268
|
+
T::Array[
|
|
269
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading
|
|
270
|
+
]
|
|
271
|
+
)
|
|
272
|
+
)
|
|
273
|
+
end
|
|
274
|
+
attr_reader :headings
|
|
275
|
+
|
|
276
|
+
sig do
|
|
277
|
+
params(
|
|
278
|
+
headings:
|
|
279
|
+
T::Array[
|
|
280
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading::OrHash
|
|
281
|
+
]
|
|
282
|
+
).void
|
|
283
|
+
end
|
|
284
|
+
attr_writer :headings
|
|
285
|
+
|
|
248
286
|
# Primary resolved preview image from Open Graph, Twitter, or image metadata.
|
|
249
287
|
sig { returns(T.nilable(String)) }
|
|
250
288
|
attr_reader :image
|
|
@@ -374,6 +412,10 @@ module ContextDev
|
|
|
374
412
|
canonical_url: String,
|
|
375
413
|
description: String,
|
|
376
414
|
favicon: String,
|
|
415
|
+
headings:
|
|
416
|
+
T::Array[
|
|
417
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading::OrHash
|
|
418
|
+
],
|
|
377
419
|
image: String,
|
|
378
420
|
json_ld: T::Array[T::Hash[Symbol, T.anything]],
|
|
379
421
|
keywords: T::Array[String],
|
|
@@ -413,6 +455,9 @@ module ContextDev
|
|
|
413
455
|
description: nil,
|
|
414
456
|
# Resolved favicon URL, when present.
|
|
415
457
|
favicon: nil,
|
|
458
|
+
# Page headings (h1–h6) in document order, extracted from the unfiltered document.
|
|
459
|
+
# Capped at the first 500 headings. Omitted when the page has none.
|
|
460
|
+
headings: nil,
|
|
416
461
|
# Primary resolved preview image from Open Graph, Twitter, or image metadata.
|
|
417
462
|
image: nil,
|
|
418
463
|
# JSON-LD structured data blocks parsed from the page.
|
|
@@ -456,6 +501,10 @@ module ContextDev
|
|
|
456
501
|
canonical_url: String,
|
|
457
502
|
description: String,
|
|
458
503
|
favicon: String,
|
|
504
|
+
headings:
|
|
505
|
+
T::Array[
|
|
506
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading
|
|
507
|
+
],
|
|
459
508
|
image: String,
|
|
460
509
|
json_ld: T::Array[T::Hash[Symbol, T.anything]],
|
|
461
510
|
keywords: T::Array[String],
|
|
@@ -566,6 +615,37 @@ module ContextDev
|
|
|
566
615
|
end
|
|
567
616
|
end
|
|
568
617
|
|
|
618
|
+
class Heading < ContextDev::Internal::Type::BaseModel
|
|
619
|
+
OrHash =
|
|
620
|
+
T.type_alias do
|
|
621
|
+
T.any(
|
|
622
|
+
ContextDev::Models::WebWebScrapeMdResponse::Metadata::Heading,
|
|
623
|
+
ContextDev::Internal::AnyHash
|
|
624
|
+
)
|
|
625
|
+
end
|
|
626
|
+
|
|
627
|
+
# Heading level, 1–6 (from h1–h6).
|
|
628
|
+
sig { returns(Integer) }
|
|
629
|
+
attr_accessor :level
|
|
630
|
+
|
|
631
|
+
# Heading text with whitespace collapsed, truncated to 1000 characters.
|
|
632
|
+
sig { returns(String) }
|
|
633
|
+
attr_accessor :text
|
|
634
|
+
|
|
635
|
+
sig { params(level: Integer, text: String).returns(T.attached_class) }
|
|
636
|
+
def self.new(
|
|
637
|
+
# Heading level, 1–6 (from h1–h6).
|
|
638
|
+
level:,
|
|
639
|
+
# Heading text with whitespace collapsed, truncated to 1000 characters.
|
|
640
|
+
text:
|
|
641
|
+
)
|
|
642
|
+
end
|
|
643
|
+
|
|
644
|
+
sig { override.returns({ level: Integer, text: String }) }
|
|
645
|
+
def to_hash
|
|
646
|
+
end
|
|
647
|
+
end
|
|
648
|
+
|
|
569
649
|
module OpenGraph
|
|
570
650
|
extend ContextDev::Internal::Type::Union
|
|
571
651
|
|
data/rbi/context_dev/models.rbi
CHANGED
|
@@ -62,6 +62,8 @@ module ContextDev
|
|
|
62
62
|
|
|
63
63
|
MonitorUpdateParams = ContextDev::Models::MonitorUpdateParams
|
|
64
64
|
|
|
65
|
+
NewsSearchParams = ContextDev::Models::NewsSearchParams
|
|
66
|
+
|
|
65
67
|
PageErrorCount = ContextDev::Models::PageErrorCount
|
|
66
68
|
|
|
67
69
|
ParseHandleParams = ContextDev::Models::ParseHandleParams
|
|
@@ -64,29 +64,34 @@ module ContextDev
|
|
|
64
64
|
)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
# Search brands by name or domain
|
|
68
|
-
# (domain, name, logo). Name matches rank ahead of domain matches; within each
|
|
69
|
-
# group the most popular brands come first: by Tranco rank, then market cap for
|
|
70
|
-
# brands outside the Tranco list, with text relevance breaking ties. Matching is
|
|
71
|
-
# prefix-based with no typo tolerance, so it is suited to autocomplete. Only
|
|
72
|
-
# brands already in the Context.dev index are returned — use /brand/retrieve to
|
|
73
|
-
# fetch (and index) a specific domain. Free on Pro and Scale plans; costs 1 credit
|
|
74
|
-
# per request on the Free and Starter plans.
|
|
67
|
+
# Search indexed brands by name or domain
|
|
75
68
|
sig do
|
|
76
69
|
params(
|
|
77
70
|
query: String,
|
|
71
|
+
autocomplete: T::Boolean,
|
|
72
|
+
query_by: T::Array[ContextDev::BrandSearchParams::QueryBy::OrSymbol],
|
|
78
73
|
tags: T::Array[String],
|
|
74
|
+
typo_tolerance: Integer,
|
|
79
75
|
request_options: ContextDev::RequestOptions::OrHash
|
|
80
76
|
).returns(ContextDev::Models::BrandSearchResponse)
|
|
81
77
|
end
|
|
82
78
|
def search(
|
|
83
|
-
# Search term, matched against
|
|
79
|
+
# Search term, matched against the fields selected by queryBy (e.g. 'nike',
|
|
84
80
|
# 'nike.com', 'nik').
|
|
85
81
|
query:,
|
|
82
|
+
# Whether the search term matches by prefix, so partial words match as they are
|
|
83
|
+
# typed (e.g. 'nik' matches Nike). Set to false to match whole words only.
|
|
84
|
+
autocomplete: nil,
|
|
85
|
+
# Fields to match the search term against, as a comma-separated list or repeated
|
|
86
|
+
# parameter: 'name', 'domain', or both. Defaults to both.
|
|
87
|
+
query_by: nil,
|
|
86
88
|
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
87
89
|
# recorded on the request's usage log and can be used to filter usage on the
|
|
88
90
|
# dashboard usage page. Up to 20 tags, each 1-50 characters.
|
|
89
91
|
tags: nil,
|
|
92
|
+
# Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no
|
|
93
|
+
# typo tolerance).
|
|
94
|
+
typo_tolerance: nil,
|
|
90
95
|
request_options: {}
|
|
91
96
|
)
|
|
92
97
|
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Resources
|
|
5
|
+
# Search live first-party RSS and free historical news data by company identity.
|
|
6
|
+
class News
|
|
7
|
+
# Searches live and historical company news for one company, identified in
|
|
8
|
+
# searchBy by name, domain, ticker (optionally disambiguated by exchange), or
|
|
9
|
+
# ISIN. Results can be filtered by publisher domain, publisher country, article
|
|
10
|
+
# language, article type, and published-at date, and include stable story IDs,
|
|
11
|
+
# source metadata, verified entity relevance, and cursor pagination.
|
|
12
|
+
sig do
|
|
13
|
+
params(
|
|
14
|
+
search_by: ContextDev::NewsSearchParams::SearchBy::OrHash,
|
|
15
|
+
cursor: T.nilable(String),
|
|
16
|
+
filter_by: ContextDev::NewsSearchParams::FilterBy::OrHash,
|
|
17
|
+
limit: Integer,
|
|
18
|
+
sort_by: ContextDev::NewsSearchParams::SortBy::OrHash,
|
|
19
|
+
tags: T::Array[String],
|
|
20
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
21
|
+
).returns(ContextDev::Models::NewsSearchResponse)
|
|
22
|
+
end
|
|
23
|
+
def search(
|
|
24
|
+
# What to search for.
|
|
25
|
+
search_by:,
|
|
26
|
+
# Opaque next_cursor from the previous response, or null for the first page.
|
|
27
|
+
cursor: nil,
|
|
28
|
+
# Optional result filters.
|
|
29
|
+
filter_by: nil,
|
|
30
|
+
# Maximum results to return. Defaults to 10.
|
|
31
|
+
limit: nil,
|
|
32
|
+
# Result ordering. Defaults to newest.
|
|
33
|
+
sort_by: nil,
|
|
34
|
+
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
35
|
+
tags: nil,
|
|
36
|
+
request_options: {}
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# @api private
|
|
41
|
+
sig { params(client: ContextDev::Client).returns(T.attached_class) }
|
|
42
|
+
def self.new(client:)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -10,29 +10,13 @@ module ContextDev
|
|
|
10
10
|
body: ContextDev::Internal::FileInput,
|
|
11
11
|
client: String,
|
|
12
12
|
extension: ContextDev::ParseHandleParams::Extension::OrSymbol,
|
|
13
|
-
include_images:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ContextDev::ParseHandleParams::IncludeImages::OrSymbol
|
|
17
|
-
),
|
|
18
|
-
include_links:
|
|
19
|
-
T.any(
|
|
20
|
-
T::Boolean,
|
|
21
|
-
ContextDev::ParseHandleParams::IncludeLinks::OrSymbol
|
|
22
|
-
),
|
|
23
|
-
ocr: T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::OrSymbol),
|
|
13
|
+
include_images: T::Boolean,
|
|
14
|
+
include_links: T::Boolean,
|
|
15
|
+
ocr: T::Boolean,
|
|
24
16
|
pdf: ContextDev::ParseHandleParams::Pdf::OrHash,
|
|
25
|
-
shorten_base64_images:
|
|
26
|
-
T.any(
|
|
27
|
-
T::Boolean,
|
|
28
|
-
ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol
|
|
29
|
-
),
|
|
17
|
+
shorten_base64_images: T::Boolean,
|
|
30
18
|
tags: T::Array[String],
|
|
31
|
-
use_main_content_only:
|
|
32
|
-
T.any(
|
|
33
|
-
T::Boolean,
|
|
34
|
-
ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol
|
|
35
|
-
),
|
|
19
|
+
use_main_content_only: T::Boolean,
|
|
36
20
|
zdr: ContextDev::ParseHandleParams::Zdr::OrSymbol,
|
|
37
21
|
request_options: ContextDev::RequestOptions::OrHash
|
|
38
22
|
).returns(ContextDev::Models::ParseHandleResponse)
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Resources
|
|
5
5
|
class Utility
|
|
6
|
-
# Signal that you may fetch
|
|
7
|
-
#
|
|
8
|
-
# one lookup key: a domain,
|
|
9
|
-
#
|
|
6
|
+
# Signal that you may fetch data soon to improve latency. The type field selects
|
|
7
|
+
# what to prefetch ('brand' queues a brand data fetch, 'styleguide' queues a
|
|
8
|
+
# styleguide extraction) and identifier carries exactly one lookup key: a domain,
|
|
9
|
+
# or an email whose domain is extracted and validated (free email providers and
|
|
10
|
+
# disposable email addresses are not allowed).
|
|
10
11
|
sig do
|
|
11
12
|
params(
|
|
12
13
|
identifier:
|
|
@@ -21,9 +22,10 @@ module ContextDev
|
|
|
21
22
|
).returns(ContextDev::Models::UtilityPrefetchResponse)
|
|
22
23
|
end
|
|
23
24
|
def prefetch(
|
|
24
|
-
# Identifier of the
|
|
25
|
+
# Identifier of the target to prefetch. Provide exactly one of domain or email.
|
|
25
26
|
identifier:,
|
|
26
|
-
# What to prefetch
|
|
27
|
+
# What to prefetch: 'brand' warms the brand data cache, 'styleguide' warms the
|
|
28
|
+
# styleguide cache.
|
|
27
29
|
type:,
|
|
28
30
|
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
29
31
|
tags: nil,
|
|
@@ -196,11 +196,7 @@ module ContextDev
|
|
|
196
196
|
domain: String,
|
|
197
197
|
full_screenshot:
|
|
198
198
|
ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol,
|
|
199
|
-
handle_cookie_popup:
|
|
200
|
-
T.any(
|
|
201
|
-
T::Boolean,
|
|
202
|
-
ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol
|
|
203
|
-
),
|
|
199
|
+
handle_cookie_popup: T::Boolean,
|
|
204
200
|
max_age_ms: T.nilable(Integer),
|
|
205
201
|
page: ContextDev::WebScreenshotParams::Page::OrSymbol,
|
|
206
202
|
scroll_offset: T.nilable(Integer),
|
|
@@ -439,26 +435,14 @@ module ContextDev
|
|
|
439
435
|
country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol,
|
|
440
436
|
exclude_selectors: T.nilable(T::Array[String]),
|
|
441
437
|
headers: T::Hash[Symbol, String],
|
|
442
|
-
include_frames:
|
|
443
|
-
T.any(
|
|
444
|
-
T::Boolean,
|
|
445
|
-
ContextDev::WebWebScrapeHTMLParams::IncludeFrames::OrSymbol
|
|
446
|
-
),
|
|
438
|
+
include_frames: T::Boolean,
|
|
447
439
|
include_selectors: T.nilable(T::Array[String]),
|
|
448
440
|
max_age_ms: T.nilable(Integer),
|
|
449
441
|
pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash,
|
|
450
|
-
settle_animations:
|
|
451
|
-
T.any(
|
|
452
|
-
T::Boolean,
|
|
453
|
-
ContextDev::WebWebScrapeHTMLParams::SettleAnimations::OrSymbol
|
|
454
|
-
),
|
|
442
|
+
settle_animations: T::Boolean,
|
|
455
443
|
tags: T::Array[String],
|
|
456
444
|
timeout_ms: Integer,
|
|
457
|
-
use_main_content_only:
|
|
458
|
-
T.any(
|
|
459
|
-
T::Boolean,
|
|
460
|
-
ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol
|
|
461
|
-
),
|
|
445
|
+
use_main_content_only: T::Boolean,
|
|
462
446
|
wait_for_ms: T.nilable(Integer),
|
|
463
447
|
zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol,
|
|
464
448
|
request_options: ContextDev::RequestOptions::OrHash
|
|
@@ -539,11 +523,7 @@ module ContextDev
|
|
|
539
523
|
)
|
|
540
524
|
]
|
|
541
525
|
),
|
|
542
|
-
dedupe:
|
|
543
|
-
T.any(
|
|
544
|
-
T::Boolean,
|
|
545
|
-
ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol
|
|
546
|
-
),
|
|
526
|
+
dedupe: T::Boolean,
|
|
547
527
|
enrichment:
|
|
548
528
|
T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash),
|
|
549
529
|
headers: T::Hash[Symbol, String],
|
|
@@ -609,17 +589,17 @@ module ContextDev
|
|
|
609
589
|
#
|
|
610
590
|
# ### Billing & errors
|
|
611
591
|
#
|
|
612
|
-
# | HTTP status | Billed? | Meaning
|
|
613
|
-
# | ----------- | ----------------------------------------- |
|
|
614
|
-
# | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing
|
|
615
|
-
# | 400 | No | Invalid input, skipped PDF, or the page could not be scraped
|
|
616
|
-
# | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code
|
|
617
|
-
# | 404 | No | Target page returned or fingerprinted as not found
|
|
618
|
-
# | 408 | No | Request timed out
|
|
619
|
-
# | 413 | No | Target content exceeds the maximum supported size (20 MB)
|
|
620
|
-
# | 415 | No | Unsupported content type
|
|
621
|
-
# | 429 | No | Per-minute rate limit exceeded; honor Retry-After
|
|
622
|
-
# | 500 | No | Internal error
|
|
592
|
+
# | HTTP status | Billed? | Meaning |
|
|
593
|
+
# | ----------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
594
|
+
# | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing |
|
|
595
|
+
# | 400 | No | Invalid input, skipped PDF, or the page could not be scraped. error_code WEBSITE_BLOCKED specifically means the site answered with an anti-bot challenge, CAPTCHA wall, or login shell instead of the page (even when the site returned HTTP 200) — retrying later or from another country sometimes succeeds |
|
|
596
|
+
# | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |
|
|
597
|
+
# | 404 | No | Target page returned or fingerprinted as not found |
|
|
598
|
+
# | 408 | No | Request timed out |
|
|
599
|
+
# | 413 | No | Target content exceeds the maximum supported size (20 MB) |
|
|
600
|
+
# | 415 | No | Unsupported content type |
|
|
601
|
+
# | 429 | No | Per-minute rate limit exceeded; honor Retry-After |
|
|
602
|
+
# | 500 | No | Internal error |
|
|
623
603
|
sig do
|
|
624
604
|
params(
|
|
625
605
|
url: String,
|
|
@@ -635,41 +615,18 @@ module ContextDev
|
|
|
635
615
|
country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol,
|
|
636
616
|
exclude_selectors: T.nilable(T::Array[String]),
|
|
637
617
|
headers: T::Hash[Symbol, String],
|
|
638
|
-
include_frames:
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
),
|
|
643
|
-
include_images:
|
|
644
|
-
T.any(
|
|
645
|
-
T::Boolean,
|
|
646
|
-
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
647
|
-
),
|
|
648
|
-
include_links:
|
|
649
|
-
T.any(
|
|
650
|
-
T::Boolean,
|
|
651
|
-
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
652
|
-
),
|
|
618
|
+
include_frames: T::Boolean,
|
|
619
|
+
include_html: T::Boolean,
|
|
620
|
+
include_images: T::Boolean,
|
|
621
|
+
include_links: T::Boolean,
|
|
653
622
|
include_selectors: T.nilable(T::Array[String]),
|
|
654
623
|
max_age_ms: T.nilable(Integer),
|
|
655
624
|
pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash,
|
|
656
|
-
settle_animations:
|
|
657
|
-
|
|
658
|
-
T::Boolean,
|
|
659
|
-
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
660
|
-
),
|
|
661
|
-
shorten_base64_images:
|
|
662
|
-
T.any(
|
|
663
|
-
T::Boolean,
|
|
664
|
-
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
665
|
-
),
|
|
625
|
+
settle_animations: T::Boolean,
|
|
626
|
+
shorten_base64_images: T::Boolean,
|
|
666
627
|
tags: T::Array[String],
|
|
667
628
|
timeout_ms: Integer,
|
|
668
|
-
use_main_content_only:
|
|
669
|
-
T.any(
|
|
670
|
-
T::Boolean,
|
|
671
|
-
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
672
|
-
),
|
|
629
|
+
use_main_content_only: T::Boolean,
|
|
673
630
|
wait_for_ms: T.nilable(Integer),
|
|
674
631
|
zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol,
|
|
675
632
|
request_options: ContextDev::RequestOptions::OrHash
|
|
@@ -696,6 +653,10 @@ module ContextDev
|
|
|
696
653
|
headers: nil,
|
|
697
654
|
# When true, the contents of iframes are rendered to Markdown.
|
|
698
655
|
include_frames: nil,
|
|
656
|
+
# When true, the response also includes an `html` field with the page HTML the
|
|
657
|
+
# Markdown was converted from — the same body the Scrape HTML endpoint returns for
|
|
658
|
+
# the equivalent request.
|
|
659
|
+
include_html: nil,
|
|
699
660
|
# Include image references in Markdown output
|
|
700
661
|
include_images: nil,
|
|
701
662
|
# Preserve hyperlinks in Markdown output
|
data/sig/context_dev/client.rbs
CHANGED
|
@@ -129,6 +129,7 @@ module ContextDev
|
|
|
129
129
|
canonical_url: String,
|
|
130
130
|
description: String,
|
|
131
131
|
favicon: String,
|
|
132
|
+
headings: ::Array[ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata::Heading],
|
|
132
133
|
image: String,
|
|
133
134
|
json_ld: ::Array[::Hash[Symbol, top]],
|
|
134
135
|
keywords: ::Array[String],
|
|
@@ -175,6 +176,12 @@ module ContextDev
|
|
|
175
176
|
|
|
176
177
|
def favicon=: (String) -> String
|
|
177
178
|
|
|
179
|
+
attr_reader headings: ::Array[ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata::Heading]?
|
|
180
|
+
|
|
181
|
+
def headings=: (
|
|
182
|
+
::Array[ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata::Heading]
|
|
183
|
+
) -> ::Array[ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata::Heading]
|
|
184
|
+
|
|
178
185
|
attr_reader image: String?
|
|
179
186
|
|
|
180
187
|
def image=: (String) -> String
|
|
@@ -234,6 +241,7 @@ module ContextDev
|
|
|
234
241
|
?canonical_url: String,
|
|
235
242
|
?description: String,
|
|
236
243
|
?favicon: String,
|
|
244
|
+
?headings: ::Array[ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata::Heading],
|
|
237
245
|
?image: String,
|
|
238
246
|
?json_ld: ::Array[::Hash[Symbol, top]],
|
|
239
247
|
?keywords: ::Array[String],
|
|
@@ -256,6 +264,7 @@ module ContextDev
|
|
|
256
264
|
canonical_url: String,
|
|
257
265
|
description: String,
|
|
258
266
|
favicon: String,
|
|
267
|
+
headings: ::Array[ContextDev::Models::BatchGetResultsResponse::Data::Ok::Metadata::Heading],
|
|
259
268
|
image: String,
|
|
260
269
|
json_ld: ::Array[::Hash[Symbol, top]],
|
|
261
270
|
keywords: ::Array[String],
|
|
@@ -312,6 +321,18 @@ module ContextDev
|
|
|
312
321
|
}
|
|
313
322
|
end
|
|
314
323
|
|
|
324
|
+
type heading = { level: Integer, text: String }
|
|
325
|
+
|
|
326
|
+
class Heading < ContextDev::Internal::Type::BaseModel
|
|
327
|
+
attr_accessor level: Integer
|
|
328
|
+
|
|
329
|
+
attr_accessor text: String
|
|
330
|
+
|
|
331
|
+
def initialize: (level: Integer, text: String) -> void
|
|
332
|
+
|
|
333
|
+
def to_hash: -> { level: Integer, text: String }
|
|
334
|
+
end
|
|
335
|
+
|
|
315
336
|
type open_graph = String | ::Array[String]
|
|
316
337
|
|
|
317
338
|
module OpenGraph
|