Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.9.0"
".": "2.10.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 40
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-a0dda03bbb600917cfb9add468cc4c8c84351a8dbbf61644dbc353263ca1748f.yml
openapi_spec_hash: c24264f32a46d9317aac5af9d6a396f7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-1c93116e47cab52ea63490f5bca186ed3acda8bbd7f0ce5a320effb9f5b72b1f.yml
openapi_spec_hash: f56204d55bd4bffb6e4d50d6a5d9471a
config_hash: 920678668dd2da6f8966fbf1b8fde4e2
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.10.0 (2026-08-08)

Full Changelog: [v2.9.0...v2.10.0](https://github.com/context-dot-dev/context-go-sdk/compare/v2.9.0...v2.10.0)

### Features

* **api:** api update ([e65edd1](https://github.com/context-dot-dev/context-go-sdk/commit/e65edd1676b33ef36bdfd6f9bd73007b57819d00))

## 2.9.0 (2026-08-07)

Full Changelog: [v2.8.0...v2.9.0](https://github.com/context-dot-dev/context-go-sdk/compare/v2.8.0...v2.9.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/context-dot-dev/context-go-sdk@v2.9.0'
go get -u 'github.com/context-dot-dev/context-go-sdk@v2.10.0'
```

<!-- x-release-please-end -->
Expand Down
24 changes: 24 additions & 0 deletions batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,9 @@ type BatchGetResultsResponseDataOkMetadata struct {
Description string `json:"description"`
// Resolved favicon URL, when present.
Favicon string `json:"favicon"`
// Page headings (h1–h6) in document order, extracted from the unfiltered document.
// Capped at the first 500 headings. Omitted when the page has none.
Headings []BatchGetResultsResponseDataOkMetadataHeading `json:"headings"`
// Primary resolved preview image from Open Graph, Twitter, or image metadata.
Image string `json:"image"`
// JSON-LD structured data blocks parsed from the page.
Expand Down Expand Up @@ -1234,6 +1237,7 @@ type BatchGetResultsResponseDataOkMetadata struct {
CanonicalURL respjson.Field
Description respjson.Field
Favicon respjson.Field
Headings respjson.Field
Image respjson.Field
JsonLd respjson.Field
Keywords respjson.Field
Expand Down Expand Up @@ -1318,6 +1322,26 @@ func (r *BatchGetResultsResponseDataOkMetadataAlternate) UnmarshalJSON(data []by
return apijson.UnmarshalRoot(data, r)
}

type BatchGetResultsResponseDataOkMetadataHeading struct {
// Heading level, 1–6 (from h1–h6).
Level int64 `json:"level" api:"required"`
// Heading text with whitespace collapsed, truncated to 1000 characters.
Text string `json:"text" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Level respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}

// Returns the unmodified JSON received from the API
func (r BatchGetResultsResponseDataOkMetadataHeading) RawJSON() string { return r.JSON.raw }
func (r *BatchGetResultsResponseDataOkMetadataHeading) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// BatchGetResultsResponseDataOkMetadataOpenGraphUnion contains all possible
// properties and values from [string], [[]string].
//
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "2.9.0" // x-release-please-version
const PackageVersion = "2.10.0" // x-release-please-version
94 changes: 83 additions & 11 deletions web.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,17 @@ func (r *WebService) WebScrapeImages(ctx context.Context, query WebWebScrapeImag
//
// ### Billing & errors
//
// | HTTP status | Billed? | Meaning |
// | ----------- | ----------------------------------------- | ---------------------------------------------------------------------------------------- |
// | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing |
// | 400 | No | Invalid input, skipped PDF, or the page could not be scraped |
// | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |
// | 404 | No | Target page returned or fingerprinted as not found |
// | 408 | No | Request timed out |
// | 413 | No | Target content exceeds the maximum supported size (20 MB) |
// | 415 | No | Unsupported content type |
// | 429 | No | Per-minute rate limit exceeded; honor Retry-After |
// | 500 | No | Internal error |
// | HTTP status | Billed? | Meaning |
// | ----------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
// | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing |
// | 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 |
// | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |
// | 404 | No | Target page returned or fingerprinted as not found |
// | 408 | No | Request timed out |
// | 413 | No | Target content exceeds the maximum supported size (20 MB) |
// | 415 | No | Unsupported content type |
// | 429 | No | Per-minute rate limit exceeded; honor Retry-After |
// | 500 | No | Internal error |
func (r *WebService) WebScrapeMd(ctx context.Context, query WebWebScrapeMdParams, opts ...option.RequestOption) (res *WebWebScrapeMdResponse, err error) {
opts = slices.Concat(r.options, opts)
path := "web/scrape/markdown"
Expand Down Expand Up @@ -1407,6 +1407,9 @@ type WebWebCrawlMdResponseResultMetadata struct {
Description string `json:"description"`
// Resolved favicon URL, when present.
Favicon string `json:"favicon"`
// Page headings (h1–h6) in document order, extracted from the unfiltered document.
// Capped at the first 500 headings. Omitted when the page has none.
Headings []WebWebCrawlMdResponseResultMetadataHeading `json:"headings"`
// Primary resolved preview image from Open Graph, Twitter, or image metadata.
Image string `json:"image"`
// JSON-LD structured data blocks parsed from the page.
Expand Down Expand Up @@ -1442,6 +1445,7 @@ type WebWebCrawlMdResponseResultMetadata struct {
CanonicalURL respjson.Field
Description respjson.Field
Favicon respjson.Field
Headings respjson.Field
Image respjson.Field
JsonLd respjson.Field
Keywords respjson.Field
Expand Down Expand Up @@ -1525,6 +1529,26 @@ func (r *WebWebCrawlMdResponseResultMetadataAlternate) UnmarshalJSON(data []byte
return apijson.UnmarshalRoot(data, r)
}

type WebWebCrawlMdResponseResultMetadataHeading struct {
// Heading level, 1–6 (from h1–h6).
Level int64 `json:"level" api:"required"`
// Heading text with whitespace collapsed, truncated to 1000 characters.
Text string `json:"text" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Level respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}

// Returns the unmodified JSON received from the API
func (r WebWebCrawlMdResponseResultMetadataHeading) RawJSON() string { return r.JSON.raw }
func (r *WebWebCrawlMdResponseResultMetadataHeading) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// WebWebCrawlMdResponseResultMetadataOpenGraphUnion contains all possible
// properties and values from [string], [[]string].
//
Expand Down Expand Up @@ -1688,6 +1712,9 @@ type WebWebScrapeHTMLResponseMetadata struct {
Description string `json:"description"`
// Resolved favicon URL, when present.
Favicon string `json:"favicon"`
// Page headings (h1–h6) in document order, extracted from the unfiltered document.
// Capped at the first 500 headings. Omitted when the page has none.
Headings []WebWebScrapeHTMLResponseMetadataHeading `json:"headings"`
// Primary resolved preview image from Open Graph, Twitter, or image metadata.
Image string `json:"image"`
// JSON-LD structured data blocks parsed from the page.
Expand Down Expand Up @@ -1720,6 +1747,7 @@ type WebWebScrapeHTMLResponseMetadata struct {
CanonicalURL respjson.Field
Description respjson.Field
Favicon respjson.Field
Headings respjson.Field
Image respjson.Field
JsonLd respjson.Field
Keywords respjson.Field
Expand Down Expand Up @@ -1804,6 +1832,26 @@ func (r *WebWebScrapeHTMLResponseMetadataAlternate) UnmarshalJSON(data []byte) e
return apijson.UnmarshalRoot(data, r)
}

type WebWebScrapeHTMLResponseMetadataHeading struct {
// Heading level, 1–6 (from h1–h6).
Level int64 `json:"level" api:"required"`
// Heading text with whitespace collapsed, truncated to 1000 characters.
Text string `json:"text" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Level respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}

// Returns the unmodified JSON received from the API
func (r WebWebScrapeHTMLResponseMetadataHeading) RawJSON() string { return r.JSON.raw }
func (r *WebWebScrapeHTMLResponseMetadataHeading) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// WebWebScrapeHTMLResponseMetadataOpenGraphUnion contains all possible properties
// and values from [string], [[]string].
//
Expand Down Expand Up @@ -2135,6 +2183,9 @@ type WebWebScrapeMdResponseMetadata struct {
Description string `json:"description"`
// Resolved favicon URL, when present.
Favicon string `json:"favicon"`
// Page headings (h1–h6) in document order, extracted from the unfiltered document.
// Capped at the first 500 headings. Omitted when the page has none.
Headings []WebWebScrapeMdResponseMetadataHeading `json:"headings"`
// Primary resolved preview image from Open Graph, Twitter, or image metadata.
Image string `json:"image"`
// JSON-LD structured data blocks parsed from the page.
Expand Down Expand Up @@ -2167,6 +2218,7 @@ type WebWebScrapeMdResponseMetadata struct {
CanonicalURL respjson.Field
Description respjson.Field
Favicon respjson.Field
Headings respjson.Field
Image respjson.Field
JsonLd respjson.Field
Keywords respjson.Field
Expand Down Expand Up @@ -2251,6 +2303,26 @@ func (r *WebWebScrapeMdResponseMetadataAlternate) UnmarshalJSON(data []byte) err
return apijson.UnmarshalRoot(data, r)
}

type WebWebScrapeMdResponseMetadataHeading struct {
// Heading level, 1–6 (from h1–h6).
Level int64 `json:"level" api:"required"`
// Heading text with whitespace collapsed, truncated to 1000 characters.
Text string `json:"text" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Level respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}

// Returns the unmodified JSON received from the API
func (r WebWebScrapeMdResponseMetadataHeading) RawJSON() string { return r.JSON.raw }
func (r *WebWebScrapeMdResponseMetadataHeading) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// WebWebScrapeMdResponseMetadataOpenGraphUnion contains all possible properties
// and values from [string], [[]string].
//
Expand Down
Loading