Skip to content
Merged
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.11.0"
".": "2.12.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: 41
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b0c72d2fe5911c9ce155275b954198bf2152e915a7e5b9f719aad50e222b9ef8.yml
openapi_spec_hash: 5cf943ea5718059b7975417b012cee28
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2c3f4e4b357ca78c019a3aacd006e2bb8b332d4172a300ee6c46c076a216ed3f.yml
openapi_spec_hash: b89be415cf6ee594b521885a9deb25ac
config_hash: 0fb0ceca5946298c416cec0cca5260c7
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 2.12.0 (2026-08-23)

Full Changelog: [v2.11.0...v2.12.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.11.0...v2.12.0)

### Features

* **api:** api update ([3c5c2c3](https://github.com/context-dot-dev/context-python-sdk/commit/3c5c2c39164d0be19c17949180c73937140687ea))
* **api:** api update ([3a29950](https://github.com/context-dot-dev/context-python-sdk/commit/3a29950c03cfa9deab35b08061f295d5a2b2c092))
* **api:** api update ([0a68836](https://github.com/context-dot-dev/context-python-sdk/commit/0a68836a31d685598a8f491f723970f8ea4e71f8))
* **api:** api update ([288c743](https://github.com/context-dot-dev/context-python-sdk/commit/288c7436453a199728d8b9407c0a51e83e0c0718))

## 2.11.0 (2026-08-18)

Full Changelog: [v2.10.0...v2.11.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.10.0...v2.11.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "context.dev"
version = "2.11.0"
version = "2.12.0"
description = "The official Python library for the context.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/context/dev/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "context.dev"
__version__ = "2.11.0" # x-release-please-version
__version__ = "2.12.0" # x-release-please-version
52 changes: 38 additions & 14 deletions src/context/dev/resources/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def extract(
*,
schema: Dict[str, object],
url: str,
actions: Iterable[web_extract_params.Action] | Omit = omit,
fact_check: bool | Omit = omit,
follow_subdomains: bool | Omit = omit,
include_frames: bool | Omit = omit,
Expand All @@ -96,13 +97,20 @@ def extract(
relevant internal links, and extract structured data from the selected pages.

Args:
schema: JSON Schema for the returned data object. TypeScript Zod users can pass a JSON
Schema generated from a Zod object; Python users can pass the equivalent JSON
Schema object.
schema: JSON Schema for the returned data object. Image fields such as `image_urls` or
`product_photos` automatically make page image references available to
extraction, so product data and photos can be returned in one call. TypeScript
Zod users can pass a JSON Schema generated from a Zod object; Python users can
pass the equivalent JSON Schema object.

url: The starting website URL to crawl and extract from. Must include http:// or
https://.

actions: Optional browser actions executed in order on the requested page after it loads,
before links are discovered or additional pages are crawled. Requires a paid
plan. When actions are provided and stopAfterMs is omitted, the crawl budget
defaults to 110000 ms.

fact_check: When true, every returned value must be grounded in facts stated on the page;
fields that cannot be supported by the page are returned as null/empty. When
false (default), the model may make reasonable inferences and derivations from
Expand Down Expand Up @@ -130,7 +138,8 @@ def extract(
exchange for more stable output on animated pages.

stop_after_ms: Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
(110s). Default: 80000 (80s).
(110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are
provided.

tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

Expand All @@ -155,6 +164,7 @@ def extract(
{
"schema": schema,
"url": url,
"actions": actions,
"fact_check": fact_check,
"follow_subdomains": follow_subdomains,
"include_frames": include_frames,
Expand Down Expand Up @@ -1338,13 +1348,15 @@ def web_crawl_md(
than this value, it will be aborted with a 408 status code. Maximum allowed
value is 300000ms (5 minutes).

url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped.
url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped. An
automatic prefix scope in the form ^<starting URL> follows a redirect of the
starting page.

use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and
navigation

wait_for_ms: Optional browser wait time in milliseconds after initial page load for each
crawled page. Min: 0. Max: 30000 (30 seconds).
wait_for_ms: Browser wait time in milliseconds after initial page load for each crawled page.
Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds).

zdr: Set to enabled to bypass shared caches and omit request and response content
from retained usage logs. Requires zero data retention to be enabled for your
Expand Down Expand Up @@ -2309,6 +2321,7 @@ async def extract(
*,
schema: Dict[str, object],
url: str,
actions: Iterable[web_extract_params.Action] | Omit = omit,
fact_check: bool | Omit = omit,
follow_subdomains: bool | Omit = omit,
include_frames: bool | Omit = omit,
Expand All @@ -2334,13 +2347,20 @@ async def extract(
relevant internal links, and extract structured data from the selected pages.

Args:
schema: JSON Schema for the returned data object. TypeScript Zod users can pass a JSON
Schema generated from a Zod object; Python users can pass the equivalent JSON
Schema object.
schema: JSON Schema for the returned data object. Image fields such as `image_urls` or
`product_photos` automatically make page image references available to
extraction, so product data and photos can be returned in one call. TypeScript
Zod users can pass a JSON Schema generated from a Zod object; Python users can
pass the equivalent JSON Schema object.

url: The starting website URL to crawl and extract from. Must include http:// or
https://.

actions: Optional browser actions executed in order on the requested page after it loads,
before links are discovered or additional pages are crawled. Requires a paid
plan. When actions are provided and stopAfterMs is omitted, the crawl budget
defaults to 110000 ms.

fact_check: When true, every returned value must be grounded in facts stated on the page;
fields that cannot be supported by the page are returned as null/empty. When
false (default), the model may make reasonable inferences and derivations from
Expand Down Expand Up @@ -2368,7 +2388,8 @@ async def extract(
exchange for more stable output on animated pages.

stop_after_ms: Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
(110s). Default: 80000 (80s).
(110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are
provided.

tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

Expand All @@ -2393,6 +2414,7 @@ async def extract(
{
"schema": schema,
"url": url,
"actions": actions,
"fact_check": fact_check,
"follow_subdomains": follow_subdomains,
"include_frames": include_frames,
Expand Down Expand Up @@ -3576,13 +3598,15 @@ async def web_crawl_md(
than this value, it will be aborted with a 408 status code. Maximum allowed
value is 300000ms (5 minutes).

url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped.
url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped. An
automatic prefix scope in the form ^<starting URL> follows a redirect of the
starting page.

use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and
navigation

wait_for_ms: Optional browser wait time in milliseconds after initial page load for each
crawled page. Min: 0. Max: 30000 (30 seconds).
wait_for_ms: Browser wait time in milliseconds after initial page load for each crawled page.
Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds).

zdr: Set to enabled to bypass shared caches and omit request and response content
from retained usage logs. Requires zero data retention to be enabled for your
Expand Down
15 changes: 15 additions & 0 deletions src/context/dev/types/ai_extract_product_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class Product(BaseModel):
target_audience: List[str]
"""Target audience for the product (array of strings)"""

availability: Optional[
Literal[
"in_stock", "out_of_stock", "limited_availability", "preorder", "backorder", "made_to_order", "discontinued"
]
] = None
"""Normalized stock or ordering availability"""

billing_frequency: Optional[Literal["monthly", "yearly", "one_time", "usage_based"]] = None
"""Billing frequency for the product"""

Expand All @@ -54,6 +61,11 @@ class Product(BaseModel):
currency: Optional[str] = None
"""Currency code for the price (e.g., USD, EUR)"""

dimensions: Optional[List[str]] = None
"""
Dimension statements shown for the product, preserving labels, values, and units
"""

image_url: Optional[str] = None
"""URL to the product image"""

Expand All @@ -63,6 +75,9 @@ class Product(BaseModel):
pricing_model: Optional[Literal["per_seat", "flat", "tiered", "freemium", "custom"]] = None
"""Pricing model for the product"""

regular_price: Optional[float] = None
"""Original or regular price before a displayed discount"""

url: Optional[str] = None
"""URL to the product page"""

Expand Down
15 changes: 15 additions & 0 deletions src/context/dev/types/ai_extract_products_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ class Product(BaseModel):
target_audience: List[str]
"""Target audience for the product (array of strings)"""

availability: Optional[
Literal[
"in_stock", "out_of_stock", "limited_availability", "preorder", "backorder", "made_to_order", "discontinued"
]
] = None
"""Normalized stock or ordering availability"""

billing_frequency: Optional[Literal["monthly", "yearly", "one_time", "usage_based"]] = None
"""Billing frequency for the product"""

Expand All @@ -52,6 +59,11 @@ class Product(BaseModel):
currency: Optional[str] = None
"""Currency code for the price (e.g., USD, EUR)"""

dimensions: Optional[List[str]] = None
"""
Dimension statements shown for the product, preserving labels, values, and units
"""

image_url: Optional[str] = None
"""URL to the product image"""

Expand All @@ -61,6 +73,9 @@ class Product(BaseModel):
pricing_model: Optional[Literal["per_seat", "flat", "tiered", "freemium", "custom"]] = None
"""Pricing model for the product"""

regular_price: Optional[float] = None
"""Original or regular price before a displayed discount"""

url: Optional[str] = None
"""URL to the product page"""

Expand Down
1 change: 1 addition & 0 deletions src/context/dev/types/news_search_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ class FilterBy(TypedDict, total=False):
"cg",
"ch",
"cl",
"cz",
"de",
"fi",
"fr",
Expand Down
75 changes: 69 additions & 6 deletions src/context/dev/types/web_extract_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,30 @@

from __future__ import annotations

from typing import Dict
from typing_extensions import Required, Annotated, TypedDict
from typing import Dict, Union, Iterable
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict

from .._types import SequenceNotStr
from .._utils import PropertyInfo

__all__ = ["WebExtractParams", "Pdf"]
__all__ = [
"WebExtractParams",
"Action",
"ActionWebScrapeWaitAction",
"ActionWebScrapePerformAction",
"ActionWebScrapeScrollAction",
"Pdf",
]


class WebExtractParams(TypedDict, total=False):
schema: Required[Dict[str, object]]
"""JSON Schema for the returned data object.

TypeScript Zod users can pass a JSON Schema generated from a Zod object; Python
users can pass the equivalent JSON Schema object.
Image fields such as `image_urls` or `product_photos` automatically make page
image references available to extraction, so product data and photos can be
returned in one call. TypeScript Zod users can pass a JSON Schema generated from
a Zod object; Python users can pass the equivalent JSON Schema object.
"""

url: Required[str]
Expand All @@ -25,6 +34,14 @@ class WebExtractParams(TypedDict, total=False):
Must include http:// or https://.
"""

actions: Iterable[Action]
"""
Optional browser actions executed in order on the requested page after it loads,
before links are discovered or additional pages are crawled. Requires a paid
plan. When actions are provided and stopAfterMs is omitted, the crawl budget
defaults to 110000 ms.
"""

fact_check: Annotated[bool, PropertyInfo(alias="factCheck")]
"""
When true, every returned value must be grounded in facts stated on the page;
Expand Down Expand Up @@ -74,7 +91,8 @@ class WebExtractParams(TypedDict, total=False):
stop_after_ms: Annotated[int, PropertyInfo(alias="stopAfterMs")]
"""Soft time budget for the crawl in milliseconds.

Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s).
Min: 10000 (10s). Max: 110000 (110s). Defaults to 80000 (80s), or 110000 (110s)
when browser actions are provided.
"""

tags: SequenceNotStr[str]
Expand All @@ -94,6 +112,51 @@ class WebExtractParams(TypedDict, total=False):
"""


class ActionWebScrapeWaitAction(TypedDict, total=False):
"""Pause for a fixed number of milliseconds before continuing to the next action."""

do: Required[Literal["wait"]]

time_ms: Required[Annotated[int, PropertyInfo(alias="timeMs")]]


class ActionWebScrapePerformAction(TypedDict, total=False):
"""Resolve and perform one natural-language browser action."""

action: Required[str]

do: Required[Literal["perform"]]


class ActionWebScrapeScrollAction(TypedDict, total=False):
"""
Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.
"""

do: Required[Literal["scroll"]]

amount: Union[int, Literal["viewport", "max"]]
"""Pixels per scroll, one visible viewport, or the current scroll boundary.

Defaults to viewport.
"""

container: str
"""CSS selector for the first matching scroll container. Defaults to the page."""

direction: Literal["up", "down", "left", "right"]
"""Direction to scroll. Defaults to down."""

max_scrolls: Annotated[int, PropertyInfo(alias="maxScrolls")]
"""Maximum scroll iterations.

Stops early when scrolling and scrollable extent stop changing. Defaults to 1.
"""


Action: TypeAlias = Union[ActionWebScrapeWaitAction, ActionWebScrapePerformAction, ActionWebScrapeScrollAction]


class Pdf(TypedDict, total=False):
end: int
"""Last 1-based PDF page to parse.
Expand Down
Loading
Loading