diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2638c92..ab7c253 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/context.dev-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -41,7 +41,7 @@ jobs: permissions: contents: read id-token: write - runs-on: ${{ github.repository == 'stainless-sdks/context.dev-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -78,7 +78,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/context.dev-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b44b287..4dedeae 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.4.0" + ".": "2.5.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 7cfdbba..0ac1eb3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-fb56935a194e69348fecd985f7cf8b249795b46af2fb32f6c5c8ef648cf10c15.yml -openapi_spec_hash: 7260a560474283b7ad6ac5d426058ac9 -config_hash: daabb160675d86b354711da1e77e5129 +configured_endpoints: 32 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-242450ea46eb8c3e843fd6c4bf87e73192b5f62f6da697cd091d13c6aa7a991b.yml +openapi_spec_hash: c1c561976de1abcacede71fd5ab9b3d9 +config_hash: 70e7e80b5e87f94981bee396c6cd41e8 diff --git a/CHANGELOG.md b/CHANGELOG.md index c566b65..4444631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## 2.5.0 (2026-07-22) + +Full Changelog: [v2.4.0...v2.5.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.4.0...v2.5.0) + +### Features + +* **api:** api update ([bbcd1c1](https://github.com/context-dot-dev/context-python-sdk/commit/bbcd1c1d42b9a2080dff7ff42ce7028339d94c25)) +* **api:** api update ([4432665](https://github.com/context-dot-dev/context-python-sdk/commit/443266595a9dec4e7ccc081ea1d4967985cb7d67)) +* **api:** api update ([94fa1f1](https://github.com/context-dot-dev/context-python-sdk/commit/94fa1f1ee791691e9e65e4d437dd7ce5f619087a)) +* **api:** api update ([4ae29fb](https://github.com/context-dot-dev/context-python-sdk/commit/4ae29fb780a4c6d971e2f77d9e7572ba12ccc8a5)) +* **api:** api update ([08d9b02](https://github.com/context-dot-dev/context-python-sdk/commit/08d9b029637ba08b636b653659427c9f21f9f9ce)) +* **api:** api update ([8592c63](https://github.com/context-dot-dev/context-python-sdk/commit/8592c635674b01bcefbc5563bc53b98e90859b0c)) +* **api:** api update ([7d2dfb5](https://github.com/context-dot-dev/context-python-sdk/commit/7d2dfb58157434152a853aebcd4f1289c2e30bd6)) +* **api:** manual updates ([e75ea61](https://github.com/context-dot-dev/context-python-sdk/commit/e75ea615fc7e9dba2d84ebc9bd4e4f8c19f98512)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([b66fcc2](https://github.com/context-dot-dev/context-python-sdk/commit/b66fcc27146584210b8e6d500c7ce11db83cccce)) + + +### Bug Fixes + +* **internal:** resolve build failures ([e373980](https://github.com/context-dot-dev/context-python-sdk/commit/e373980c1d881969d2dc37bd2d069fd9c128595e)) + ## 2.4.0 (2026-07-12) Full Changelog: [v2.3.0...v2.4.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.3.0...v2.4.0) diff --git a/api.md b/api.md index c7ab5f7..fe5b201 100644 --- a/api.md +++ b/api.md @@ -107,6 +107,8 @@ from context.dev.types import ( MonitorUpdateResponse, MonitorListResponse, MonitorDeleteResponse, + MonitorGetCreditUsageResponse, + MonitorGetLimitsResponse, MonitorListAccountChangesResponse, MonitorListAccountRunsResponse, MonitorListChangesResponse, @@ -123,6 +125,8 @@ Methods: - client.monitors.update(monitor_id, \*\*params) -> MonitorUpdateResponse - client.monitors.list(\*\*params) -> MonitorListResponse - client.monitors.delete(monitor_id) -> MonitorDeleteResponse +- client.monitors.get_credit_usage(\*\*params) -> MonitorGetCreditUsageResponse +- client.monitors.get_limits() -> MonitorGetLimitsResponse - client.monitors.list_account_changes(\*\*params) -> MonitorListAccountChangesResponse - client.monitors.list_account_runs(\*\*params) -> MonitorListAccountRunsResponse - client.monitors.list_changes(monitor_id, \*\*params) -> MonitorListChangesResponse diff --git a/pyproject.toml b/pyproject.toml index a2037dd..32eb11e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "context.dev" -version = "2.4.0" +version = "2.5.0" description = "The official Python library for the context.dev API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/scripts/lint b/scripts/lint index 29dfea2..bf1ebab 100755 --- a/scripts/lint +++ b/scripts/lint @@ -13,7 +13,7 @@ else fi echo "==> Running pyright" -uv run pyright +uv run pyright -p . echo "==> Running mypy" uv run mypy . diff --git a/src/context/dev/_version.py b/src/context/dev/_version.py index 520d6d8..76defcd 100644 --- a/src/context/dev/_version.py +++ b/src/context/dev/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "context.dev" -__version__ = "2.4.0" # x-release-please-version +__version__ = "2.5.0" # x-release-please-version diff --git a/src/context/dev/resources/ai.py b/src/context/dev/resources/ai.py index 4bfb82e..24228c7 100644 --- a/src/context/dev/resources/ai.py +++ b/src/context/dev/resources/ai.py @@ -7,7 +7,7 @@ import httpx from ..types import ai_extract_product_params, ai_extract_products_params -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from .._utils import required_args, maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -49,6 +49,7 @@ def extract_product( *, url: str, max_age_ms: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -68,6 +69,8 @@ def extract_product( younger than this many milliseconds. Defaults to 7 days (604800000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -86,6 +89,7 @@ def extract_product( { "url": url, "max_age_ms": max_age_ms, + "tags": tags, "timeout_ms": timeout_ms, }, ai_extract_product_params.AIExtractProductParams, @@ -103,6 +107,7 @@ def extract_products( domain: str, max_age_ms: int | Omit = omit, max_products: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -126,6 +131,8 @@ def extract_products( max_products: Maximum number of products to extract. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -147,6 +154,7 @@ def extract_products( direct_url: str, max_age_ms: int | Omit = omit, max_products: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -171,6 +179,8 @@ def extract_products( max_products: Maximum number of products to extract. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -192,6 +202,7 @@ def extract_products( domain: str | Omit = omit, max_age_ms: int | Omit = omit, max_products: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, direct_url: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -208,6 +219,7 @@ def extract_products( "domain": domain, "max_age_ms": max_age_ms, "max_products": max_products, + "tags": tags, "timeout_ms": timeout_ms, "direct_url": direct_url, }, @@ -245,6 +257,7 @@ async def extract_product( *, url: str, max_age_ms: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -264,6 +277,8 @@ async def extract_product( younger than this many milliseconds. Defaults to 7 days (604800000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -282,6 +297,7 @@ async def extract_product( { "url": url, "max_age_ms": max_age_ms, + "tags": tags, "timeout_ms": timeout_ms, }, ai_extract_product_params.AIExtractProductParams, @@ -299,6 +315,7 @@ async def extract_products( domain: str, max_age_ms: int | Omit = omit, max_products: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -322,6 +339,8 @@ async def extract_products( max_products: Maximum number of products to extract. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -343,6 +362,7 @@ async def extract_products( direct_url: str, max_age_ms: int | Omit = omit, max_products: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -367,6 +387,8 @@ async def extract_products( max_products: Maximum number of products to extract. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -388,6 +410,7 @@ async def extract_products( domain: str | Omit = omit, max_age_ms: int | Omit = omit, max_products: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, direct_url: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -404,6 +427,7 @@ async def extract_products( "domain": domain, "max_age_ms": max_age_ms, "max_products": max_products, + "tags": tags, "timeout_ms": timeout_ms, "direct_url": direct_url, }, diff --git a/src/context/dev/resources/brand.py b/src/context/dev/resources/brand.py index d8236f1..65cf230 100644 --- a/src/context/dev/resources/brand.py +++ b/src/context/dev/resources/brand.py @@ -2,12 +2,13 @@ from __future__ import annotations +from typing import Union, Optional from typing_extensions import Literal, overload import httpx from ..types import brand_retrieve_params, brand_retrieve_simplified_params -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from .._utils import required_args, maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -50,131 +51,134 @@ def retrieve( *, domain: str, type: Literal["by_domain"], - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -205,6 +209,8 @@ def retrieve( the API will skip time-consuming operations for faster response at the cost of less comprehensive data. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -226,131 +232,134 @@ def retrieve( name: str, type: Literal["by_name"], country_gl: str | Omit = omit, - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -384,6 +393,8 @@ def retrieve( the API will skip time-consuming operations for faster response at the cost of less comprehensive data. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -404,131 +415,134 @@ def retrieve( *, email: str, type: Literal["by_email"], - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -559,6 +573,8 @@ def retrieve( the API will skip time-consuming operations for faster response at the cost of less comprehensive data. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -579,131 +595,134 @@ def retrieve( *, ticker: str, type: Literal["by_ticker"], - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, ticker_exchange: str | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -735,6 +754,8 @@ def retrieve( the API will skip time-consuming operations for faster response at the cost of less comprehensive data. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + ticker_exchange: Optional stock exchange for the ticker. Defaults to NASDAQ if not specified. timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer @@ -757,6 +778,7 @@ def retrieve( *, direct_url: str, type: Literal["by_direct_url"], + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -780,6 +802,8 @@ def retrieve( type: Discriminator for direct-URL-based brand retrieval. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -802,133 +826,136 @@ def retrieve( type: Literal["by_transaction"], city: str | Omit = omit, country_gl: str | Omit = omit, - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, high_confidence_only: bool | Omit = omit, max_speed: bool | Omit = omit, - mcc: int | Omit = omit, - phone: float | Omit = omit, + mcc: Union[str, float] | Omit = omit, + phone: Union[str, float] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -967,6 +994,8 @@ def retrieve( phone: Optional phone number from the transaction to help verify brand match. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -999,131 +1028,134 @@ def retrieve( | Literal["by_ticker"] | Literal["by_direct_url"] | Literal["by_transaction"], - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, name: str | Omit = omit, country_gl: str | Omit = omit, @@ -1134,8 +1166,8 @@ def retrieve( transaction_info: str | Omit = omit, city: str | Omit = omit, high_confidence_only: bool | Omit = omit, - mcc: int | Omit = omit, - phone: float | Omit = omit, + mcc: Union[str, float] | Omit = omit, + phone: Union[str, float] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1152,6 +1184,7 @@ def retrieve( "force_language": force_language, "max_age_ms": max_age_ms, "max_speed": max_speed, + "tags": tags, "timeout_ms": timeout_ms, "name": name, "country_gl": country_gl, @@ -1177,7 +1210,9 @@ def retrieve_simplified( self, *, domain: str, - max_age_ms: int | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + theme: Literal["light", "dark"] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1199,6 +1234,12 @@ def retrieve_simplified( are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + + theme: Optional theme preference used when selecting brand assets. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -1222,6 +1263,8 @@ def retrieve_simplified( { "domain": domain, "max_age_ms": max_age_ms, + "tags": tags, + "theme": theme, "timeout_ms": timeout_ms, }, brand_retrieve_simplified_params.BrandRetrieveSimplifiedParams, @@ -1257,131 +1300,134 @@ async def retrieve( *, domain: str, type: Literal["by_domain"], - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1412,6 +1458,8 @@ async def retrieve( the API will skip time-consuming operations for faster response at the cost of less comprehensive data. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -1433,131 +1481,134 @@ async def retrieve( name: str, type: Literal["by_name"], country_gl: str | Omit = omit, - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1591,6 +1642,8 @@ async def retrieve( the API will skip time-consuming operations for faster response at the cost of less comprehensive data. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -1611,131 +1664,134 @@ async def retrieve( *, email: str, type: Literal["by_email"], - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1766,6 +1822,8 @@ async def retrieve( the API will skip time-consuming operations for faster response at the cost of less comprehensive data. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -1786,131 +1844,134 @@ async def retrieve( *, ticker: str, type: Literal["by_ticker"], - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, ticker_exchange: str | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1942,6 +2003,8 @@ async def retrieve( the API will skip time-consuming operations for faster response at the cost of less comprehensive data. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + ticker_exchange: Optional stock exchange for the ticker. Defaults to NASDAQ if not specified. timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer @@ -1964,6 +2027,7 @@ async def retrieve( *, direct_url: str, type: Literal["by_direct_url"], + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1987,6 +2051,8 @@ async def retrieve( type: Discriminator for direct-URL-based brand retrieval. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2009,133 +2075,136 @@ async def retrieve( type: Literal["by_transaction"], city: str | Omit = omit, country_gl: str | Omit = omit, - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, high_confidence_only: bool | Omit = omit, max_speed: bool | Omit = omit, - mcc: int | Omit = omit, - phone: float | Omit = omit, + mcc: Union[str, float] | Omit = omit, + phone: Union[str, float] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2174,6 +2243,8 @@ async def retrieve( phone: Optional phone number from the transaction to help verify brand match. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2206,131 +2277,134 @@ async def retrieve( | Literal["by_ticker"] | Literal["by_direct_url"] | Literal["by_transaction"], - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] | Omit = omit, max_age_ms: int | Omit = omit, max_speed: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, name: str | Omit = omit, country_gl: str | Omit = omit, @@ -2341,8 +2415,8 @@ async def retrieve( transaction_info: str | Omit = omit, city: str | Omit = omit, high_confidence_only: bool | Omit = omit, - mcc: int | Omit = omit, - phone: float | Omit = omit, + mcc: Union[str, float] | Omit = omit, + phone: Union[str, float] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2359,6 +2433,7 @@ async def retrieve( "force_language": force_language, "max_age_ms": max_age_ms, "max_speed": max_speed, + "tags": tags, "timeout_ms": timeout_ms, "name": name, "country_gl": country_gl, @@ -2384,7 +2459,9 @@ async def retrieve_simplified( self, *, domain: str, - max_age_ms: int | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + theme: Literal["light", "dark"] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2406,6 +2483,12 @@ async def retrieve_simplified( are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + + theme: Optional theme preference used when selecting brand assets. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2429,6 +2512,8 @@ async def retrieve_simplified( { "domain": domain, "max_age_ms": max_age_ms, + "tags": tags, + "theme": theme, "timeout_ms": timeout_ms, }, brand_retrieve_simplified_params.BrandRetrieveSimplifiedParams, diff --git a/src/context/dev/resources/industry.py b/src/context/dev/resources/industry.py index cf90762..5d2747c 100644 --- a/src/context/dev/resources/industry.py +++ b/src/context/dev/resources/industry.py @@ -7,7 +7,7 @@ import httpx from ..types import industry_retrieve_sic_params, industry_retrieve_naics_params -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -50,6 +50,7 @@ def retrieve_naics( input: str, max_results: int | Omit = omit, min_results: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -71,6 +72,10 @@ def retrieve_naics( min_results: Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -95,6 +100,7 @@ def retrieve_naics( "input": input, "max_results": max_results, "min_results": min_results, + "tags": tags, "timeout_ms": timeout_ms, }, industry_retrieve_naics_params.IndustryRetrieveNaicsParams, @@ -109,6 +115,7 @@ def retrieve_sic( input: str, max_results: int | Omit = omit, min_results: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, type: Literal["original_sic", "latest_sec"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -132,6 +139,10 @@ def retrieve_sic( min_results: Minimum number of SIC codes to return. Must be at least 1. Defaults to 1. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -160,6 +171,7 @@ def retrieve_sic( "input": input, "max_results": max_results, "min_results": min_results, + "tags": tags, "timeout_ms": timeout_ms, "type": type, }, @@ -196,6 +208,7 @@ async def retrieve_naics( input: str, max_results: int | Omit = omit, min_results: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -217,6 +230,10 @@ async def retrieve_naics( min_results: Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -241,6 +258,7 @@ async def retrieve_naics( "input": input, "max_results": max_results, "min_results": min_results, + "tags": tags, "timeout_ms": timeout_ms, }, industry_retrieve_naics_params.IndustryRetrieveNaicsParams, @@ -255,6 +273,7 @@ async def retrieve_sic( input: str, max_results: int | Omit = omit, min_results: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, type: Literal["original_sic", "latest_sec"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -278,6 +297,10 @@ async def retrieve_sic( min_results: Minimum number of SIC codes to return. Must be at least 1. Defaults to 1. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -306,6 +329,7 @@ async def retrieve_sic( "input": input, "max_results": max_results, "min_results": min_results, + "tags": tags, "timeout_ms": timeout_ms, "type": type, }, diff --git a/src/context/dev/resources/monitors.py b/src/context/dev/resources/monitors.py index cd4bb61..b0e6b7a 100644 --- a/src/context/dev/resources/monitors.py +++ b/src/context/dev/resources/monitors.py @@ -14,6 +14,7 @@ monitor_update_params, monitor_list_runs_params, monitor_list_changes_params, + monitor_get_credit_usage_params, monitor_list_account_runs_params, monitor_list_account_changes_params, ) @@ -35,8 +36,10 @@ from ..types.monitor_update_response import MonitorUpdateResponse from ..types.monitor_retrieve_response import MonitorRetrieveResponse from ..types.monitor_list_runs_response import MonitorListRunsResponse +from ..types.monitor_get_limits_response import MonitorGetLimitsResponse from ..types.monitor_list_changes_response import MonitorListChangesResponse from ..types.monitor_retrieve_change_response import MonitorRetrieveChangeResponse +from ..types.monitor_get_credit_usage_response import MonitorGetCreditUsageResponse from ..types.monitor_list_account_runs_response import MonitorListAccountRunsResponse from ..types.monitor_list_account_changes_response import MonitorListAccountChangesResponse @@ -103,6 +106,7 @@ def create( described by `target` and `change_detection`. tags: User-defined tags for grouping and filtering monitors and their changes. + Duplicates are removed. extra_headers: Send extra headers @@ -197,6 +201,7 @@ def update( between 10 minutes and 1 year. tags: User-defined tags for grouping and filtering monitors and their changes. + Duplicates are removed. target: Discriminated union describing what the monitor watches. @@ -239,11 +244,11 @@ def list( cursor: str | Omit = omit, limit: int | Omit = omit, q: str | Omit = omit, - search_by: List[Literal["name", "url", "instructions", "tags"]] | Omit = omit, + search_by: Optional[List[Literal["name", "url", "instructions", "tags"]]] | Omit = omit, search_type: Literal["exact", "prefix"] | Omit = omit, status: Literal["active", "paused", "failed"] | Omit = omit, tag: str | Omit = omit, - tags: SequenceNotStr[str] | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, target_type: Literal["page", "sitemap", "extract"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -259,6 +264,12 @@ def list( status/type/tag filters. Results are paginated via the opaque `cursor`. Args: + change_detection_type: Filter by change detection type. + + cursor: Opaque pagination cursor from a previous response. + + limit: Maximum number of items to return per page (1-100). Defaults to 25. + q: Free-text search term, matched against the fields named in `search_by`. search_by: Comma-separated fields to search with `q`. Defaults to all of them. Note @@ -267,16 +278,14 @@ def list( search_type: `prefix` for as-you-type prefix matching (default), `exact` for full-token matching. - status: Monitor lifecycle status. `failed` means the most recent run failed (see the - monitor's `last_error`); failed monitors keep running on schedule and flip back - to `active` on the next successful run. Monitors are auto-`paused` after - repeated consecutive failures or insufficient-credit skips; resume by PATCHing - status to `active`. + status: Filter monitors by lifecycle status. tag: Filter to items that have this tag. tags: Comma-separated list of tags to filter by (matches monitors having any of them). + target_type: Filter by target type. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -344,6 +353,72 @@ def delete( cast_to=MonitorDeleteResponse, ) + def get_credit_usage( + self, + *, + since: Union[str, datetime] | Omit = omit, + until: Union[str, datetime] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MonitorGetCreditUsageResponse: + """ + Returns credits charged per monitor over an optional [since, until] window, + newest spenders first. + + Args: + since: Only include items at or after this ISO 8601 timestamp. + + until: Only include items before this ISO 8601 timestamp. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/monitors/credit-usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "since": since, + "until": until, + }, + monitor_get_credit_usage_params.MonitorGetCreditUsageParams, + ), + ), + cast_to=MonitorGetCreditUsageResponse, + ) + + def get_limits( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MonitorGetLimitsResponse: + """Returns how many monitors the account has and the maximum it allows.""" + return self._get( + "/monitors/limits", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MonitorGetLimitsResponse, + ) + def list_account_changes( self, *, @@ -366,8 +441,22 @@ def list_account_changes( Returns an account-wide feed of detected changes across monitors. Args: + change_detection_type: Filter by change detection type. + + cursor: Opaque pagination cursor from a previous response. + + limit: Maximum number of items to return per page (1-100). Defaults to 25. + + monitor_id: Filter changes to a single monitor. + + since: Only include items at or after this ISO 8601 timestamp. + tag: Filter to items that have this tag. + target_type: Filter by target type. + + until: Only include items before this ISO 8601 timestamp. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -417,8 +506,11 @@ def list_account_runs( Returns an account-wide feed of monitor runs across all monitors. Args: - status: Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - (insufficient credits, monitor paused, or superseded by a concurrent run). + cursor: Opaque pagination cursor from a previous response. + + limit: Maximum number of items to return per page (1-100). Defaults to 25. + + status: Filter runs by lifecycle status. extra_headers: Send extra headers @@ -467,8 +559,16 @@ def list_changes( List changes for a monitor Args: + cursor: Opaque pagination cursor from a previous response. + + limit: Maximum number of items to return per page (1-100). Defaults to 25. + + since: Only include items at or after this ISO 8601 timestamp. + tag: Filter to items that have this tag. + until: Only include items before this ISO 8601 timestamp. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -514,13 +614,15 @@ def list_runs( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MonitorListRunsResponse: - """List monitor runs + """ + List monitor runs Args: - status: Lifecycle status of a run. + cursor: Opaque pagination cursor from a previous response. + + limit: Maximum number of items to return per page (1-100). Defaults to 25. - `skipped` runs never executed — see `skip_reason` - (insufficient credits, monitor paused, or superseded by a concurrent run). + status: Filter runs by lifecycle status. extra_headers: Send extra headers @@ -680,6 +782,7 @@ async def create( described by `target` and `change_detection`. tags: User-defined tags for grouping and filtering monitors and their changes. + Duplicates are removed. extra_headers: Send extra headers @@ -774,6 +877,7 @@ async def update( between 10 minutes and 1 year. tags: User-defined tags for grouping and filtering monitors and their changes. + Duplicates are removed. target: Discriminated union describing what the monitor watches. @@ -816,11 +920,11 @@ async def list( cursor: str | Omit = omit, limit: int | Omit = omit, q: str | Omit = omit, - search_by: List[Literal["name", "url", "instructions", "tags"]] | Omit = omit, + search_by: Optional[List[Literal["name", "url", "instructions", "tags"]]] | Omit = omit, search_type: Literal["exact", "prefix"] | Omit = omit, status: Literal["active", "paused", "failed"] | Omit = omit, tag: str | Omit = omit, - tags: SequenceNotStr[str] | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, target_type: Literal["page", "sitemap", "extract"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -836,6 +940,12 @@ async def list( status/type/tag filters. Results are paginated via the opaque `cursor`. Args: + change_detection_type: Filter by change detection type. + + cursor: Opaque pagination cursor from a previous response. + + limit: Maximum number of items to return per page (1-100). Defaults to 25. + q: Free-text search term, matched against the fields named in `search_by`. search_by: Comma-separated fields to search with `q`. Defaults to all of them. Note @@ -844,16 +954,14 @@ async def list( search_type: `prefix` for as-you-type prefix matching (default), `exact` for full-token matching. - status: Monitor lifecycle status. `failed` means the most recent run failed (see the - monitor's `last_error`); failed monitors keep running on schedule and flip back - to `active` on the next successful run. Monitors are auto-`paused` after - repeated consecutive failures or insufficient-credit skips; resume by PATCHing - status to `active`. + status: Filter monitors by lifecycle status. tag: Filter to items that have this tag. tags: Comma-separated list of tags to filter by (matches monitors having any of them). + target_type: Filter by target type. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -921,6 +1029,72 @@ async def delete( cast_to=MonitorDeleteResponse, ) + async def get_credit_usage( + self, + *, + since: Union[str, datetime] | Omit = omit, + until: Union[str, datetime] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MonitorGetCreditUsageResponse: + """ + Returns credits charged per monitor over an optional [since, until] window, + newest spenders first. + + Args: + since: Only include items at or after this ISO 8601 timestamp. + + until: Only include items before this ISO 8601 timestamp. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/monitors/credit-usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "since": since, + "until": until, + }, + monitor_get_credit_usage_params.MonitorGetCreditUsageParams, + ), + ), + cast_to=MonitorGetCreditUsageResponse, + ) + + async def get_limits( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MonitorGetLimitsResponse: + """Returns how many monitors the account has and the maximum it allows.""" + return await self._get( + "/monitors/limits", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MonitorGetLimitsResponse, + ) + async def list_account_changes( self, *, @@ -943,8 +1117,22 @@ async def list_account_changes( Returns an account-wide feed of detected changes across monitors. Args: + change_detection_type: Filter by change detection type. + + cursor: Opaque pagination cursor from a previous response. + + limit: Maximum number of items to return per page (1-100). Defaults to 25. + + monitor_id: Filter changes to a single monitor. + + since: Only include items at or after this ISO 8601 timestamp. + tag: Filter to items that have this tag. + target_type: Filter by target type. + + until: Only include items before this ISO 8601 timestamp. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -994,8 +1182,11 @@ async def list_account_runs( Returns an account-wide feed of monitor runs across all monitors. Args: - status: Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - (insufficient credits, monitor paused, or superseded by a concurrent run). + cursor: Opaque pagination cursor from a previous response. + + limit: Maximum number of items to return per page (1-100). Defaults to 25. + + status: Filter runs by lifecycle status. extra_headers: Send extra headers @@ -1044,8 +1235,16 @@ async def list_changes( List changes for a monitor Args: + cursor: Opaque pagination cursor from a previous response. + + limit: Maximum number of items to return per page (1-100). Defaults to 25. + + since: Only include items at or after this ISO 8601 timestamp. + tag: Filter to items that have this tag. + until: Only include items before this ISO 8601 timestamp. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1091,13 +1290,15 @@ async def list_runs( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MonitorListRunsResponse: - """List monitor runs + """ + List monitor runs Args: - status: Lifecycle status of a run. + cursor: Opaque pagination cursor from a previous response. - `skipped` runs never executed — see `skip_reason` - (insufficient credits, monitor paused, or superseded by a concurrent run). + limit: Maximum number of items to return per page (1-100). Defaults to 25. + + status: Filter runs by lifecycle status. extra_headers: Send extra headers @@ -1216,6 +1417,12 @@ def __init__(self, monitors: MonitorsResource) -> None: self.delete = to_raw_response_wrapper( monitors.delete, ) + self.get_credit_usage = to_raw_response_wrapper( + monitors.get_credit_usage, + ) + self.get_limits = to_raw_response_wrapper( + monitors.get_limits, + ) self.list_account_changes = to_raw_response_wrapper( monitors.list_account_changes, ) @@ -1255,6 +1462,12 @@ def __init__(self, monitors: AsyncMonitorsResource) -> None: self.delete = async_to_raw_response_wrapper( monitors.delete, ) + self.get_credit_usage = async_to_raw_response_wrapper( + monitors.get_credit_usage, + ) + self.get_limits = async_to_raw_response_wrapper( + monitors.get_limits, + ) self.list_account_changes = async_to_raw_response_wrapper( monitors.list_account_changes, ) @@ -1294,6 +1507,12 @@ def __init__(self, monitors: MonitorsResource) -> None: self.delete = to_streamed_response_wrapper( monitors.delete, ) + self.get_credit_usage = to_streamed_response_wrapper( + monitors.get_credit_usage, + ) + self.get_limits = to_streamed_response_wrapper( + monitors.get_limits, + ) self.list_account_changes = to_streamed_response_wrapper( monitors.list_account_changes, ) @@ -1333,6 +1552,12 @@ def __init__(self, monitors: AsyncMonitorsResource) -> None: self.delete = async_to_streamed_response_wrapper( monitors.delete, ) + self.get_credit_usage = async_to_streamed_response_wrapper( + monitors.get_credit_usage, + ) + self.get_limits = async_to_streamed_response_wrapper( + monitors.get_limits, + ) self.list_account_changes = async_to_streamed_response_wrapper( monitors.list_account_changes, ) diff --git a/src/context/dev/resources/parse.py b/src/context/dev/resources/parse.py index 460660f..12c0b8f 100644 --- a/src/context/dev/resources/parse.py +++ b/src/context/dev/resources/parse.py @@ -3,6 +3,7 @@ from __future__ import annotations import os +from typing import Union from typing_extensions import Literal import httpx @@ -17,6 +18,7 @@ NotGiven, BinaryTypes, FileContent, + SequenceNotStr, AsyncBinaryTypes, omit, not_given, @@ -60,6 +62,7 @@ def handle( self, body: FileContent | BinaryTypes, *, + client: str | Omit = omit, extension: Literal[ "txt", "text", @@ -133,12 +136,14 @@ def handle( "pnm", ] | Omit = omit, - include_images: bool | Omit = omit, - include_links: bool | Omit = omit, - ocr: bool | Omit = omit, + include_images: Union[bool, Literal["true", "false"]] | Omit = omit, + include_links: Union[bool, Literal["true", "false"]] | Omit = omit, + ocr: Union[bool, Literal["true", "false"]] | Omit = omit, pdf: parse_handle_params.Pdf | Omit = omit, - shorten_base64_images: bool | Omit = omit, - use_main_content_only: bool | Omit = omit, + shorten_base64_images: Union[bool, Literal["true", "false"]] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -148,33 +153,38 @@ def handle( ) -> ParseHandleResponse: """ Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes - into LLM-usable Markdown. The base request costs 1 credit. When OCR runs - (requires ocr=true), the entire call costs 5 credits; ocr=true requests where no - OCR ends up running still cost 1 credit. + into LLM-usable Markdown. Args: - extension: Optional file extension hint. Case-insensitive; a leading dot is accepted (e.g. - ".pdf"). + client: Optional client identifier used for usage attribution. + + extension: Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, + md, py, rtf, jpg, png, or txt. include_images: Include image references in Markdown output include_links: Preserve hyperlinks in Markdown output - ocr: Gates all OCR. When true, PDFs get embedded-image OCR (recognized text inserted - at each image's position in page reading order, preserving the text layer; - pdf.start/pdf.end limit the page range), scanned PDFs with no text layer get - full-document OCR, and raster images get their visible text transcribed. When - false, no OCR runs: scanned PDFs may yield no content and images return only - format/dimension metadata. Calls where OCR actually runs cost 5 credits instead - of 1. + ocr: When true for PDF inputs, detect and OCR images embedded in the selected pages, + inserting recognized text at each image's position in page reading order while + preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. + When false, all OCR is disabled, including the automatic scanned-PDF fallback. - pdf: PDF page-range controls. Use start/end to limit parsing (and OCR when ocr=true) - to an inclusive 1-based page range. + pdf: PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. shorten_base64_images: Shorten base64-encoded image data in the Markdown output + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + use_main_content_only: Extract only the main content from HTML-like inputs + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -194,13 +204,16 @@ def handle( timeout=timeout, query=maybe_transform( { + "client": client, "extension": extension, "include_images": include_images, "include_links": include_links, "ocr": ocr, "pdf": pdf, "shorten_base64_images": shorten_base64_images, + "tags": tags, "use_main_content_only": use_main_content_only, + "zdr": zdr, }, parse_handle_params.ParseHandleParams, ), @@ -233,6 +246,7 @@ async def handle( self, body: FileContent | AsyncBinaryTypes, *, + client: str | Omit = omit, extension: Literal[ "txt", "text", @@ -306,12 +320,14 @@ async def handle( "pnm", ] | Omit = omit, - include_images: bool | Omit = omit, - include_links: bool | Omit = omit, - ocr: bool | Omit = omit, + include_images: Union[bool, Literal["true", "false"]] | Omit = omit, + include_links: Union[bool, Literal["true", "false"]] | Omit = omit, + ocr: Union[bool, Literal["true", "false"]] | Omit = omit, pdf: parse_handle_params.Pdf | Omit = omit, - shorten_base64_images: bool | Omit = omit, - use_main_content_only: bool | Omit = omit, + shorten_base64_images: Union[bool, Literal["true", "false"]] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -321,33 +337,38 @@ async def handle( ) -> ParseHandleResponse: """ Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes - into LLM-usable Markdown. The base request costs 1 credit. When OCR runs - (requires ocr=true), the entire call costs 5 credits; ocr=true requests where no - OCR ends up running still cost 1 credit. + into LLM-usable Markdown. Args: - extension: Optional file extension hint. Case-insensitive; a leading dot is accepted (e.g. - ".pdf"). + client: Optional client identifier used for usage attribution. + + extension: Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, + md, py, rtf, jpg, png, or txt. include_images: Include image references in Markdown output include_links: Preserve hyperlinks in Markdown output - ocr: Gates all OCR. When true, PDFs get embedded-image OCR (recognized text inserted - at each image's position in page reading order, preserving the text layer; - pdf.start/pdf.end limit the page range), scanned PDFs with no text layer get - full-document OCR, and raster images get their visible text transcribed. When - false, no OCR runs: scanned PDFs may yield no content and images return only - format/dimension metadata. Calls where OCR actually runs cost 5 credits instead - of 1. + ocr: When true for PDF inputs, detect and OCR images embedded in the selected pages, + inserting recognized text at each image's position in page reading order while + preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. + When false, all OCR is disabled, including the automatic scanned-PDF fallback. - pdf: PDF page-range controls. Use start/end to limit parsing (and OCR when ocr=true) - to an inclusive 1-based page range. + pdf: PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. shorten_base64_images: Shorten base64-encoded image data in the Markdown output + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + use_main_content_only: Extract only the main content from HTML-like inputs + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -367,13 +388,16 @@ async def handle( timeout=timeout, query=await async_maybe_transform( { + "client": client, "extension": extension, "include_images": include_images, "include_links": include_links, "ocr": ocr, "pdf": pdf, "shorten_base64_images": shorten_base64_images, + "tags": tags, "use_main_content_only": use_main_content_only, + "zdr": zdr, }, parse_handle_params.ParseHandleParams, ), diff --git a/src/context/dev/resources/utility.py b/src/context/dev/resources/utility.py index e44220f..d7d10f0 100644 --- a/src/context/dev/resources/utility.py +++ b/src/context/dev/resources/utility.py @@ -7,7 +7,7 @@ import httpx from ..types import utility_prefetch_params -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -48,6 +48,7 @@ def prefetch( *, identifier: utility_prefetch_params.Identifier, type: Literal["brand"], + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -68,6 +69,8 @@ def prefetch( type: What to prefetch. Currently only 'brand' is supported. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -86,6 +89,7 @@ def prefetch( { "identifier": identifier, "type": type, + "tags": tags, "timeout_ms": timeout_ms, }, utility_prefetch_params.UtilityPrefetchParams, @@ -122,6 +126,7 @@ async def prefetch( *, identifier: utility_prefetch_params.Identifier, type: Literal["brand"], + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -142,6 +147,8 @@ async def prefetch( type: What to prefetch. Currently only 'brand' is supported. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -160,6 +167,7 @@ async def prefetch( { "identifier": identifier, "type": type, + "tags": tags, "timeout_ms": timeout_ms, }, utility_prefetch_params.UtilityPrefetchParams, diff --git a/src/context/dev/resources/web.py b/src/context/dev/resources/web.py index 8a06e27..8d7aec7 100644 --- a/src/context/dev/resources/web.py +++ b/src/context/dev/resources/web.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal import httpx @@ -79,7 +79,9 @@ def extract( max_depth: int | Omit = omit, max_pages: int | Omit = omit, pdf: web_extract_params.Pdf | Omit = omit, + settle_animations: bool | Omit = omit, stop_after_ms: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -123,9 +125,15 @@ def extract( max_pages: Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5. + settle_animations: When true, waits briefly for CSS and transition animations to settle before + extracting each crawled page. Defaults to false. This adds a bit of latency in + 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). + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -155,7 +163,9 @@ def extract( "max_depth": max_depth, "max_pages": max_pages, "pdf": pdf, + "settle_animations": settle_animations, "stop_after_ms": stop_after_ms, + "tags": tags, "timeout_ms": timeout_ms, "wait_for_ms": wait_for_ms, }, @@ -172,6 +182,7 @@ def extract_competitors( *, domain: str, num_competitors: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -190,6 +201,10 @@ def extract_competitors( num_competitors: Exact number of direct competitors to return. Defaults to 5. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -213,6 +228,7 @@ def extract_competitors( { "domain": domain, "num_competitors": num_competitors, + "tags": tags, "timeout_ms": timeout_ms, }, web_extract_competitors_params.WebExtractCompetitorsParams, @@ -226,7 +242,8 @@ def extract_fonts( *, direct_url: str | Omit = omit, domain: str | Omit = omit, - max_age_ms: int | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -248,11 +265,15 @@ def extract_fonts( domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both. - max_age_ms: Maximum age in milliseconds for cached data before the API performs a hard + max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -277,6 +298,7 @@ def extract_fonts( "direct_url": direct_url, "domain": domain, "max_age_ms": max_age_ms, + "tags": tags, "timeout_ms": timeout_ms, }, web_extract_fonts_params.WebExtractFontsParams, @@ -291,7 +313,8 @@ def extract_styleguide( color_scheme: Literal["light", "dark"] | Omit = omit, direct_url: str | Omit = omit, domain: str | Omit = omit, - max_age_ms: int | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -317,11 +340,15 @@ def extract_styleguide( domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both. - max_age_ms: Maximum age in milliseconds for cached data before the API performs a hard + max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -347,6 +374,7 @@ def extract_styleguide( "direct_url": direct_url, "domain": domain, "max_age_ms": max_age_ms, + "tags": tags, "timeout_ms": timeout_ms, }, web_extract_styleguide_params.WebExtractStyleguideParams, @@ -569,13 +597,15 @@ def screenshot( direct_url: str | Omit = omit, domain: str | Omit = omit, full_screenshot: Literal["true", "false"] | Omit = omit, - handle_cookie_popup: Literal["true", "false"] | Omit = omit, - max_age_ms: int | Omit = omit, + handle_cookie_popup: Union[bool, Literal["true", "false"]] | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] | Omit = omit, - scroll_offset: int | Omit = omit, + scroll_offset: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, viewport: web_screenshot_params.Viewport | Omit = omit, - wait_for_ms: int | Omit = omit, + wait_for_ms: Optional[int] | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -590,8 +620,9 @@ def screenshot( color_scheme: Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances. - country: Two-letter ISO 3166-1 alpha-2 country code for the website request location. - When provided, Context.dev fetches the target page from that country. + country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + residential proxy exit location. Must be one of Context.dev's supported + countries. When provided, Context.dev fetches the target page from that country. direct_url: A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this @@ -626,6 +657,10 @@ def screenshot( top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -636,6 +671,11 @@ def screenshot( the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted. + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -662,9 +702,11 @@ def screenshot( "max_age_ms": max_age_ms, "page": page, "scroll_offset": scroll_offset, + "tags": tags, "timeout_ms": timeout_ms, "viewport": viewport, "wait_for_ms": wait_for_ms, + "zdr": zdr, }, web_screenshot_params.WebScreenshotParams, ), @@ -924,6 +966,7 @@ def search( markdown_options: web_search_params.MarkdownOptions | Omit = omit, num_results: int | Omit = omit, query_fanout: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -956,6 +999,8 @@ def search( query_fanout: Expand the query into multiple parallel variants for broader recall. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -980,6 +1025,7 @@ def search( "markdown_options": markdown_options, "num_results": num_results, "query_fanout": query_fanout, + "tags": tags, "timeout_ms": timeout_ms, }, web_search_params.WebSearchParams, @@ -1214,10 +1260,12 @@ def web_crawl_md( settle_animations: bool | Omit = omit, shorten_base64_images: bool | Omit = omit, stop_after_ms: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, url_regex: str | Omit = omit, use_main_content_only: bool | Omit = omit, wait_for_ms: int | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1278,6 +1326,8 @@ def web_crawl_md( instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s). + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -1290,6 +1340,11 @@ def web_crawl_md( wait_for_ms: Optional browser wait time in milliseconds after initial page load for each crawled page. 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1317,10 +1372,12 @@ def web_crawl_md( "settle_animations": settle_animations, "shorten_base64_images": shorten_base64_images, "stop_after_ms": stop_after_ms, + "tags": tags, "timeout_ms": timeout_ms, "url_regex": url_regex, "use_main_content_only": use_main_content_only, "wait_for_ms": wait_for_ms, + "zdr": zdr, }, web_web_crawl_md_params.WebWebCrawlMdParams, ), @@ -1334,6 +1391,7 @@ def web_scrape_html( self, *, url: str, + actions: Optional[Iterable[web_web_scrape_html_params.Action]] | Omit = omit, country: Literal[ "ad", "ae", @@ -1541,16 +1599,18 @@ def web_scrape_html( "zw", ] | Omit = omit, - exclude_selectors: SequenceNotStr[str] | Omit = omit, + exclude_selectors: Optional[SequenceNotStr[str]] | Omit = omit, headers: Dict[str, str] | Omit = omit, - include_frames: bool | Omit = omit, - include_selectors: SequenceNotStr[str] | Omit = omit, - max_age_ms: int | Omit = omit, + include_frames: Union[bool, Literal["true", "false"]] | Omit = omit, + include_selectors: Optional[SequenceNotStr[str]] | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, pdf: web_web_scrape_html_params.Pdf | Omit = omit, - settle_animations: bool | Omit = omit, + settle_animations: Union[bool, Literal["true", "false"]] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, - use_main_content_only: bool | Omit = omit, - wait_for_ms: int | Omit = omit, + use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit, + wait_for_ms: Optional[int] | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1558,14 +1618,21 @@ def web_scrape_html( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebWebScrapeHTMLResponse: - """ - Scrapes the given URL and returns the raw HTML content of the page. + """Scrapes the given URL and returns the raw HTML content of the page. + + The base + request costs 1 credit; requests with browser actions cost 2 credits. Args: url: Full URL to scrape (must include http:// or https:// protocol) - country: Two-letter ISO 3166-1 alpha-2 country code for the website request location. - When provided, Context.dev fetches the target page from that country. + actions: Optional browser actions executed in array order after the page loads and before + content is captured. Requires a paid plan. Send a JSON array in the query + parameter. Maximum: 5 actions. + + country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + residential proxy exit location. Must be one of Context.dev's supported + countries. When provided, Context.dev fetches the target page from that country. exclude_selectors: CSS selectors to remove from the result. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: @@ -1592,6 +1659,10 @@ def web_scrape_html( extracting HTML. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -1603,6 +1674,11 @@ def web_scrape_html( Optional browser wait time in milliseconds after initial page load. 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1621,6 +1697,7 @@ def web_scrape_html( query=maybe_transform( { "url": url, + "actions": actions, "country": country, "exclude_selectors": exclude_selectors, "headers": headers, @@ -1629,9 +1706,11 @@ def web_scrape_html( "max_age_ms": max_age_ms, "pdf": pdf, "settle_animations": settle_animations, + "tags": tags, "timeout_ms": timeout_ms, "use_main_content_only": use_main_content_only, "wait_for_ms": wait_for_ms, + "zdr": zdr, }, web_web_scrape_html_params.WebWebScrapeHTMLParams, ), @@ -1643,12 +1722,14 @@ def web_scrape_images( self, *, url: str, - dedupe: bool | Omit = omit, - enrichment: web_web_scrape_images_params.Enrichment | Omit = omit, + actions: Optional[Iterable[web_web_scrape_images_params.Action]] | Omit = omit, + dedupe: Union[bool, Literal["true", "false"]] | Omit = omit, + enrichment: Optional[web_web_scrape_images_params.Enrichment] | Omit = omit, headers: Dict[str, str] | Omit = omit, - max_age_ms: int | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, - wait_for_ms: int | Omit = omit, + wait_for_ms: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1659,12 +1740,17 @@ def web_scrape_images( """ Extract image assets from a web page, including standard URLs, inline SVGs, data URIs, responsive image sources, metadata, CSS backgrounds, video posters, and - embeds. The base request costs 1 credit. When enrichment is enabled, the entire - call costs 5 credits. + embeds. The base request costs 1 credit, or 2 credits with browser actions. When + enrichment is enabled, the entire call costs 5 credits, including requests that + also use actions. Args: url: Page URL to inspect. Must include http:// or https://. + actions: Optional browser actions executed in array order after the page loads and before + content is captured. Requires a paid plan. Send a JSON array in the query + parameter. Maximum: 5 actions. + dedupe: When true, visually duplicate images are removed: every image is loaded and perceptually hashed, and only the highest-resolution copy of each duplicate group is kept. Images that cannot be downloaded or hashed are kept. Default: @@ -1680,6 +1766,10 @@ def web_scrape_images( max_age_ms: Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -1705,10 +1795,12 @@ def web_scrape_images( query=maybe_transform( { "url": url, + "actions": actions, "dedupe": dedupe, "enrichment": enrichment, "headers": headers, "max_age_ms": max_age_ms, + "tags": tags, "timeout_ms": timeout_ms, "wait_for_ms": wait_for_ms, }, @@ -1722,6 +1814,7 @@ def web_scrape_md( self, *, url: str, + actions: Optional[Iterable[web_web_scrape_md_params.Action]] | Omit = omit, country: Literal[ "ad", "ae", @@ -1929,19 +2022,21 @@ def web_scrape_md( "zw", ] | Omit = omit, - exclude_selectors: SequenceNotStr[str] | Omit = omit, + exclude_selectors: Optional[SequenceNotStr[str]] | Omit = omit, headers: Dict[str, str] | Omit = omit, - include_frames: bool | Omit = omit, - include_images: bool | Omit = omit, - include_links: bool | Omit = omit, - include_selectors: SequenceNotStr[str] | Omit = omit, - max_age_ms: int | Omit = omit, + include_frames: Union[bool, Literal["true", "false"]] | Omit = omit, + include_images: Union[bool, Literal["true", "false"]] | Omit = omit, + include_links: Union[bool, Literal["true", "false"]] | Omit = omit, + include_selectors: Optional[SequenceNotStr[str]] | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, pdf: web_web_scrape_md_params.Pdf | Omit = omit, - settle_animations: bool | Omit = omit, - shorten_base64_images: bool | Omit = omit, + settle_animations: Union[bool, Literal["true", "false"]] | Omit = omit, + shorten_base64_images: Union[bool, Literal["true", "false"]] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, - use_main_content_only: bool | Omit = omit, - wait_for_ms: int | Omit = omit, + use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit, + wait_for_ms: Optional[int] | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1957,23 +2052,28 @@ def web_scrape_md( ### Billing & errors - | HTTP status | Billed? | Meaning | - | ----------- | -------------- | ---------------------------------------------------------------------------------------- | - | 200 | Yes — 1 credit | 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 | - | 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 | + | 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 | + | 415 | No | Unsupported content type | + | 429 | No | Per-minute rate limit exceeded; honor Retry-After | + | 500 | No | Internal error | Args: url: Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol) - country: Two-letter ISO 3166-1 alpha-2 country code for the website request location. - When provided, Context.dev fetches the target page from that country. + actions: Optional browser actions executed in array order after the page loads and before + content is captured. Requires a paid plan. Send a JSON array in the query + parameter. Maximum: 5 actions. + + country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + residential proxy exit location. Must be one of Context.dev's supported + countries. When provided, Context.dev fetches the target page from that country. exclude_selectors: CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is @@ -2006,6 +2106,10 @@ def web_scrape_md( shorten_base64_images: Shorten base64-encoded image data in the Markdown output + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2016,6 +2120,11 @@ def web_scrape_md( wait_for_ms: Optional browser wait time in milliseconds after initial page load before converting the page to Markdown. 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2034,6 +2143,7 @@ def web_scrape_md( query=maybe_transform( { "url": url, + "actions": actions, "country": country, "exclude_selectors": exclude_selectors, "headers": headers, @@ -2045,9 +2155,11 @@ def web_scrape_md( "pdf": pdf, "settle_animations": settle_animations, "shorten_base64_images": shorten_base64_images, + "tags": tags, "timeout_ms": timeout_ms, "use_main_content_only": use_main_content_only, "wait_for_ms": wait_for_ms, + "zdr": zdr, }, web_web_scrape_md_params.WebWebScrapeMdParams, ), @@ -2061,8 +2173,11 @@ def web_scrape_sitemap( domain: str, headers: Dict[str, str] | Omit = omit, max_links: int | Omit = omit, + sitemap_url: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, url_regex: str | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2083,6 +2198,13 @@ def web_scrape_sitemap( max_links: Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Minimum is 1, maximum is 100,000. + sitemap_url: Optional explicit sitemap URL. When provided, exactly this sitemap is crawled + instead of discovering the domain's sitemaps. + + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2090,6 +2212,11 @@ def web_scrape_sitemap( url_regex: Optional RE2-compatible regex pattern. Only URLs matching this pattern are returned and counted against maxLinks. + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2110,8 +2237,11 @@ def web_scrape_sitemap( "domain": domain, "headers": headers, "max_links": max_links, + "sitemap_url": sitemap_url, + "tags": tags, "timeout_ms": timeout_ms, "url_regex": url_regex, + "zdr": zdr, }, web_web_scrape_sitemap_params.WebWebScrapeSitemapParams, ), @@ -2153,7 +2283,9 @@ async def extract( max_depth: int | Omit = omit, max_pages: int | Omit = omit, pdf: web_extract_params.Pdf | Omit = omit, + settle_animations: bool | Omit = omit, stop_after_ms: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2197,9 +2329,15 @@ async def extract( max_pages: Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5. + settle_animations: When true, waits briefly for CSS and transition animations to settle before + extracting each crawled page. Defaults to false. This adds a bit of latency in + 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). + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2229,7 +2367,9 @@ async def extract( "max_depth": max_depth, "max_pages": max_pages, "pdf": pdf, + "settle_animations": settle_animations, "stop_after_ms": stop_after_ms, + "tags": tags, "timeout_ms": timeout_ms, "wait_for_ms": wait_for_ms, }, @@ -2246,6 +2386,7 @@ async def extract_competitors( *, domain: str, num_competitors: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2264,6 +2405,10 @@ async def extract_competitors( num_competitors: Exact number of direct competitors to return. Defaults to 5. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2287,6 +2432,7 @@ async def extract_competitors( { "domain": domain, "num_competitors": num_competitors, + "tags": tags, "timeout_ms": timeout_ms, }, web_extract_competitors_params.WebExtractCompetitorsParams, @@ -2300,7 +2446,8 @@ async def extract_fonts( *, direct_url: str | Omit = omit, domain: str | Omit = omit, - max_age_ms: int | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2322,11 +2469,15 @@ async def extract_fonts( domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both. - max_age_ms: Maximum age in milliseconds for cached data before the API performs a hard + max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2351,6 +2502,7 @@ async def extract_fonts( "direct_url": direct_url, "domain": domain, "max_age_ms": max_age_ms, + "tags": tags, "timeout_ms": timeout_ms, }, web_extract_fonts_params.WebExtractFontsParams, @@ -2365,7 +2517,8 @@ async def extract_styleguide( color_scheme: Literal["light", "dark"] | Omit = omit, direct_url: str | Omit = omit, domain: str | Omit = omit, - max_age_ms: int | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2391,11 +2544,15 @@ async def extract_styleguide( domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both. - max_age_ms: Maximum age in milliseconds for cached data before the API performs a hard + max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2421,6 +2578,7 @@ async def extract_styleguide( "direct_url": direct_url, "domain": domain, "max_age_ms": max_age_ms, + "tags": tags, "timeout_ms": timeout_ms, }, web_extract_styleguide_params.WebExtractStyleguideParams, @@ -2643,13 +2801,15 @@ async def screenshot( direct_url: str | Omit = omit, domain: str | Omit = omit, full_screenshot: Literal["true", "false"] | Omit = omit, - handle_cookie_popup: Literal["true", "false"] | Omit = omit, - max_age_ms: int | Omit = omit, + handle_cookie_popup: Union[bool, Literal["true", "false"]] | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] | Omit = omit, - scroll_offset: int | Omit = omit, + scroll_offset: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, viewport: web_screenshot_params.Viewport | Omit = omit, - wait_for_ms: int | Omit = omit, + wait_for_ms: Optional[int] | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2664,8 +2824,9 @@ async def screenshot( color_scheme: Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances. - country: Two-letter ISO 3166-1 alpha-2 country code for the website request location. - When provided, Context.dev fetches the target page from that country. + country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + residential proxy exit location. Must be one of Context.dev's supported + countries. When provided, Context.dev fetches the target page from that country. direct_url: A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this @@ -2700,6 +2861,10 @@ async def screenshot( top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -2710,6 +2875,11 @@ async def screenshot( the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted. + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2736,9 +2906,11 @@ async def screenshot( "max_age_ms": max_age_ms, "page": page, "scroll_offset": scroll_offset, + "tags": tags, "timeout_ms": timeout_ms, "viewport": viewport, "wait_for_ms": wait_for_ms, + "zdr": zdr, }, web_screenshot_params.WebScreenshotParams, ), @@ -2998,6 +3170,7 @@ async def search( markdown_options: web_search_params.MarkdownOptions | Omit = omit, num_results: int | Omit = omit, query_fanout: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3030,6 +3203,8 @@ async def search( query_fanout: Expand the query into multiple parallel variants for broader recall. + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -3054,6 +3229,7 @@ async def search( "markdown_options": markdown_options, "num_results": num_results, "query_fanout": query_fanout, + "tags": tags, "timeout_ms": timeout_ms, }, web_search_params.WebSearchParams, @@ -3288,10 +3464,12 @@ async def web_crawl_md( settle_animations: bool | Omit = omit, shorten_base64_images: bool | Omit = omit, stop_after_ms: int | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, url_regex: str | Omit = omit, use_main_content_only: bool | Omit = omit, wait_for_ms: int | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3352,6 +3530,8 @@ async def web_crawl_md( instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s). + tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -3364,6 +3544,11 @@ async def web_crawl_md( wait_for_ms: Optional browser wait time in milliseconds after initial page load for each crawled page. 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3391,10 +3576,12 @@ async def web_crawl_md( "settle_animations": settle_animations, "shorten_base64_images": shorten_base64_images, "stop_after_ms": stop_after_ms, + "tags": tags, "timeout_ms": timeout_ms, "url_regex": url_regex, "use_main_content_only": use_main_content_only, "wait_for_ms": wait_for_ms, + "zdr": zdr, }, web_web_crawl_md_params.WebWebCrawlMdParams, ), @@ -3408,6 +3595,7 @@ async def web_scrape_html( self, *, url: str, + actions: Optional[Iterable[web_web_scrape_html_params.Action]] | Omit = omit, country: Literal[ "ad", "ae", @@ -3615,16 +3803,18 @@ async def web_scrape_html( "zw", ] | Omit = omit, - exclude_selectors: SequenceNotStr[str] | Omit = omit, + exclude_selectors: Optional[SequenceNotStr[str]] | Omit = omit, headers: Dict[str, str] | Omit = omit, - include_frames: bool | Omit = omit, - include_selectors: SequenceNotStr[str] | Omit = omit, - max_age_ms: int | Omit = omit, + include_frames: Union[bool, Literal["true", "false"]] | Omit = omit, + include_selectors: Optional[SequenceNotStr[str]] | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, pdf: web_web_scrape_html_params.Pdf | Omit = omit, - settle_animations: bool | Omit = omit, + settle_animations: Union[bool, Literal["true", "false"]] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, - use_main_content_only: bool | Omit = omit, - wait_for_ms: int | Omit = omit, + use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit, + wait_for_ms: Optional[int] | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3632,14 +3822,21 @@ async def web_scrape_html( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebWebScrapeHTMLResponse: - """ - Scrapes the given URL and returns the raw HTML content of the page. + """Scrapes the given URL and returns the raw HTML content of the page. + + The base + request costs 1 credit; requests with browser actions cost 2 credits. Args: url: Full URL to scrape (must include http:// or https:// protocol) - country: Two-letter ISO 3166-1 alpha-2 country code for the website request location. - When provided, Context.dev fetches the target page from that country. + actions: Optional browser actions executed in array order after the page loads and before + content is captured. Requires a paid plan. Send a JSON array in the query + parameter. Maximum: 5 actions. + + country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + residential proxy exit location. Must be one of Context.dev's supported + countries. When provided, Context.dev fetches the target page from that country. exclude_selectors: CSS selectors to remove from the result. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: @@ -3666,6 +3863,10 @@ async def web_scrape_html( extracting HTML. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages. + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -3677,6 +3878,11 @@ async def web_scrape_html( Optional browser wait time in milliseconds after initial page load. 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3695,6 +3901,7 @@ async def web_scrape_html( query=await async_maybe_transform( { "url": url, + "actions": actions, "country": country, "exclude_selectors": exclude_selectors, "headers": headers, @@ -3703,9 +3910,11 @@ async def web_scrape_html( "max_age_ms": max_age_ms, "pdf": pdf, "settle_animations": settle_animations, + "tags": tags, "timeout_ms": timeout_ms, "use_main_content_only": use_main_content_only, "wait_for_ms": wait_for_ms, + "zdr": zdr, }, web_web_scrape_html_params.WebWebScrapeHTMLParams, ), @@ -3717,12 +3926,14 @@ async def web_scrape_images( self, *, url: str, - dedupe: bool | Omit = omit, - enrichment: web_web_scrape_images_params.Enrichment | Omit = omit, + actions: Optional[Iterable[web_web_scrape_images_params.Action]] | Omit = omit, + dedupe: Union[bool, Literal["true", "false"]] | Omit = omit, + enrichment: Optional[web_web_scrape_images_params.Enrichment] | Omit = omit, headers: Dict[str, str] | Omit = omit, - max_age_ms: int | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, - wait_for_ms: int | Omit = omit, + wait_for_ms: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3733,12 +3944,17 @@ async def web_scrape_images( """ Extract image assets from a web page, including standard URLs, inline SVGs, data URIs, responsive image sources, metadata, CSS backgrounds, video posters, and - embeds. The base request costs 1 credit. When enrichment is enabled, the entire - call costs 5 credits. + embeds. The base request costs 1 credit, or 2 credits with browser actions. When + enrichment is enabled, the entire call costs 5 credits, including requests that + also use actions. Args: url: Page URL to inspect. Must include http:// or https://. + actions: Optional browser actions executed in array order after the page loads and before + content is captured. Requires a paid plan. Send a JSON array in the query + parameter. Maximum: 5 actions. + dedupe: When true, visually duplicate images are removed: every image is loaded and perceptually hashed, and only the highest-resolution copy of each duplicate group is kept. Images that cannot be downloaded or hashed are kept. Default: @@ -3754,6 +3970,10 @@ async def web_scrape_images( max_age_ms: Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -3779,10 +3999,12 @@ async def web_scrape_images( query=await async_maybe_transform( { "url": url, + "actions": actions, "dedupe": dedupe, "enrichment": enrichment, "headers": headers, "max_age_ms": max_age_ms, + "tags": tags, "timeout_ms": timeout_ms, "wait_for_ms": wait_for_ms, }, @@ -3796,6 +4018,7 @@ async def web_scrape_md( self, *, url: str, + actions: Optional[Iterable[web_web_scrape_md_params.Action]] | Omit = omit, country: Literal[ "ad", "ae", @@ -4003,19 +4226,21 @@ async def web_scrape_md( "zw", ] | Omit = omit, - exclude_selectors: SequenceNotStr[str] | Omit = omit, + exclude_selectors: Optional[SequenceNotStr[str]] | Omit = omit, headers: Dict[str, str] | Omit = omit, - include_frames: bool | Omit = omit, - include_images: bool | Omit = omit, - include_links: bool | Omit = omit, - include_selectors: SequenceNotStr[str] | Omit = omit, - max_age_ms: int | Omit = omit, + include_frames: Union[bool, Literal["true", "false"]] | Omit = omit, + include_images: Union[bool, Literal["true", "false"]] | Omit = omit, + include_links: Union[bool, Literal["true", "false"]] | Omit = omit, + include_selectors: Optional[SequenceNotStr[str]] | Omit = omit, + max_age_ms: Optional[int] | Omit = omit, pdf: web_web_scrape_md_params.Pdf | Omit = omit, - settle_animations: bool | Omit = omit, - shorten_base64_images: bool | Omit = omit, + settle_animations: Union[bool, Literal["true", "false"]] | Omit = omit, + shorten_base64_images: Union[bool, Literal["true", "false"]] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, - use_main_content_only: bool | Omit = omit, - wait_for_ms: int | Omit = omit, + use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit, + wait_for_ms: Optional[int] | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4031,23 +4256,28 @@ async def web_scrape_md( ### Billing & errors - | HTTP status | Billed? | Meaning | - | ----------- | -------------- | ---------------------------------------------------------------------------------------- | - | 200 | Yes — 1 credit | 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 | - | 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 | + | 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 | + | 415 | No | Unsupported content type | + | 429 | No | Per-minute rate limit exceeded; honor Retry-After | + | 500 | No | Internal error | Args: url: Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol) - country: Two-letter ISO 3166-1 alpha-2 country code for the website request location. - When provided, Context.dev fetches the target page from that country. + actions: Optional browser actions executed in array order after the page loads and before + content is captured. Requires a paid plan. Send a JSON array in the query + parameter. Maximum: 5 actions. + + country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + residential proxy exit location. Must be one of Context.dev's supported + countries. When provided, Context.dev fetches the target page from that country. exclude_selectors: CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is @@ -4080,6 +4310,10 @@ async def web_scrape_md( shorten_base64_images: Shorten base64-encoded image data in the Markdown output + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -4090,6 +4324,11 @@ async def web_scrape_md( wait_for_ms: Optional browser wait time in milliseconds after initial page load before converting the page to Markdown. 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4108,6 +4347,7 @@ async def web_scrape_md( query=await async_maybe_transform( { "url": url, + "actions": actions, "country": country, "exclude_selectors": exclude_selectors, "headers": headers, @@ -4119,9 +4359,11 @@ async def web_scrape_md( "pdf": pdf, "settle_animations": settle_animations, "shorten_base64_images": shorten_base64_images, + "tags": tags, "timeout_ms": timeout_ms, "use_main_content_only": use_main_content_only, "wait_for_ms": wait_for_ms, + "zdr": zdr, }, web_web_scrape_md_params.WebWebScrapeMdParams, ), @@ -4135,8 +4377,11 @@ async def web_scrape_sitemap( domain: str, headers: Dict[str, str] | Omit = omit, max_links: int | Omit = omit, + sitemap_url: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, timeout_ms: int | Omit = omit, url_regex: str | Omit = omit, + zdr: Literal["enabled", "disabled"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4157,6 +4402,13 @@ async def web_scrape_sitemap( max_links: Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Minimum is 1, maximum is 100,000. + sitemap_url: Optional explicit sitemap URL. When provided, exactly this sitemap is crawled + instead of discovering the domain's sitemaps. + + tags: Optional comma-separated caller-defined tags for tracking this request. Tags are + recorded on the request's usage log and can be used to filter usage on the + dashboard usage page. Up to 20 tags, each 1-50 characters. + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). @@ -4164,6 +4416,11 @@ async def web_scrape_sitemap( url_regex: Optional RE2-compatible regex pattern. Only URLs matching this pattern are returned and counted against maxLinks. + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4184,8 +4441,11 @@ async def web_scrape_sitemap( "domain": domain, "headers": headers, "max_links": max_links, + "sitemap_url": sitemap_url, + "tags": tags, "timeout_ms": timeout_ms, "url_regex": url_regex, + "zdr": zdr, }, web_web_scrape_sitemap_params.WebWebScrapeSitemapParams, ), diff --git a/src/context/dev/types/__init__.py b/src/context/dev/types/__init__.py index 2a14820..e1ced36 100644 --- a/src/context/dev/types/__init__.py +++ b/src/context/dev/types/__init__.py @@ -36,6 +36,7 @@ from .web_web_scrape_html_params import WebWebScrapeHTMLParams as WebWebScrapeHTMLParams from .web_web_scrape_md_response import WebWebScrapeMdResponse as WebWebScrapeMdResponse from .ai_extract_product_response import AIExtractProductResponse as AIExtractProductResponse +from .monitor_get_limits_response import MonitorGetLimitsResponse as MonitorGetLimitsResponse from .monitor_list_changes_params import MonitorListChangesParams as MonitorListChangesParams from .ai_extract_products_response import AIExtractProductsResponse as AIExtractProductsResponse from .industry_retrieve_sic_params import IndustryRetrieveSicParams as IndustryRetrieveSicParams @@ -48,6 +49,7 @@ from .industry_retrieve_sic_response import IndustryRetrieveSicResponse as IndustryRetrieveSicResponse from .web_extract_competitors_params import WebExtractCompetitorsParams as WebExtractCompetitorsParams from .web_web_scrape_images_response import WebWebScrapeImagesResponse as WebWebScrapeImagesResponse +from .monitor_get_credit_usage_params import MonitorGetCreditUsageParams as MonitorGetCreditUsageParams from .web_extract_styleguide_response import WebExtractStyleguideResponse as WebExtractStyleguideResponse from .web_web_scrape_sitemap_response import WebWebScrapeSitemapResponse as WebWebScrapeSitemapResponse from .brand_retrieve_simplified_params import BrandRetrieveSimplifiedParams as BrandRetrieveSimplifiedParams @@ -55,6 +57,7 @@ from .monitor_list_account_runs_params import MonitorListAccountRunsParams as MonitorListAccountRunsParams from .monitor_retrieve_change_response import MonitorRetrieveChangeResponse as MonitorRetrieveChangeResponse from .web_extract_competitors_response import WebExtractCompetitorsResponse as WebExtractCompetitorsResponse +from .monitor_get_credit_usage_response import MonitorGetCreditUsageResponse as MonitorGetCreditUsageResponse from .brand_retrieve_simplified_response import BrandRetrieveSimplifiedResponse as BrandRetrieveSimplifiedResponse from .monitor_list_account_runs_response import MonitorListAccountRunsResponse as MonitorListAccountRunsResponse from .monitor_list_account_changes_params import MonitorListAccountChangesParams as MonitorListAccountChangesParams diff --git a/src/context/dev/types/ai_extract_product_params.py b/src/context/dev/types/ai_extract_product_params.py index 95a1617..2b051e6 100644 --- a/src/context/dev/types/ai_extract_product_params.py +++ b/src/context/dev/types/ai_extract_product_params.py @@ -4,6 +4,7 @@ from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["AIExtractProductParams"] @@ -20,6 +21,9 @@ class AIExtractProductParams(TypedDict, total=False): omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. """ + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/ai_extract_products_params.py b/src/context/dev/types/ai_extract_products_params.py index 1ca1027..41e542f 100644 --- a/src/context/dev/types/ai_extract_products_params.py +++ b/src/context/dev/types/ai_extract_products_params.py @@ -5,6 +5,7 @@ from typing import Union from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["AIExtractProductsParams", "ByDomain", "ByDirectURL"] @@ -24,6 +25,9 @@ class ByDomain(TypedDict, total=False): max_products: Annotated[int, PropertyInfo(alias="maxProducts")] """Maximum number of products to extract.""" + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -49,6 +53,9 @@ class ByDirectURL(TypedDict, total=False): max_products: Annotated[int, PropertyInfo(alias="maxProducts")] """Maximum number of products to extract.""" + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/brand_retrieve_params.py b/src/context/dev/types/brand_retrieve_params.py index b3b894f..b501452 100644 --- a/src/context/dev/types/brand_retrieve_params.py +++ b/src/context/dev/types/brand_retrieve_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Union +from typing import Union, Optional from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = [ @@ -25,127 +26,129 @@ class BrandRetrieveByDomainRequest(TypedDict, total=False): type: Required[Literal["by_domain"]] """Discriminator for domain-based brand retrieval.""" - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] @@ -163,6 +166,9 @@ class BrandRetrieveByDomainRequest(TypedDict, total=False): response at the cost of less comprehensive data. """ + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -184,127 +190,129 @@ class BrandRetrieveByNameRequest(TypedDict, total=False): by company name. """ - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] @@ -322,6 +330,9 @@ class BrandRetrieveByNameRequest(TypedDict, total=False): response at the cost of less comprehensive data. """ + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -337,127 +348,129 @@ class BrandRetrieveByEmailRequest(TypedDict, total=False): type: Required[Literal["by_email"]] """Discriminator for email-based brand retrieval.""" - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] @@ -475,6 +488,9 @@ class BrandRetrieveByEmailRequest(TypedDict, total=False): response at the cost of less comprehensive data. """ + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -490,127 +506,129 @@ class BrandRetrieveByTickerRequest(TypedDict, total=False): type: Required[Literal["by_ticker"]] """Discriminator for ticker-based brand retrieval.""" - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] @@ -628,6 +646,9 @@ class BrandRetrieveByTickerRequest(TypedDict, total=False): response at the cost of less comprehensive data. """ + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + ticker_exchange: str """Optional stock exchange for the ticker. Defaults to NASDAQ if not specified.""" @@ -650,6 +671,9 @@ class BrandRetrieveByDirectURLRequest(TypedDict, total=False): type: Required[Literal["by_direct_url"]] """Discriminator for direct-URL-based brand retrieval.""" + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -674,127 +698,129 @@ class BrandRetrieveFromTransactionRequest(TypedDict, total=False): identifying a transaction. """ - force_language: Literal[ - "afrikaans", - "albanian", - "amharic", - "arabic", - "armenian", - "assamese", - "aymara", - "azeri", - "basque", - "belarusian", - "bengali", - "bosnian", - "bulgarian", - "burmese", - "cantonese", - "catalan", - "cebuano", - "chinese", - "corsican", - "croatian", - "czech", - "danish", - "dutch", - "english", - "esperanto", - "estonian", - "farsi", - "fijian", - "finnish", - "french", - "galician", - "georgian", - "german", - "greek", - "guarani", - "gujarati", - "haitian-creole", - "hausa", - "hawaiian", - "hebrew", - "hindi", - "hmong", - "hungarian", - "icelandic", - "igbo", - "indonesian", - "irish", - "italian", - "japanese", - "javanese", - "kannada", - "kazakh", - "khmer", - "kinyarwanda", - "korean", - "kurdish", - "kyrgyz", - "lao", - "latin", - "latvian", - "lingala", - "lithuanian", - "luxembourgish", - "macedonian", - "malagasy", - "malay", - "malayalam", - "maltese", - "maori", - "marathi", - "mongolian", - "nepali", - "norwegian", - "odia", - "oromo", - "pashto", - "pidgin", - "polish", - "portuguese", - "punjabi", - "quechua", - "romanian", - "russian", - "samoan", - "scottish-gaelic", - "serbian", - "sesotho", - "shona", - "sindhi", - "sinhala", - "slovak", - "slovene", - "somali", - "spanish", - "sundanese", - "swahili", - "swedish", - "tagalog", - "tajik", - "tamil", - "tatar", - "telugu", - "thai", - "tibetan", - "tigrinya", - "tongan", - "tswana", - "turkish", - "turkmen", - "ukrainian", - "urdu", - "uyghur", - "uzbek", - "vietnamese", - "welsh", - "wolof", - "xhosa", - "yiddish", - "yoruba", - "zulu", + force_language: Optional[ + Literal[ + "afrikaans", + "albanian", + "amharic", + "arabic", + "armenian", + "assamese", + "aymara", + "azeri", + "basque", + "belarusian", + "bengali", + "bosnian", + "bulgarian", + "burmese", + "cantonese", + "catalan", + "cebuano", + "chinese", + "corsican", + "croatian", + "czech", + "danish", + "dutch", + "english", + "esperanto", + "estonian", + "farsi", + "fijian", + "finnish", + "french", + "galician", + "georgian", + "german", + "greek", + "guarani", + "gujarati", + "haitian-creole", + "hausa", + "hawaiian", + "hebrew", + "hindi", + "hmong", + "hungarian", + "icelandic", + "igbo", + "indonesian", + "irish", + "italian", + "japanese", + "javanese", + "kannada", + "kazakh", + "khmer", + "kinyarwanda", + "korean", + "kurdish", + "kyrgyz", + "lao", + "latin", + "latvian", + "lingala", + "lithuanian", + "luxembourgish", + "macedonian", + "malagasy", + "malay", + "malayalam", + "maltese", + "maori", + "marathi", + "mongolian", + "nepali", + "norwegian", + "odia", + "oromo", + "pashto", + "pidgin", + "polish", + "portuguese", + "punjabi", + "quechua", + "romanian", + "russian", + "samoan", + "scottish-gaelic", + "serbian", + "sesotho", + "shona", + "sindhi", + "sinhala", + "slovak", + "slovene", + "somali", + "spanish", + "sundanese", + "swahili", + "swedish", + "tagalog", + "tajik", + "tamil", + "tatar", + "telugu", + "thai", + "tibetan", + "tigrinya", + "tongan", + "tswana", + "turkish", + "turkmen", + "ukrainian", + "urdu", + "uyghur", + "uzbek", + "vietnamese", + "welsh", + "wolof", + "xhosa", + "yiddish", + "yoruba", + "zulu", + ] ] high_confidence_only: bool @@ -810,15 +836,18 @@ class BrandRetrieveFromTransactionRequest(TypedDict, total=False): response at the cost of less comprehensive data. """ - mcc: int + mcc: Union[str, float] """ Optional Merchant Category Code (MCC) to help identify the business category or industry. """ - phone: float + phone: Union[str, float] """Optional phone number from the transaction to help verify brand match.""" + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/brand_retrieve_response.py b/src/context/dev/types/brand_retrieve_response.py index 513402c..51fdb59 100644 --- a/src/context/dev/types/brand_retrieve_response.py +++ b/src/context/dev/types/brand_retrieve_response.py @@ -170,7 +170,6 @@ class BrandIndustriesEic(BaseModel): "Streaming Platforms (Video, Music, Audio)", "Gaming & Interactive Entertainment", "Creator Economy & Influencer Platforms", - "Advertising, Adtech & Media Buying", "Film, TV & Production Studios", "Events, Venues & Live Entertainment", "Virtual Worlds & Metaverse Experiences", @@ -231,6 +230,7 @@ class BrandIndustriesEic(BaseModel): "Streetwear & Emerging Luxury", "Couture & Made-to-Measure", "News Publishing & Journalism", + "Advertising, Adtech & Media Buying", "Digital Media & Content Platforms", "Broadcasting (TV & Radio)", "Podcasting & Audio Media", @@ -629,11 +629,7 @@ class Brand(BaseModel): "zulu", ] ] = None - """The primary language of the brand's website content. - - Detected from the HTML lang tag, page content analysis, or social media - descriptions. - """ + """Language to force for the retrieved brand data.""" slogan: Optional[str] = None """The brand's slogan""" diff --git a/src/context/dev/types/brand_retrieve_simplified_params.py b/src/context/dev/types/brand_retrieve_simplified_params.py index 4a60ba7..1f9f6d2 100644 --- a/src/context/dev/types/brand_retrieve_simplified_params.py +++ b/src/context/dev/types/brand_retrieve_simplified_params.py @@ -2,8 +2,10 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing import Optional +from typing_extensions import Literal, Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["BrandRetrieveSimplifiedParams"] @@ -13,7 +15,7 @@ class BrandRetrieveSimplifiedParams(TypedDict, total=False): domain: Required[str] """Domain name to retrieve simplified brand data for""" - max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] + max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")] """ Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) @@ -21,6 +23,16 @@ class BrandRetrieveSimplifiedParams(TypedDict, total=False): year. """ + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + + theme: Literal["light", "dark"] + """Optional theme preference used when selecting brand assets.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/industry_retrieve_naics_params.py b/src/context/dev/types/industry_retrieve_naics_params.py index 03db484..8872ab8 100644 --- a/src/context/dev/types/industry_retrieve_naics_params.py +++ b/src/context/dev/types/industry_retrieve_naics_params.py @@ -4,6 +4,7 @@ from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["IndustryRetrieveNaicsParams"] @@ -26,6 +27,13 @@ class IndustryRetrieveNaicsParams(TypedDict, total=False): min_results: Annotated[int, PropertyInfo(alias="minResults")] """Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.""" + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/industry_retrieve_sic_params.py b/src/context/dev/types/industry_retrieve_sic_params.py index 2d9e23d..b79f0b6 100644 --- a/src/context/dev/types/industry_retrieve_sic_params.py +++ b/src/context/dev/types/industry_retrieve_sic_params.py @@ -4,6 +4,7 @@ from typing_extensions import Literal, Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["IndustryRetrieveSicParams"] @@ -23,6 +24,13 @@ class IndustryRetrieveSicParams(TypedDict, total=False): min_results: Annotated[int, PropertyInfo(alias="minResults")] """Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.""" + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/monitor_create_params.py b/src/context/dev/types/monitor_create_params.py index 0fa626e..bdf55ea 100644 --- a/src/context/dev/types/monitor_create_params.py +++ b/src/context/dev/types/monitor_create_params.py @@ -45,7 +45,10 @@ class MonitorCreateParams(TypedDict, total=False): """ tags: SequenceNotStr[str] - """User-defined tags for grouping and filtering monitors and their changes.""" + """User-defined tags for grouping and filtering monitors and their changes. + + Duplicates are removed. + """ webhook: Optional[Webhook] @@ -116,10 +119,10 @@ class TargetMonitorsSitemapTarget(TypedDict, total=False): """Sitemap URL to monitor.""" exclude: SequenceNotStr[str] - """URL path patterns to exclude.""" + """URL path patterns to exclude (max 50).""" include: SequenceNotStr[str] - """URL path patterns to include.""" + """URL path patterns to include (max 50).""" max_urls: int """Maximum number of sitemap URLs to track (capped at 10,000).""" diff --git a/src/context/dev/types/monitor_create_response.py b/src/context/dev/types/monitor_create_response.py index d42c0a1..0a23ad1 100644 --- a/src/context/dev/types/monitor_create_response.py +++ b/src/context/dev/types/monitor_create_response.py @@ -96,10 +96,10 @@ class TargetMonitorsSitemapTarget(BaseModel): """Sitemap URL to monitor.""" exclude: Optional[List[str]] = None - """URL path patterns to exclude.""" + """URL path patterns to exclude (max 50).""" include: Optional[List[str]] = None - """URL path patterns to include.""" + """URL path patterns to include (max 50).""" max_urls: Optional[int] = None """Maximum number of sitemap URLs to track (capped at 10,000).""" @@ -312,7 +312,10 @@ class MonitorCreateResponse(BaseModel): """When the next scheduled run is due.""" tags: Optional[List[str]] = None - """User-defined tags for grouping and filtering monitors and their changes.""" + """User-defined tags for grouping and filtering monitors and their changes. + + Duplicates are removed. + """ webhook: Optional[Webhook] = None diff --git a/src/context/dev/types/monitor_get_credit_usage_params.py b/src/context/dev/types/monitor_get_credit_usage_params.py new file mode 100644 index 0000000..b9a0048 --- /dev/null +++ b/src/context/dev/types/monitor_get_credit_usage_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["MonitorGetCreditUsageParams"] + + +class MonitorGetCreditUsageParams(TypedDict, total=False): + since: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Only include items at or after this ISO 8601 timestamp.""" + + until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Only include items before this ISO 8601 timestamp.""" diff --git a/src/context/dev/types/monitor_get_credit_usage_response.py b/src/context/dev/types/monitor_get_credit_usage_response.py new file mode 100644 index 0000000..b43643b --- /dev/null +++ b/src/context/dev/types/monitor_get_credit_usage_response.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel + +__all__ = ["MonitorGetCreditUsageResponse", "Data"] + + +class Data(BaseModel): + credits: int + """Credits charged to this monitor over the window.""" + + monitor_id: str + + name: str + """Monitor name (falls back to the id when the monitor was deleted).""" + + runs: int + """Number of billed runs over the window.""" + + +class MonitorGetCreditUsageResponse(BaseModel): + data: List[Data] + + total_credits: int + """Sum of credits across all monitors in the window.""" diff --git a/src/context/dev/types/monitor_get_limits_response.py b/src/context/dev/types/monitor_get_limits_response.py new file mode 100644 index 0000000..14ffdcd --- /dev/null +++ b/src/context/dev/types/monitor_get_limits_response.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["MonitorGetLimitsResponse"] + + +class MonitorGetLimitsResponse(BaseModel): + monitors_limit: int + """Maximum number of monitors allowed for the account. + + Defaults to the plan allowance unless a custom limit is set for the + organization. + """ + + monitors_used: int + """Number of monitors the account currently has.""" + + plan: Literal["free", "starter", "pro", "scale"] + """The plan tier the limit was resolved from.""" diff --git a/src/context/dev/types/monitor_list_account_changes_params.py b/src/context/dev/types/monitor_list_account_changes_params.py index 82e684a..71a4bb2 100644 --- a/src/context/dev/types/monitor_list_account_changes_params.py +++ b/src/context/dev/types/monitor_list_account_changes_params.py @@ -13,18 +13,25 @@ class MonitorListAccountChangesParams(TypedDict, total=False): change_detection_type: Literal["exact", "semantic"] + """Filter by change detection type.""" cursor: str + """Opaque pagination cursor from a previous response.""" limit: int + """Maximum number of items to return per page (1-100). Defaults to 25.""" monitor_id: str + """Filter changes to a single monitor.""" since: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Only include items at or after this ISO 8601 timestamp.""" tag: str """Filter to items that have this tag.""" target_type: Literal["page", "sitemap", "extract"] + """Filter by target type.""" until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Only include items before this ISO 8601 timestamp.""" diff --git a/src/context/dev/types/monitor_list_account_changes_response.py b/src/context/dev/types/monitor_list_account_changes_response.py index f3c3d50..8441582 100644 --- a/src/context/dev/types/monitor_list_account_changes_response.py +++ b/src/context/dev/types/monitor_list_account_changes_response.py @@ -49,7 +49,10 @@ class Data(BaseModel): removed_url_count: Optional[int] = None tags: Optional[List[str]] = None - """User-defined tags for grouping and filtering monitors and their changes.""" + """User-defined tags for grouping and filtering monitors and their changes. + + Duplicates are removed. + """ class MonitorListAccountChangesResponse(BaseModel): diff --git a/src/context/dev/types/monitor_list_account_runs_params.py b/src/context/dev/types/monitor_list_account_runs_params.py index 6329e57..def3248 100644 --- a/src/context/dev/types/monitor_list_account_runs_params.py +++ b/src/context/dev/types/monitor_list_account_runs_params.py @@ -9,12 +9,10 @@ class MonitorListAccountRunsParams(TypedDict, total=False): cursor: str + """Opaque pagination cursor from a previous response.""" limit: int + """Maximum number of items to return per page (1-100). Defaults to 25.""" status: Literal["queued", "running", "completed", "failed", "skipped"] - """Lifecycle status of a run. - - `skipped` runs never executed — see `skip_reason` (insufficient credits, monitor - paused, or superseded by a concurrent run). - """ + """Filter runs by lifecycle status.""" diff --git a/src/context/dev/types/monitor_list_changes_params.py b/src/context/dev/types/monitor_list_changes_params.py index a4f75cd..4670564 100644 --- a/src/context/dev/types/monitor_list_changes_params.py +++ b/src/context/dev/types/monitor_list_changes_params.py @@ -13,12 +13,16 @@ class MonitorListChangesParams(TypedDict, total=False): cursor: str + """Opaque pagination cursor from a previous response.""" limit: int + """Maximum number of items to return per page (1-100). Defaults to 25.""" since: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Only include items at or after this ISO 8601 timestamp.""" tag: str """Filter to items that have this tag.""" until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Only include items before this ISO 8601 timestamp.""" diff --git a/src/context/dev/types/monitor_list_changes_response.py b/src/context/dev/types/monitor_list_changes_response.py index b9ed3fe..7f436eb 100644 --- a/src/context/dev/types/monitor_list_changes_response.py +++ b/src/context/dev/types/monitor_list_changes_response.py @@ -49,7 +49,10 @@ class Data(BaseModel): removed_url_count: Optional[int] = None tags: Optional[List[str]] = None - """User-defined tags for grouping and filtering monitors and their changes.""" + """User-defined tags for grouping and filtering monitors and their changes. + + Duplicates are removed. + """ class MonitorListChangesResponse(BaseModel): diff --git a/src/context/dev/types/monitor_list_params.py b/src/context/dev/types/monitor_list_params.py index 6750db5..913f244 100644 --- a/src/context/dev/types/monitor_list_params.py +++ b/src/context/dev/types/monitor_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List +from typing import List, Optional from typing_extensions import Literal, TypedDict from .._types import SequenceNotStr @@ -12,15 +12,18 @@ class MonitorListParams(TypedDict, total=False): change_detection_type: Literal["exact", "semantic"] + """Filter by change detection type.""" cursor: str + """Opaque pagination cursor from a previous response.""" limit: int + """Maximum number of items to return per page (1-100). Defaults to 25.""" q: str """Free-text search term, matched against the fields named in `search_by`.""" - search_by: List[Literal["name", "url", "instructions", "tags"]] + search_by: Optional[List[Literal["name", "url", "instructions", "tags"]]] """Comma-separated fields to search with `q`. Defaults to all of them. Note `instructions` only exists on extract monitors. @@ -33,20 +36,15 @@ class MonitorListParams(TypedDict, total=False): """ status: Literal["active", "paused", "failed"] - """Monitor lifecycle status. - - `failed` means the most recent run failed (see the monitor's `last_error`); - failed monitors keep running on schedule and flip back to `active` on the next - successful run. Monitors are auto-`paused` after repeated consecutive failures - or insufficient-credit skips; resume by PATCHing status to `active`. - """ + """Filter monitors by lifecycle status.""" tag: str """Filter to items that have this tag.""" - tags: SequenceNotStr[str] + tags: Optional[SequenceNotStr[str]] """ Comma-separated list of tags to filter by (matches monitors having any of them). """ target_type: Literal["page", "sitemap", "extract"] + """Filter by target type.""" diff --git a/src/context/dev/types/monitor_list_response.py b/src/context/dev/types/monitor_list_response.py index a4af010..475b767 100644 --- a/src/context/dev/types/monitor_list_response.py +++ b/src/context/dev/types/monitor_list_response.py @@ -97,10 +97,10 @@ class DataTargetMonitorsSitemapTarget(BaseModel): """Sitemap URL to monitor.""" exclude: Optional[List[str]] = None - """URL path patterns to exclude.""" + """URL path patterns to exclude (max 50).""" include: Optional[List[str]] = None - """URL path patterns to include.""" + """URL path patterns to include (max 50).""" max_urls: Optional[int] = None """Maximum number of sitemap URLs to track (capped at 10,000).""" @@ -313,7 +313,10 @@ class Data(BaseModel): """When the next scheduled run is due.""" tags: Optional[List[str]] = None - """User-defined tags for grouping and filtering monitors and their changes.""" + """User-defined tags for grouping and filtering monitors and their changes. + + Duplicates are removed. + """ webhook: Optional[DataWebhook] = None diff --git a/src/context/dev/types/monitor_list_runs_params.py b/src/context/dev/types/monitor_list_runs_params.py index dbfa379..ea1ba35 100644 --- a/src/context/dev/types/monitor_list_runs_params.py +++ b/src/context/dev/types/monitor_list_runs_params.py @@ -9,12 +9,10 @@ class MonitorListRunsParams(TypedDict, total=False): cursor: str + """Opaque pagination cursor from a previous response.""" limit: int + """Maximum number of items to return per page (1-100). Defaults to 25.""" status: Literal["queued", "running", "completed", "failed", "skipped"] - """Lifecycle status of a run. - - `skipped` runs never executed — see `skip_reason` (insufficient credits, monitor - paused, or superseded by a concurrent run). - """ + """Filter runs by lifecycle status.""" diff --git a/src/context/dev/types/monitor_retrieve_change_response.py b/src/context/dev/types/monitor_retrieve_change_response.py index 3bef95e..067f465 100644 --- a/src/context/dev/types/monitor_retrieve_change_response.py +++ b/src/context/dev/types/monitor_retrieve_change_response.py @@ -47,7 +47,10 @@ class MonitorRetrieveChangeResponse(BaseModel): summary: str tags: List[str] - """User-defined tags for grouping and filtering monitors and their changes.""" + """User-defined tags for grouping and filtering monitors and their changes. + + Duplicates are removed. + """ target_type: Literal["page", "sitemap", "extract"] diff --git a/src/context/dev/types/monitor_retrieve_response.py b/src/context/dev/types/monitor_retrieve_response.py index a9a623c..e47be52 100644 --- a/src/context/dev/types/monitor_retrieve_response.py +++ b/src/context/dev/types/monitor_retrieve_response.py @@ -96,10 +96,10 @@ class TargetMonitorsSitemapTarget(BaseModel): """Sitemap URL to monitor.""" exclude: Optional[List[str]] = None - """URL path patterns to exclude.""" + """URL path patterns to exclude (max 50).""" include: Optional[List[str]] = None - """URL path patterns to include.""" + """URL path patterns to include (max 50).""" max_urls: Optional[int] = None """Maximum number of sitemap URLs to track (capped at 10,000).""" @@ -312,7 +312,10 @@ class MonitorRetrieveResponse(BaseModel): """When the next scheduled run is due.""" tags: Optional[List[str]] = None - """User-defined tags for grouping and filtering monitors and their changes.""" + """User-defined tags for grouping and filtering monitors and their changes. + + Duplicates are removed. + """ webhook: Optional[Webhook] = None diff --git a/src/context/dev/types/monitor_update_params.py b/src/context/dev/types/monitor_update_params.py index d0cb7bd..da61ef0 100644 --- a/src/context/dev/types/monitor_update_params.py +++ b/src/context/dev/types/monitor_update_params.py @@ -37,7 +37,10 @@ class MonitorUpdateParams(TypedDict, total=False): status: Literal["active", "paused"] tags: SequenceNotStr[str] - """User-defined tags for grouping and filtering monitors and their changes.""" + """User-defined tags for grouping and filtering monitors and their changes. + + Duplicates are removed. + """ target: Target """Discriminated union describing what the monitor watches.""" @@ -112,10 +115,10 @@ class TargetMonitorsSitemapTarget(TypedDict, total=False): """Sitemap URL to monitor.""" exclude: SequenceNotStr[str] - """URL path patterns to exclude.""" + """URL path patterns to exclude (max 50).""" include: SequenceNotStr[str] - """URL path patterns to include.""" + """URL path patterns to include (max 50).""" max_urls: int """Maximum number of sitemap URLs to track (capped at 10,000).""" diff --git a/src/context/dev/types/monitor_update_response.py b/src/context/dev/types/monitor_update_response.py index 4f6757c..61ee9ef 100644 --- a/src/context/dev/types/monitor_update_response.py +++ b/src/context/dev/types/monitor_update_response.py @@ -96,10 +96,10 @@ class TargetMonitorsSitemapTarget(BaseModel): """Sitemap URL to monitor.""" exclude: Optional[List[str]] = None - """URL path patterns to exclude.""" + """URL path patterns to exclude (max 50).""" include: Optional[List[str]] = None - """URL path patterns to include.""" + """URL path patterns to include (max 50).""" max_urls: Optional[int] = None """Maximum number of sitemap URLs to track (capped at 10,000).""" @@ -312,7 +312,10 @@ class MonitorUpdateResponse(BaseModel): """When the next scheduled run is due.""" tags: Optional[List[str]] = None - """User-defined tags for grouping and filtering monitors and their changes.""" + """User-defined tags for grouping and filtering monitors and their changes. + + Duplicates are removed. + """ webhook: Optional[Webhook] = None diff --git a/src/context/dev/types/parse_handle_params.py b/src/context/dev/types/parse_handle_params.py index 2acfa4f..e48e164 100644 --- a/src/context/dev/types/parse_handle_params.py +++ b/src/context/dev/types/parse_handle_params.py @@ -2,14 +2,19 @@ from __future__ import annotations +from typing import Union from typing_extensions import Literal, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["ParseHandleParams", "Pdf"] class ParseHandleParams(TypedDict, total=False): + client: str + """Optional client identifier used for usage attribution.""" + extension: Literal[ "txt", "text", @@ -82,48 +87,53 @@ class ParseHandleParams(TypedDict, total=False): "pgm", "pnm", ] - """Optional file extension hint. - - Case-insensitive; a leading dot is accepted (e.g. ".pdf"). + """ + Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, + md, py, rtf, jpg, png, or txt. """ - include_images: Annotated[bool, PropertyInfo(alias="includeImages")] + include_images: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="includeImages")] """Include image references in Markdown output""" - include_links: Annotated[bool, PropertyInfo(alias="includeLinks")] + include_links: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="includeLinks")] """Preserve hyperlinks in Markdown output""" - ocr: bool - """Gates all OCR. - - When true, PDFs get embedded-image OCR (recognized text inserted at each image's - position in page reading order, preserving the text layer; pdf.start/pdf.end - limit the page range), scanned PDFs with no text layer get full-document OCR, - and raster images get their visible text transcribed. When false, no OCR runs: - scanned PDFs may yield no content and images return only format/dimension - metadata. Calls where OCR actually runs cost 5 credits instead of 1. + ocr: Union[bool, Literal["true", "false"]] + """ + When true for PDF inputs, detect and OCR images embedded in the selected pages, + inserting recognized text at each image's position in page reading order while + preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. + When false, all OCR is disabled, including the automatic scanned-PDF fallback. """ pdf: Pdf - """PDF page-range controls. - - Use start/end to limit parsing (and OCR when ocr=true) to an inclusive 1-based - page range. - """ + """PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.""" - shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")] + shorten_base64_images: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="shortenBase64Images")] """Shorten base64-encoded image data in the Markdown output""" - use_main_content_only: Annotated[bool, PropertyInfo(alias="useMainContentOnly")] - """Extract only the main content from HTML-like inputs""" + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ -class Pdf(TypedDict, total=False): - """PDF page-range controls. + use_main_content_only: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="useMainContentOnly")] + """Extract only the main content from HTML-like inputs""" - Use start/end to limit parsing (and OCR when ocr=true) to an inclusive 1-based page range. + zdr: Literal["enabled", "disabled"] + """ + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. """ + +class Pdf(TypedDict, total=False): + """PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.""" + end: int """Last 1-based PDF page to parse. diff --git a/src/context/dev/types/utility_prefetch_params.py b/src/context/dev/types/utility_prefetch_params.py index 05d5a10..3e82039 100644 --- a/src/context/dev/types/utility_prefetch_params.py +++ b/src/context/dev/types/utility_prefetch_params.py @@ -5,6 +5,7 @@ from typing import Union from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = [ @@ -22,6 +23,9 @@ class UtilityPrefetchParams(TypedDict, total=False): type: Required[Literal["brand"]] """What to prefetch. Currently only 'brand' is supported.""" + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/web_extract_competitors_params.py b/src/context/dev/types/web_extract_competitors_params.py index ecfe90e..d9c3dc8 100644 --- a/src/context/dev/types/web_extract_competitors_params.py +++ b/src/context/dev/types/web_extract_competitors_params.py @@ -4,6 +4,7 @@ from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["WebExtractCompetitorsParams"] @@ -19,6 +20,13 @@ class WebExtractCompetitorsParams(TypedDict, total=False): num_competitors: Annotated[int, PropertyInfo(alias="numCompetitors")] """Exact number of direct competitors to return. Defaults to 5.""" + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/web_extract_fonts_params.py b/src/context/dev/types/web_extract_fonts_params.py index 86d8c7c..6441118 100644 --- a/src/context/dev/types/web_extract_fonts_params.py +++ b/src/context/dev/types/web_extract_fonts_params.py @@ -2,8 +2,10 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["WebExtractFontsParams"] @@ -24,14 +26,21 @@ class WebExtractFontsParams(TypedDict, total=False): either 'domain' or 'directUrl', but not both. """ - max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] + max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")] """ - Maximum age in milliseconds for cached data before the API performs a hard + Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year. """ + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/web_extract_params.py b/src/context/dev/types/web_extract_params.py index 20137e3..16de5c2 100644 --- a/src/context/dev/types/web_extract_params.py +++ b/src/context/dev/types/web_extract_params.py @@ -5,6 +5,7 @@ from typing import Dict from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["WebExtractParams", "Pdf"] @@ -63,12 +64,22 @@ class WebExtractParams(TypedDict, total=False): pdf: Pdf + settle_animations: Annotated[bool, PropertyInfo(alias="settleAnimations")] + """ + When true, waits briefly for CSS and transition animations to settle before + extracting each crawled page. Defaults to false. This adds a bit of latency in + exchange for more stable output on animated pages. + """ + 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). """ + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/web_extract_styleguide_params.py b/src/context/dev/types/web_extract_styleguide_params.py index 6f32efe..ab51344 100644 --- a/src/context/dev/types/web_extract_styleguide_params.py +++ b/src/context/dev/types/web_extract_styleguide_params.py @@ -2,8 +2,10 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Literal, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["WebExtractStyleguideParams"] @@ -31,14 +33,21 @@ class WebExtractStyleguideParams(TypedDict, total=False): either 'domain' or 'directUrl', but not both. """ - max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] + max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")] """ - Maximum age in milliseconds for cached data before the API performs a hard + Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year. """ + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/web_screenshot_params.py b/src/context/dev/types/web_screenshot_params.py index 122c095..918b6c9 100644 --- a/src/context/dev/types/web_screenshot_params.py +++ b/src/context/dev/types/web_screenshot_params.py @@ -2,8 +2,10 @@ from __future__ import annotations +from typing import Union, Optional from typing_extensions import Literal, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["WebScreenshotParams", "Viewport"] @@ -222,9 +224,10 @@ class WebScreenshotParams(TypedDict, total=False): "zm", "zw", ] - """Two-letter ISO 3166-1 alpha-2 country code for the website request location. - - When provided, Context.dev fetches the target page from that country. + """ + Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + residential proxy exit location. Must be one of Context.dev's supported + countries. When provided, Context.dev fetches the target page from that country. """ direct_url: Annotated[str, PropertyInfo(alias="directUrl")] @@ -248,14 +251,14 @@ class WebScreenshotParams(TypedDict, total=False): provided, takes a viewport screenshot (standard browser view). """ - handle_cookie_popup: Annotated[Literal["true", "false"], PropertyInfo(alias="handleCookiePopup")] + handle_cookie_popup: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="handleCookiePopup")] """Optional parameter to control cookie/consent popup handling. If 'true', we dismiss cookie banner before capture. If 'false' or not provided, captures the page without that step. """ - max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] + max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")] """ Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when @@ -271,7 +274,7 @@ class WebScreenshotParams(TypedDict, total=False): applicable when using 'domain', not 'directUrl'. """ - scroll_offset: Annotated[int, PropertyInfo(alias="scrollOffset")] + scroll_offset: Annotated[Optional[int], PropertyInfo(alias="scrollOffset")] """ Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the @@ -281,6 +284,13 @@ class WebScreenshotParams(TypedDict, total=False): precedence over fullScreenshot. Max: 100000. """ + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -291,13 +301,21 @@ class WebScreenshotParams(TypedDict, total=False): viewport: Viewport """Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.""" - wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")] + wait_for_ms: Annotated[Optional[int], PropertyInfo(alias="waitForMs")] """ Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted. """ + zdr: Literal["enabled", "disabled"] + """ + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + """ + class Viewport(TypedDict, total=False): """Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.""" diff --git a/src/context/dev/types/web_screenshot_response.py b/src/context/dev/types/web_screenshot_response.py index a051831..b1f8504 100644 --- a/src/context/dev/types/web_screenshot_response.py +++ b/src/context/dev/types/web_screenshot_response.py @@ -41,7 +41,10 @@ class WebScreenshotResponse(BaseModel): """ screenshot: Optional[str] = None - """Public URL of the uploaded screenshot image""" + """ + Public image URL for standard requests, or an in-memory data URL when ZDR is + enabled. + """ screenshot_type: Optional[Literal["viewport", "fullPage"]] = FieldInfo(alias="screenshotType", default=None) """Type of screenshot that was captured""" diff --git a/src/context/dev/types/web_search_params.py b/src/context/dev/types/web_search_params.py index dc38ced..25f1c10 100644 --- a/src/context/dev/types/web_search_params.py +++ b/src/context/dev/types/web_search_params.py @@ -288,6 +288,9 @@ class WebSearchParams(TypedDict, total=False): query_fanout: Annotated[bool, PropertyInfo(alias="queryFanout")] """Expand the query into multiple parallel variants for broader recall.""" + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. diff --git a/src/context/dev/types/web_web_crawl_md_params.py b/src/context/dev/types/web_web_crawl_md_params.py index 0a7adce..31eff91 100644 --- a/src/context/dev/types/web_web_crawl_md_params.py +++ b/src/context/dev/types/web_web_crawl_md_params.py @@ -298,6 +298,9 @@ class WebWebCrawlMdParams(TypedDict, total=False): (110s). Default: 80000 (80s). """ + tags: SequenceNotStr[str] + """Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.""" + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -320,6 +323,14 @@ class WebWebCrawlMdParams(TypedDict, total=False): crawled page. Min: 0. Max: 30000 (30 seconds). """ + zdr: Literal["enabled", "disabled"] + """ + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + """ + class Pdf(TypedDict, total=False): """PDF parsing controls. diff --git a/src/context/dev/types/web_web_scrape_html_params.py b/src/context/dev/types/web_web_scrape_html_params.py index ae419ee..d47752c 100644 --- a/src/context/dev/types/web_web_scrape_html_params.py +++ b/src/context/dev/types/web_web_scrape_html_params.py @@ -2,19 +2,26 @@ from __future__ import annotations -from typing import Dict -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._types import SequenceNotStr from .._utils import PropertyInfo -__all__ = ["WebWebScrapeHTMLParams", "Pdf"] +__all__ = ["WebWebScrapeHTMLParams", "Action", "ActionWebScrapeWaitAction", "ActionWebScrapePerformAction", "Pdf"] class WebWebScrapeHTMLParams(TypedDict, total=False): url: Required[str] """Full URL to scrape (must include http:// or https:// protocol)""" + actions: Optional[Iterable[Action]] + """ + Optional browser actions executed in array order after the page loads and before + content is captured. Requires a paid plan. Send a JSON array in the query + parameter. Maximum: 5 actions. + """ + country: Literal[ "ad", "ae", @@ -221,12 +228,13 @@ class WebWebScrapeHTMLParams(TypedDict, total=False): "zm", "zw", ] - """Two-letter ISO 3166-1 alpha-2 country code for the website request location. - - When provided, Context.dev fetches the target page from that country. + """ + Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + residential proxy exit location. Must be one of Context.dev's supported + countries. When provided, Context.dev fetches the target page from that country. """ - exclude_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="excludeSelectors")] + exclude_selectors: Annotated[Optional[SequenceNotStr[str]], PropertyInfo(alias="excludeSelectors")] """CSS selectors to remove from the result. Applied after includeSelectors. Exclusion takes precedence: an element matching @@ -240,10 +248,10 @@ class WebWebScrapeHTMLParams(TypedDict, total=False): is bypassed: the result is neither read from nor written to cache. """ - include_frames: Annotated[bool, PropertyInfo(alias="includeFrames")] + include_frames: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="includeFrames")] """When true, iframes are rendered inline into the returned HTML.""" - include_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="includeSelectors")] + include_selectors: Annotated[Optional[SequenceNotStr[str]], PropertyInfo(alias="includeSelectors")] """CSS selectors. When provided, only matching subtrees (and their descendants) are kept and @@ -251,7 +259,7 @@ class WebWebScrapeHTMLParams(TypedDict, total=False): "article.main", "#content", "[role=main]". """ - max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] + max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")] """ Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when @@ -265,13 +273,20 @@ class WebWebScrapeHTMLParams(TypedDict, total=False): inclusive 1-based page range. """ - settle_animations: Annotated[bool, PropertyInfo(alias="settleAnimations")] + settle_animations: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="settleAnimations")] """ When true, waits briefly for CSS and transition animations to settle before extracting HTML. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages. """ + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -279,18 +294,45 @@ class WebWebScrapeHTMLParams(TypedDict, total=False): status code. Maximum allowed value is 300000ms (5 minutes). """ - use_main_content_only: Annotated[bool, PropertyInfo(alias="useMainContentOnly")] + use_main_content_only: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="useMainContentOnly")] """ When true, return only the page's main content in the HTML response, excluding headers, footers, sidebars, and navigation when detectable. """ - wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")] + wait_for_ms: Annotated[Optional[int], PropertyInfo(alias="waitForMs")] """Optional browser wait time in milliseconds after initial page load. Min: 0. Max: 30000 (30 seconds). """ + zdr: Literal["enabled", "disabled"] + """ + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + """ + + +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"]] + + +Action: TypeAlias = Union[ActionWebScrapeWaitAction, ActionWebScrapePerformAction] + class Pdf(TypedDict, total=False): """PDF parsing controls. @@ -305,14 +347,14 @@ class Pdf(TypedDict, total=False): start when both are provided. """ - ocr: bool + ocr: Union[bool, Literal["true", "false"]] """ When true, detect and OCR images embedded in the selected PDF pages, inserting recognized text at each image's position in page reading order while preserving the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. """ - should_parse: Annotated[bool, PropertyInfo(alias="shouldParse")] + should_parse: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="shouldParse")] """When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 WEBSITE_ACCESS_ERROR is returned. diff --git a/src/context/dev/types/web_web_scrape_images_params.py b/src/context/dev/types/web_web_scrape_images_params.py index f745001..b2fb384 100644 --- a/src/context/dev/types/web_web_scrape_images_params.py +++ b/src/context/dev/types/web_web_scrape_images_params.py @@ -2,19 +2,33 @@ from __future__ import annotations -from typing import Dict -from typing_extensions import Required, Annotated, TypedDict +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo -__all__ = ["WebWebScrapeImagesParams", "Enrichment"] +__all__ = [ + "WebWebScrapeImagesParams", + "Action", + "ActionWebScrapeWaitAction", + "ActionWebScrapePerformAction", + "Enrichment", +] class WebWebScrapeImagesParams(TypedDict, total=False): url: Required[str] """Page URL to inspect. Must include http:// or https://.""" - dedupe: bool + actions: Optional[Iterable[Action]] + """ + Optional browser actions executed in array order after the page loads and before + content is captured. Requires a paid plan. Send a JSON array in the query + parameter. Maximum: 5 actions. + """ + + dedupe: Union[bool, Literal["true", "false"]] """ When true, visually duplicate images are removed: every image is loaded and perceptually hashed, and only the highest-resolution copy of each duplicate @@ -22,7 +36,7 @@ class WebWebScrapeImagesParams(TypedDict, total=False): false. """ - enrichment: Enrichment + enrichment: Optional[Enrichment] """ Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true. @@ -35,13 +49,20 @@ class WebWebScrapeImagesParams(TypedDict, total=False): is bypassed: the result is neither read from nor written to cache. """ - max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] + max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")] """Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). """ + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -49,22 +70,41 @@ class WebWebScrapeImagesParams(TypedDict, total=False): status code. Maximum allowed value is 300000ms (5 minutes). """ - wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")] + wait_for_ms: Annotated[Optional[int], PropertyInfo(alias="waitForMs")] """ Optional browser wait time in milliseconds after initial page load before collecting images. Min: 0. Max: 30000 (30 seconds). """ +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"]] + + +Action: TypeAlias = Union[ActionWebScrapeWaitAction, ActionWebScrapePerformAction] + + class Enrichment(TypedDict, total=False): """ Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true. """ - classification: bool + classification: Union[bool, Literal["true", "false"]] """Classify each image by visual asset type.""" - hosted_url: Annotated[bool, PropertyInfo(alias="hostedUrl")] + hosted_url: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="hostedUrl")] """ Host materializable images on the Brand.dev CDN and return their URL and MIME type. @@ -73,5 +113,5 @@ class Enrichment(TypedDict, total=False): max_time_per_ms: Annotated[int, PropertyInfo(alias="maxTimePerMs")] """Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.""" - resolution: bool + resolution: Union[bool, Literal["true", "false"]] """Measure image width and height when possible.""" diff --git a/src/context/dev/types/web_web_scrape_md_params.py b/src/context/dev/types/web_web_scrape_md_params.py index 89b6156..d18a710 100644 --- a/src/context/dev/types/web_web_scrape_md_params.py +++ b/src/context/dev/types/web_web_scrape_md_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Dict -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._types import SequenceNotStr from .._utils import PropertyInfo -__all__ = ["WebWebScrapeMdParams", "Pdf"] +__all__ = ["WebWebScrapeMdParams", "Action", "ActionWebScrapeWaitAction", "ActionWebScrapePerformAction", "Pdf"] class WebWebScrapeMdParams(TypedDict, total=False): @@ -18,6 +18,13 @@ class WebWebScrapeMdParams(TypedDict, total=False): protocol) """ + actions: Optional[Iterable[Action]] + """ + Optional browser actions executed in array order after the page loads and before + content is captured. Requires a paid plan. Send a JSON array in the query + parameter. Maximum: 5 actions. + """ + country: Literal[ "ad", "ae", @@ -224,12 +231,13 @@ class WebWebScrapeMdParams(TypedDict, total=False): "zm", "zw", ] - """Two-letter ISO 3166-1 alpha-2 country code for the website request location. - - When provided, Context.dev fetches the target page from that country. + """ + Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + residential proxy exit location. Must be one of Context.dev's supported + countries. When provided, Context.dev fetches the target page from that country. """ - exclude_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="excludeSelectors")] + exclude_selectors: Annotated[Optional[SequenceNotStr[str]], PropertyInfo(alias="excludeSelectors")] """CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching @@ -243,16 +251,16 @@ class WebWebScrapeMdParams(TypedDict, total=False): is bypassed: the result is neither read from nor written to cache. """ - include_frames: Annotated[bool, PropertyInfo(alias="includeFrames")] + include_frames: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="includeFrames")] """When true, the contents of iframes are rendered to Markdown.""" - include_images: Annotated[bool, PropertyInfo(alias="includeImages")] + include_images: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="includeImages")] """Include image references in Markdown output""" - include_links: Annotated[bool, PropertyInfo(alias="includeLinks")] + include_links: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="includeLinks")] """Preserve hyperlinks in Markdown output""" - include_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="includeSelectors")] + include_selectors: Annotated[Optional[SequenceNotStr[str]], PropertyInfo(alias="includeSelectors")] """CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept @@ -260,7 +268,7 @@ class WebWebScrapeMdParams(TypedDict, total=False): Examples: "article.main", "#content", "[role=main]". """ - max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] + max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")] """ Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when @@ -274,16 +282,23 @@ class WebWebScrapeMdParams(TypedDict, total=False): inclusive 1-based page range. """ - settle_animations: Annotated[bool, PropertyInfo(alias="settleAnimations")] + settle_animations: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="settleAnimations")] """ When true, waits briefly for CSS and transition animations to settle before converting to Markdown. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages. """ - shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")] + shorten_base64_images: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="shortenBase64Images")] """Shorten base64-encoded image data in the Markdown output""" + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -291,18 +306,45 @@ class WebWebScrapeMdParams(TypedDict, total=False): status code. Maximum allowed value is 300000ms (5 minutes). """ - use_main_content_only: Annotated[bool, PropertyInfo(alias="useMainContentOnly")] + use_main_content_only: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="useMainContentOnly")] """ Extract only the main content of the page, excluding headers, footers, sidebars, and navigation """ - wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")] + wait_for_ms: Annotated[Optional[int], PropertyInfo(alias="waitForMs")] """ Optional browser wait time in milliseconds after initial page load before converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). """ + zdr: Literal["enabled", "disabled"] + """ + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + """ + + +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"]] + + +Action: TypeAlias = Union[ActionWebScrapeWaitAction, ActionWebScrapePerformAction] + class Pdf(TypedDict, total=False): """PDF parsing controls. @@ -317,14 +359,14 @@ class Pdf(TypedDict, total=False): start when both are provided. """ - ocr: bool + ocr: Union[bool, Literal["true", "false"]] """ When true, detect and OCR images embedded in the selected PDF pages, inserting recognized text at each image's position in page reading order while preserving the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. """ - should_parse: Annotated[bool, PropertyInfo(alias="shouldParse")] + should_parse: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="shouldParse")] """When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 WEBSITE_ACCESS_ERROR is returned. diff --git a/src/context/dev/types/web_web_scrape_sitemap_params.py b/src/context/dev/types/web_web_scrape_sitemap_params.py index 1990d8b..468747d 100644 --- a/src/context/dev/types/web_web_scrape_sitemap_params.py +++ b/src/context/dev/types/web_web_scrape_sitemap_params.py @@ -3,8 +3,9 @@ from __future__ import annotations from typing import Dict -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["WebWebScrapeSitemapParams"] @@ -27,6 +28,20 @@ class WebWebScrapeSitemapParams(TypedDict, total=False): Defaults to 10,000. Minimum is 1, maximum is 100,000. """ + sitemap_url: Annotated[str, PropertyInfo(alias="sitemapUrl")] + """Optional explicit sitemap URL. + + When provided, exactly this sitemap is crawled instead of discovering the + domain's sitemaps. + """ + + tags: SequenceNotStr[str] + """Optional comma-separated caller-defined tags for tracking this request. + + Tags are recorded on the request's usage log and can be used to filter usage on + the dashboard usage page. Up to 20 tags, each 1-50 characters. + """ + timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -39,3 +54,11 @@ class WebWebScrapeSitemapParams(TypedDict, total=False): Only URLs matching this pattern are returned and counted against maxLinks. """ + + zdr: Literal["enabled", "disabled"] + """ + 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 + organization (contact support@context.dev), otherwise the request fails with + ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + """ diff --git a/tests/api_resources/test_ai.py b/tests/api_resources/test_ai.py index 1920c36..0851a95 100644 --- a/tests/api_resources/test_ai.py +++ b/tests/api_resources/test_ai.py @@ -34,6 +34,7 @@ def test_method_extract_product_with_all_params(self, client: ContextDev) -> Non ai = client.ai.extract_product( url="https://example.com", max_age_ms=0, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(AIExtractProductResponse, ai, path=["response"]) @@ -79,6 +80,7 @@ def test_method_extract_products_with_all_params_overload_1(self, client: Contex domain="domain", max_age_ms=0, max_products=1, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(AIExtractProductsResponse, ai, path=["response"]) @@ -124,6 +126,7 @@ def test_method_extract_products_with_all_params_overload_2(self, client: Contex direct_url="https://example.com", max_age_ms=0, max_products=1, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(AIExtractProductsResponse, ai, path=["response"]) @@ -174,6 +177,7 @@ async def test_method_extract_product_with_all_params(self, async_client: AsyncC ai = await async_client.ai.extract_product( url="https://example.com", max_age_ms=0, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(AIExtractProductResponse, ai, path=["response"]) @@ -219,6 +223,7 @@ async def test_method_extract_products_with_all_params_overload_1(self, async_cl domain="domain", max_age_ms=0, max_products=1, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(AIExtractProductsResponse, ai, path=["response"]) @@ -264,6 +269,7 @@ async def test_method_extract_products_with_all_params_overload_2(self, async_cl direct_url="https://example.com", max_age_ms=0, max_products=1, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(AIExtractProductsResponse, ai, path=["response"]) diff --git a/tests/api_resources/test_brand.py b/tests/api_resources/test_brand.py index 7125a15..9e921a6 100644 --- a/tests/api_resources/test_brand.py +++ b/tests/api_resources/test_brand.py @@ -24,7 +24,7 @@ class TestBrand: @parametrize def test_method_retrieve_overload_1(self, client: ContextDev) -> None: brand = client.brand.retrieve( - domain="domain", + domain="xxx", type="by_domain", ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -33,11 +33,12 @@ def test_method_retrieve_overload_1(self, client: ContextDev) -> None: @parametrize def test_method_retrieve_with_all_params_overload_1(self, client: ContextDev) -> None: brand = client.brand.retrieve( - domain="domain", + domain="xxx", type="by_domain", force_language="afrikaans", max_age_ms=0, max_speed=True, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -46,7 +47,7 @@ def test_method_retrieve_with_all_params_overload_1(self, client: ContextDev) -> @parametrize def test_raw_response_retrieve_overload_1(self, client: ContextDev) -> None: response = client.brand.with_raw_response.retrieve( - domain="domain", + domain="xxx", type="by_domain", ) @@ -59,7 +60,7 @@ def test_raw_response_retrieve_overload_1(self, client: ContextDev) -> None: @parametrize def test_streaming_response_retrieve_overload_1(self, client: ContextDev) -> None: with client.brand.with_streaming_response.retrieve( - domain="domain", + domain="xxx", type="by_domain", ) as response: assert not response.is_closed @@ -89,6 +90,7 @@ def test_method_retrieve_with_all_params_overload_2(self, client: ContextDev) -> force_language="afrikaans", max_age_ms=0, max_speed=True, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -139,6 +141,7 @@ def test_method_retrieve_with_all_params_overload_3(self, client: ContextDev) -> force_language="afrikaans", max_age_ms=0, max_speed=True, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -189,6 +192,7 @@ def test_method_retrieve_with_all_params_overload_4(self, client: ContextDev) -> force_language="afrikaans", max_age_ms=0, max_speed=True, + tags=["production", "team-alpha"], ticker_exchange="ticker_exchange", timeout_ms=1000, ) @@ -237,6 +241,7 @@ def test_method_retrieve_with_all_params_overload_5(self, client: ContextDev) -> brand = client.brand.retrieve( direct_url="https://example.com", type="by_direct_url", + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -289,8 +294,9 @@ def test_method_retrieve_with_all_params_overload_6(self, client: ContextDev) -> force_language="afrikaans", high_confidence_only=True, max_speed=True, - mcc=0, - phone=0, + mcc="string", + phone="string", + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -327,7 +333,7 @@ def test_streaming_response_retrieve_overload_6(self, client: ContextDev) -> Non @parametrize def test_method_retrieve_simplified(self, client: ContextDev) -> None: brand = client.brand.retrieve_simplified( - domain="domain", + domain="xxx", ) assert_matches_type(BrandRetrieveSimplifiedResponse, brand, path=["response"]) @@ -335,8 +341,10 @@ def test_method_retrieve_simplified(self, client: ContextDev) -> None: @parametrize def test_method_retrieve_simplified_with_all_params(self, client: ContextDev) -> None: brand = client.brand.retrieve_simplified( - domain="domain", - max_age_ms=86400000, + domain="xxx", + max_age_ms=0, + tags=["production", "team-alpha"], + theme="light", timeout_ms=1000, ) assert_matches_type(BrandRetrieveSimplifiedResponse, brand, path=["response"]) @@ -345,7 +353,7 @@ def test_method_retrieve_simplified_with_all_params(self, client: ContextDev) -> @parametrize def test_raw_response_retrieve_simplified(self, client: ContextDev) -> None: response = client.brand.with_raw_response.retrieve_simplified( - domain="domain", + domain="xxx", ) assert response.is_closed is True @@ -357,7 +365,7 @@ def test_raw_response_retrieve_simplified(self, client: ContextDev) -> None: @parametrize def test_streaming_response_retrieve_simplified(self, client: ContextDev) -> None: with client.brand.with_streaming_response.retrieve_simplified( - domain="domain", + domain="xxx", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -377,7 +385,7 @@ class TestAsyncBrand: @parametrize async def test_method_retrieve_overload_1(self, async_client: AsyncContextDev) -> None: brand = await async_client.brand.retrieve( - domain="domain", + domain="xxx", type="by_domain", ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -386,11 +394,12 @@ async def test_method_retrieve_overload_1(self, async_client: AsyncContextDev) - @parametrize async def test_method_retrieve_with_all_params_overload_1(self, async_client: AsyncContextDev) -> None: brand = await async_client.brand.retrieve( - domain="domain", + domain="xxx", type="by_domain", force_language="afrikaans", max_age_ms=0, max_speed=True, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -399,7 +408,7 @@ async def test_method_retrieve_with_all_params_overload_1(self, async_client: As @parametrize async def test_raw_response_retrieve_overload_1(self, async_client: AsyncContextDev) -> None: response = await async_client.brand.with_raw_response.retrieve( - domain="domain", + domain="xxx", type="by_domain", ) @@ -412,7 +421,7 @@ async def test_raw_response_retrieve_overload_1(self, async_client: AsyncContext @parametrize async def test_streaming_response_retrieve_overload_1(self, async_client: AsyncContextDev) -> None: async with async_client.brand.with_streaming_response.retrieve( - domain="domain", + domain="xxx", type="by_domain", ) as response: assert not response.is_closed @@ -442,6 +451,7 @@ async def test_method_retrieve_with_all_params_overload_2(self, async_client: As force_language="afrikaans", max_age_ms=0, max_speed=True, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -492,6 +502,7 @@ async def test_method_retrieve_with_all_params_overload_3(self, async_client: As force_language="afrikaans", max_age_ms=0, max_speed=True, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -542,6 +553,7 @@ async def test_method_retrieve_with_all_params_overload_4(self, async_client: As force_language="afrikaans", max_age_ms=0, max_speed=True, + tags=["production", "team-alpha"], ticker_exchange="ticker_exchange", timeout_ms=1000, ) @@ -590,6 +602,7 @@ async def test_method_retrieve_with_all_params_overload_5(self, async_client: As brand = await async_client.brand.retrieve( direct_url="https://example.com", type="by_direct_url", + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -642,8 +655,9 @@ async def test_method_retrieve_with_all_params_overload_6(self, async_client: As force_language="afrikaans", high_confidence_only=True, max_speed=True, - mcc=0, - phone=0, + mcc="string", + phone="string", + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(BrandRetrieveResponse, brand, path=["response"]) @@ -680,7 +694,7 @@ async def test_streaming_response_retrieve_overload_6(self, async_client: AsyncC @parametrize async def test_method_retrieve_simplified(self, async_client: AsyncContextDev) -> None: brand = await async_client.brand.retrieve_simplified( - domain="domain", + domain="xxx", ) assert_matches_type(BrandRetrieveSimplifiedResponse, brand, path=["response"]) @@ -688,8 +702,10 @@ async def test_method_retrieve_simplified(self, async_client: AsyncContextDev) - @parametrize async def test_method_retrieve_simplified_with_all_params(self, async_client: AsyncContextDev) -> None: brand = await async_client.brand.retrieve_simplified( - domain="domain", - max_age_ms=86400000, + domain="xxx", + max_age_ms=0, + tags=["production", "team-alpha"], + theme="light", timeout_ms=1000, ) assert_matches_type(BrandRetrieveSimplifiedResponse, brand, path=["response"]) @@ -698,7 +714,7 @@ async def test_method_retrieve_simplified_with_all_params(self, async_client: As @parametrize async def test_raw_response_retrieve_simplified(self, async_client: AsyncContextDev) -> None: response = await async_client.brand.with_raw_response.retrieve_simplified( - domain="domain", + domain="xxx", ) assert response.is_closed is True @@ -710,7 +726,7 @@ async def test_raw_response_retrieve_simplified(self, async_client: AsyncContext @parametrize async def test_streaming_response_retrieve_simplified(self, async_client: AsyncContextDev) -> None: async with async_client.brand.with_streaming_response.retrieve_simplified( - domain="domain", + domain="xxx", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_industry.py b/tests/api_resources/test_industry.py index 047d428..0280c02 100644 --- a/tests/api_resources/test_industry.py +++ b/tests/api_resources/test_industry.py @@ -24,7 +24,7 @@ class TestIndustry: @parametrize def test_method_retrieve_naics(self, client: ContextDev) -> None: industry = client.industry.retrieve_naics( - input="input", + input="xxxx", ) assert_matches_type(IndustryRetrieveNaicsResponse, industry, path=["response"]) @@ -32,9 +32,10 @@ def test_method_retrieve_naics(self, client: ContextDev) -> None: @parametrize def test_method_retrieve_naics_with_all_params(self, client: ContextDev) -> None: industry = client.industry.retrieve_naics( - input="input", + input="xxxx", max_results=1, min_results=1, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(IndustryRetrieveNaicsResponse, industry, path=["response"]) @@ -43,7 +44,7 @@ def test_method_retrieve_naics_with_all_params(self, client: ContextDev) -> None @parametrize def test_raw_response_retrieve_naics(self, client: ContextDev) -> None: response = client.industry.with_raw_response.retrieve_naics( - input="input", + input="xxxx", ) assert response.is_closed is True @@ -55,7 +56,7 @@ def test_raw_response_retrieve_naics(self, client: ContextDev) -> None: @parametrize def test_streaming_response_retrieve_naics(self, client: ContextDev) -> None: with client.industry.with_streaming_response.retrieve_naics( - input="input", + input="xxxx", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -69,7 +70,7 @@ def test_streaming_response_retrieve_naics(self, client: ContextDev) -> None: @parametrize def test_method_retrieve_sic(self, client: ContextDev) -> None: industry = client.industry.retrieve_sic( - input="input", + input="xxxx", ) assert_matches_type(IndustryRetrieveSicResponse, industry, path=["response"]) @@ -77,9 +78,10 @@ def test_method_retrieve_sic(self, client: ContextDev) -> None: @parametrize def test_method_retrieve_sic_with_all_params(self, client: ContextDev) -> None: industry = client.industry.retrieve_sic( - input="input", + input="xxxx", max_results=1, min_results=1, + tags=["production", "team-alpha"], timeout_ms=1000, type="original_sic", ) @@ -89,7 +91,7 @@ def test_method_retrieve_sic_with_all_params(self, client: ContextDev) -> None: @parametrize def test_raw_response_retrieve_sic(self, client: ContextDev) -> None: response = client.industry.with_raw_response.retrieve_sic( - input="input", + input="xxxx", ) assert response.is_closed is True @@ -101,7 +103,7 @@ def test_raw_response_retrieve_sic(self, client: ContextDev) -> None: @parametrize def test_streaming_response_retrieve_sic(self, client: ContextDev) -> None: with client.industry.with_streaming_response.retrieve_sic( - input="input", + input="xxxx", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -121,7 +123,7 @@ class TestAsyncIndustry: @parametrize async def test_method_retrieve_naics(self, async_client: AsyncContextDev) -> None: industry = await async_client.industry.retrieve_naics( - input="input", + input="xxxx", ) assert_matches_type(IndustryRetrieveNaicsResponse, industry, path=["response"]) @@ -129,9 +131,10 @@ async def test_method_retrieve_naics(self, async_client: AsyncContextDev) -> Non @parametrize async def test_method_retrieve_naics_with_all_params(self, async_client: AsyncContextDev) -> None: industry = await async_client.industry.retrieve_naics( - input="input", + input="xxxx", max_results=1, min_results=1, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(IndustryRetrieveNaicsResponse, industry, path=["response"]) @@ -140,7 +143,7 @@ async def test_method_retrieve_naics_with_all_params(self, async_client: AsyncCo @parametrize async def test_raw_response_retrieve_naics(self, async_client: AsyncContextDev) -> None: response = await async_client.industry.with_raw_response.retrieve_naics( - input="input", + input="xxxx", ) assert response.is_closed is True @@ -152,7 +155,7 @@ async def test_raw_response_retrieve_naics(self, async_client: AsyncContextDev) @parametrize async def test_streaming_response_retrieve_naics(self, async_client: AsyncContextDev) -> None: async with async_client.industry.with_streaming_response.retrieve_naics( - input="input", + input="xxxx", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -166,7 +169,7 @@ async def test_streaming_response_retrieve_naics(self, async_client: AsyncContex @parametrize async def test_method_retrieve_sic(self, async_client: AsyncContextDev) -> None: industry = await async_client.industry.retrieve_sic( - input="input", + input="xxxx", ) assert_matches_type(IndustryRetrieveSicResponse, industry, path=["response"]) @@ -174,9 +177,10 @@ async def test_method_retrieve_sic(self, async_client: AsyncContextDev) -> None: @parametrize async def test_method_retrieve_sic_with_all_params(self, async_client: AsyncContextDev) -> None: industry = await async_client.industry.retrieve_sic( - input="input", + input="xxxx", max_results=1, min_results=1, + tags=["production", "team-alpha"], timeout_ms=1000, type="original_sic", ) @@ -186,7 +190,7 @@ async def test_method_retrieve_sic_with_all_params(self, async_client: AsyncCont @parametrize async def test_raw_response_retrieve_sic(self, async_client: AsyncContextDev) -> None: response = await async_client.industry.with_raw_response.retrieve_sic( - input="input", + input="xxxx", ) assert response.is_closed is True @@ -198,7 +202,7 @@ async def test_raw_response_retrieve_sic(self, async_client: AsyncContextDev) -> @parametrize async def test_streaming_response_retrieve_sic(self, async_client: AsyncContextDev) -> None: async with async_client.industry.with_streaming_response.retrieve_sic( - input="input", + input="xxxx", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_monitors.py b/tests/api_resources/test_monitors.py index 03a2b09..14ee10b 100644 --- a/tests/api_resources/test_monitors.py +++ b/tests/api_resources/test_monitors.py @@ -17,7 +17,9 @@ MonitorUpdateResponse, MonitorListRunsResponse, MonitorRetrieveResponse, + MonitorGetLimitsResponse, MonitorListChangesResponse, + MonitorGetCreditUsageResponse, MonitorRetrieveChangeResponse, MonitorListAccountRunsResponse, MonitorListAccountChangesResponse, @@ -242,12 +244,12 @@ def test_method_list_with_all_params(self, client: ContextDev) -> None: change_detection_type="exact", cursor="cursor", limit=1, - q="q", + q="pricing", search_by=["name"], search_type="exact", status="active", - tag="tag", - tags=["string"], + tag="pricing", + tags=["x"], target_type="page", ) assert_matches_type(MonitorListResponse, monitor, path=["response"]) @@ -316,6 +318,71 @@ def test_path_params_delete(self, client: ContextDev) -> None: "", ) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_get_credit_usage(self, client: ContextDev) -> None: + monitor = client.monitors.get_credit_usage() + assert_matches_type(MonitorGetCreditUsageResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_get_credit_usage_with_all_params(self, client: ContextDev) -> None: + monitor = client.monitors.get_credit_usage( + since=parse_datetime("2026-06-01T00:00:00Z"), + until=parse_datetime("2026-06-28T00:00:00Z"), + ) + assert_matches_type(MonitorGetCreditUsageResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_get_credit_usage(self, client: ContextDev) -> None: + response = client.monitors.with_raw_response.get_credit_usage() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + monitor = response.parse() + assert_matches_type(MonitorGetCreditUsageResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_get_credit_usage(self, client: ContextDev) -> None: + with client.monitors.with_streaming_response.get_credit_usage() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + monitor = response.parse() + assert_matches_type(MonitorGetCreditUsageResponse, monitor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_get_limits(self, client: ContextDev) -> None: + monitor = client.monitors.get_limits() + assert_matches_type(MonitorGetLimitsResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_get_limits(self, client: ContextDev) -> None: + response = client.monitors.with_raw_response.get_limits() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + monitor = response.parse() + assert_matches_type(MonitorGetLimitsResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_get_limits(self, client: ContextDev) -> None: + with client.monitors.with_streaming_response.get_limits() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + monitor = response.parse() + assert_matches_type(MonitorGetLimitsResponse, monitor, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_account_changes(self, client: ContextDev) -> None: @@ -329,11 +396,11 @@ def test_method_list_account_changes_with_all_params(self, client: ContextDev) - change_detection_type="exact", cursor="cursor", limit=1, - monitor_id="monitor_id", - since=parse_datetime("2019-12-27T18:11:19.117Z"), - tag="tag", + monitor_id="mon_123", + since=parse_datetime("2026-06-01T00:00:00Z"), + tag="pricing", target_type="page", - until=parse_datetime("2019-12-27T18:11:19.117Z"), + until=parse_datetime("2026-06-28T00:00:00Z"), ) assert_matches_type(MonitorListAccountChangesResponse, monitor, path=["response"]) @@ -412,9 +479,9 @@ def test_method_list_changes_with_all_params(self, client: ContextDev) -> None: monitor_id="mon_123", cursor="cursor", limit=1, - since=parse_datetime("2019-12-27T18:11:19.117Z"), - tag="tag", - until=parse_datetime("2019-12-27T18:11:19.117Z"), + since=parse_datetime("2026-06-01T00:00:00Z"), + tag="pricing", + until=parse_datetime("2026-06-28T00:00:00Z"), ) assert_matches_type(MonitorListChangesResponse, monitor, path=["response"]) @@ -807,12 +874,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncContextDev) change_detection_type="exact", cursor="cursor", limit=1, - q="q", + q="pricing", search_by=["name"], search_type="exact", status="active", - tag="tag", - tags=["string"], + tag="pricing", + tags=["x"], target_type="page", ) assert_matches_type(MonitorListResponse, monitor, path=["response"]) @@ -881,6 +948,71 @@ async def test_path_params_delete(self, async_client: AsyncContextDev) -> None: "", ) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_get_credit_usage(self, async_client: AsyncContextDev) -> None: + monitor = await async_client.monitors.get_credit_usage() + assert_matches_type(MonitorGetCreditUsageResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_get_credit_usage_with_all_params(self, async_client: AsyncContextDev) -> None: + monitor = await async_client.monitors.get_credit_usage( + since=parse_datetime("2026-06-01T00:00:00Z"), + until=parse_datetime("2026-06-28T00:00:00Z"), + ) + assert_matches_type(MonitorGetCreditUsageResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_get_credit_usage(self, async_client: AsyncContextDev) -> None: + response = await async_client.monitors.with_raw_response.get_credit_usage() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + monitor = await response.parse() + assert_matches_type(MonitorGetCreditUsageResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_get_credit_usage(self, async_client: AsyncContextDev) -> None: + async with async_client.monitors.with_streaming_response.get_credit_usage() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + monitor = await response.parse() + assert_matches_type(MonitorGetCreditUsageResponse, monitor, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_get_limits(self, async_client: AsyncContextDev) -> None: + monitor = await async_client.monitors.get_limits() + assert_matches_type(MonitorGetLimitsResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_get_limits(self, async_client: AsyncContextDev) -> None: + response = await async_client.monitors.with_raw_response.get_limits() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + monitor = await response.parse() + assert_matches_type(MonitorGetLimitsResponse, monitor, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_get_limits(self, async_client: AsyncContextDev) -> None: + async with async_client.monitors.with_streaming_response.get_limits() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + monitor = await response.parse() + assert_matches_type(MonitorGetLimitsResponse, monitor, path=["response"]) + + assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_account_changes(self, async_client: AsyncContextDev) -> None: @@ -894,11 +1026,11 @@ async def test_method_list_account_changes_with_all_params(self, async_client: A change_detection_type="exact", cursor="cursor", limit=1, - monitor_id="monitor_id", - since=parse_datetime("2019-12-27T18:11:19.117Z"), - tag="tag", + monitor_id="mon_123", + since=parse_datetime("2026-06-01T00:00:00Z"), + tag="pricing", target_type="page", - until=parse_datetime("2019-12-27T18:11:19.117Z"), + until=parse_datetime("2026-06-28T00:00:00Z"), ) assert_matches_type(MonitorListAccountChangesResponse, monitor, path=["response"]) @@ -977,9 +1109,9 @@ async def test_method_list_changes_with_all_params(self, async_client: AsyncCont monitor_id="mon_123", cursor="cursor", limit=1, - since=parse_datetime("2019-12-27T18:11:19.117Z"), - tag="tag", - until=parse_datetime("2019-12-27T18:11:19.117Z"), + since=parse_datetime("2026-06-01T00:00:00Z"), + tag="pricing", + until=parse_datetime("2026-06-28T00:00:00Z"), ) assert_matches_type(MonitorListChangesResponse, monitor, path=["response"]) diff --git a/tests/api_resources/test_parse.py b/tests/api_resources/test_parse.py index 4e4654f..d42c128 100644 --- a/tests/api_resources/test_parse.py +++ b/tests/api_resources/test_parse.py @@ -30,16 +30,19 @@ def test_method_handle(self, client: ContextDev) -> None: def test_method_handle_with_all_params(self, client: ContextDev) -> None: parse = client.parse.handle( body=b"Example data", + client="x", extension="txt", - include_images=True, - include_links=True, - ocr=True, + include_images="true", + include_links="true", + ocr="true", pdf={ "end": 1, "start": 1, }, - shorten_base64_images=True, - use_main_content_only=True, + shorten_base64_images="true", + tags=["production", "team-alpha"], + use_main_content_only="true", + zdr="enabled", ) assert_matches_type(ParseHandleResponse, parse, path=["response"]) @@ -88,16 +91,19 @@ async def test_method_handle(self, async_client: AsyncContextDev) -> None: async def test_method_handle_with_all_params(self, async_client: AsyncContextDev) -> None: parse = await async_client.parse.handle( body=b"Example data", + client="x", extension="txt", - include_images=True, - include_links=True, - ocr=True, + include_images="true", + include_links="true", + ocr="true", pdf={ "end": 1, "start": 1, }, - shorten_base64_images=True, - use_main_content_only=True, + shorten_base64_images="true", + tags=["production", "team-alpha"], + use_main_content_only="true", + zdr="enabled", ) assert_matches_type(ParseHandleResponse, parse, path=["response"]) diff --git a/tests/api_resources/test_utility.py b/tests/api_resources/test_utility.py index a4b6cdf..45a3ec3 100644 --- a/tests/api_resources/test_utility.py +++ b/tests/api_resources/test_utility.py @@ -21,7 +21,7 @@ class TestUtility: @parametrize def test_method_prefetch(self, client: ContextDev) -> None: utility = client.utility.prefetch( - identifier={"domain": "domain"}, + identifier={"domain": "xxx"}, type="brand", ) assert_matches_type(UtilityPrefetchResponse, utility, path=["response"]) @@ -30,8 +30,9 @@ def test_method_prefetch(self, client: ContextDev) -> None: @parametrize def test_method_prefetch_with_all_params(self, client: ContextDev) -> None: utility = client.utility.prefetch( - identifier={"domain": "domain"}, + identifier={"domain": "xxx"}, type="brand", + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(UtilityPrefetchResponse, utility, path=["response"]) @@ -40,7 +41,7 @@ def test_method_prefetch_with_all_params(self, client: ContextDev) -> None: @parametrize def test_raw_response_prefetch(self, client: ContextDev) -> None: response = client.utility.with_raw_response.prefetch( - identifier={"domain": "domain"}, + identifier={"domain": "xxx"}, type="brand", ) @@ -53,7 +54,7 @@ def test_raw_response_prefetch(self, client: ContextDev) -> None: @parametrize def test_streaming_response_prefetch(self, client: ContextDev) -> None: with client.utility.with_streaming_response.prefetch( - identifier={"domain": "domain"}, + identifier={"domain": "xxx"}, type="brand", ) as response: assert not response.is_closed @@ -74,7 +75,7 @@ class TestAsyncUtility: @parametrize async def test_method_prefetch(self, async_client: AsyncContextDev) -> None: utility = await async_client.utility.prefetch( - identifier={"domain": "domain"}, + identifier={"domain": "xxx"}, type="brand", ) assert_matches_type(UtilityPrefetchResponse, utility, path=["response"]) @@ -83,8 +84,9 @@ async def test_method_prefetch(self, async_client: AsyncContextDev) -> None: @parametrize async def test_method_prefetch_with_all_params(self, async_client: AsyncContextDev) -> None: utility = await async_client.utility.prefetch( - identifier={"domain": "domain"}, + identifier={"domain": "xxx"}, type="brand", + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(UtilityPrefetchResponse, utility, path=["response"]) @@ -93,7 +95,7 @@ async def test_method_prefetch_with_all_params(self, async_client: AsyncContextD @parametrize async def test_raw_response_prefetch(self, async_client: AsyncContextDev) -> None: response = await async_client.utility.with_raw_response.prefetch( - identifier={"domain": "domain"}, + identifier={"domain": "xxx"}, type="brand", ) @@ -106,7 +108,7 @@ async def test_raw_response_prefetch(self, async_client: AsyncContextDev) -> Non @parametrize async def test_streaming_response_prefetch(self, async_client: AsyncContextDev) -> None: async with async_client.utility.with_streaming_response.prefetch( - identifier={"domain": "domain"}, + identifier={"domain": "xxx"}, type="brand", ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_web.py b/tests/api_resources/test_web.py index 20ec0c1..95c09b9 100644 --- a/tests/api_resources/test_web.py +++ b/tests/api_resources/test_web.py @@ -66,7 +66,9 @@ def test_method_extract_with_all_params(self, client: ContextDev) -> None: "should_parse": True, "start": 1, }, + settle_animations=True, stop_after_ms=10000, + tags=["production", "team-alpha"], timeout_ms=1000, wait_for_ms=0, ) @@ -124,6 +126,7 @@ def test_method_extract_competitors_with_all_params(self, client: ContextDev) -> web = client.web.extract_competitors( domain="xxx", num_competitors=1, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(WebExtractCompetitorsResponse, web, path=["response"]) @@ -165,8 +168,9 @@ def test_method_extract_fonts(self, client: ContextDev) -> None: def test_method_extract_fonts_with_all_params(self, client: ContextDev) -> None: web = client.web.extract_fonts( direct_url="https://example.com", - domain="domain", - max_age_ms=86400000, + domain="xxx", + max_age_ms=0, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(WebExtractFontsResponse, web, path=["response"]) @@ -205,8 +209,9 @@ def test_method_extract_styleguide_with_all_params(self, client: ContextDev) -> web = client.web.extract_styleguide( color_scheme="light", direct_url="https://example.com", - domain="domain", - max_age_ms=86400000, + domain="xxx", + max_age_ms=0, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(WebExtractStyleguideResponse, web, path=["response"]) @@ -246,18 +251,20 @@ def test_method_screenshot_with_all_params(self, client: ContextDev) -> None: color_scheme="light", country="de", direct_url="https://example.com", - domain="domain", + domain="xxx", full_screenshot="true", handle_cookie_popup="true", max_age_ms=0, page="login", scroll_offset=0, - timeout_ms=1000, + tags=["production", "team-alpha"], + timeout_ms=1, viewport={ "height": 240, "width": 240, }, wait_for_ms=0, + zdr="enabled", ) assert_matches_type(WebScreenshotResponse, web, path=["response"]) @@ -318,6 +325,7 @@ def test_method_search_with_all_params(self, client: ContextDev) -> None: }, num_results=10, query_fanout=True, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(WebSearchResponse, web, path=["response"]) @@ -380,10 +388,12 @@ def test_method_web_crawl_md_with_all_params(self, client: ContextDev) -> None: settle_animations=True, shorten_base64_images=True, stop_after_ms=10000, + tags=["production", "team-alpha"], timeout_ms=1000, url_regex="^https?://[^/]+/blog/", use_main_content_only=True, wait_for_ms=0, + zdr="enabled", ) assert_matches_type(WebWebCrawlMdResponse, web, path=["response"]) @@ -426,22 +436,30 @@ def test_method_web_scrape_html(self, client: ContextDev) -> None: def test_method_web_scrape_html_with_all_params(self, client: ContextDev) -> None: web = client.web.web_scrape_html( url="https://example.com", + actions=[ + { + "do": "wait", + "time_ms": 0, + } + ], country="de", - exclude_selectors=["string"], + exclude_selectors=["x"], headers={"foo": "J!"}, - include_frames=True, - include_selectors=["string"], + include_frames="true", + include_selectors=["x"], max_age_ms=0, pdf={ "end": 1, - "ocr": True, - "should_parse": True, + "ocr": "true", + "should_parse": "true", "start": 1, }, - settle_animations=True, - timeout_ms=1000, - use_main_content_only=True, + settle_animations="true", + tags=["production", "team-alpha"], + timeout_ms=1, + use_main_content_only="true", wait_for_ms=0, + zdr="enabled", ) assert_matches_type(WebWebScrapeHTMLResponse, web, path=["response"]) @@ -484,16 +502,23 @@ def test_method_web_scrape_images(self, client: ContextDev) -> None: def test_method_web_scrape_images_with_all_params(self, client: ContextDev) -> None: web = client.web.web_scrape_images( url="https://example.com", - dedupe=True, + actions=[ + { + "do": "wait", + "time_ms": 0, + } + ], + dedupe="true", enrichment={ - "classification": True, - "hosted_url": True, + "classification": "true", + "hosted_url": "true", "max_time_per_ms": 1, - "resolution": True, + "resolution": "true", }, headers={"foo": "J!"}, max_age_ms=0, - timeout_ms=1000, + tags=["production", "team-alpha"], + timeout_ms=1, wait_for_ms=0, ) assert_matches_type(WebWebScrapeImagesResponse, web, path=["response"]) @@ -537,25 +562,33 @@ def test_method_web_scrape_md(self, client: ContextDev) -> None: def test_method_web_scrape_md_with_all_params(self, client: ContextDev) -> None: web = client.web.web_scrape_md( url="https://example.com", + actions=[ + { + "do": "wait", + "time_ms": 0, + } + ], country="de", - exclude_selectors=["string"], + exclude_selectors=["x"], headers={"foo": "J!"}, - include_frames=True, - include_images=True, - include_links=True, - include_selectors=["string"], + include_frames="true", + include_images="true", + include_links="true", + include_selectors=["x"], max_age_ms=0, pdf={ "end": 1, - "ocr": True, - "should_parse": True, + "ocr": "true", + "should_parse": "true", "start": 1, }, - settle_animations=True, - shorten_base64_images=True, - timeout_ms=1000, - use_main_content_only=True, + settle_animations="true", + shorten_base64_images="true", + tags=["production", "team-alpha"], + timeout_ms=1, + use_main_content_only="true", wait_for_ms=0, + zdr="enabled", ) assert_matches_type(WebWebScrapeMdResponse, web, path=["response"]) @@ -589,7 +622,7 @@ def test_streaming_response_web_scrape_md(self, client: ContextDev) -> None: @parametrize def test_method_web_scrape_sitemap(self, client: ContextDev) -> None: web = client.web.web_scrape_sitemap( - domain="domain", + domain="xxx", ) assert_matches_type(WebWebScrapeSitemapResponse, web, path=["response"]) @@ -597,11 +630,14 @@ def test_method_web_scrape_sitemap(self, client: ContextDev) -> None: @parametrize def test_method_web_scrape_sitemap_with_all_params(self, client: ContextDev) -> None: web = client.web.web_scrape_sitemap( - domain="domain", + domain="xxx", headers={"foo": "J!"}, max_links=1, - timeout_ms=1000, + sitemap_url="https://example.com", + tags=["production", "team-alpha"], + timeout_ms=1, url_regex="^https?://[^/]+/blog/", + zdr="enabled", ) assert_matches_type(WebWebScrapeSitemapResponse, web, path=["response"]) @@ -609,7 +645,7 @@ def test_method_web_scrape_sitemap_with_all_params(self, client: ContextDev) -> @parametrize def test_raw_response_web_scrape_sitemap(self, client: ContextDev) -> None: response = client.web.with_raw_response.web_scrape_sitemap( - domain="domain", + domain="xxx", ) assert response.is_closed is True @@ -621,7 +657,7 @@ def test_raw_response_web_scrape_sitemap(self, client: ContextDev) -> None: @parametrize def test_streaming_response_web_scrape_sitemap(self, client: ContextDev) -> None: with client.web.with_streaming_response.web_scrape_sitemap( - domain="domain", + domain="xxx", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -674,7 +710,9 @@ async def test_method_extract_with_all_params(self, async_client: AsyncContextDe "should_parse": True, "start": 1, }, + settle_animations=True, stop_after_ms=10000, + tags=["production", "team-alpha"], timeout_ms=1000, wait_for_ms=0, ) @@ -732,6 +770,7 @@ async def test_method_extract_competitors_with_all_params(self, async_client: As web = await async_client.web.extract_competitors( domain="xxx", num_competitors=1, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(WebExtractCompetitorsResponse, web, path=["response"]) @@ -773,8 +812,9 @@ async def test_method_extract_fonts(self, async_client: AsyncContextDev) -> None async def test_method_extract_fonts_with_all_params(self, async_client: AsyncContextDev) -> None: web = await async_client.web.extract_fonts( direct_url="https://example.com", - domain="domain", - max_age_ms=86400000, + domain="xxx", + max_age_ms=0, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(WebExtractFontsResponse, web, path=["response"]) @@ -813,8 +853,9 @@ async def test_method_extract_styleguide_with_all_params(self, async_client: Asy web = await async_client.web.extract_styleguide( color_scheme="light", direct_url="https://example.com", - domain="domain", - max_age_ms=86400000, + domain="xxx", + max_age_ms=0, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(WebExtractStyleguideResponse, web, path=["response"]) @@ -854,18 +895,20 @@ async def test_method_screenshot_with_all_params(self, async_client: AsyncContex color_scheme="light", country="de", direct_url="https://example.com", - domain="domain", + domain="xxx", full_screenshot="true", handle_cookie_popup="true", max_age_ms=0, page="login", scroll_offset=0, - timeout_ms=1000, + tags=["production", "team-alpha"], + timeout_ms=1, viewport={ "height": 240, "width": 240, }, wait_for_ms=0, + zdr="enabled", ) assert_matches_type(WebScreenshotResponse, web, path=["response"]) @@ -926,6 +969,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncContextDev }, num_results=10, query_fanout=True, + tags=["production", "team-alpha"], timeout_ms=1000, ) assert_matches_type(WebSearchResponse, web, path=["response"]) @@ -988,10 +1032,12 @@ async def test_method_web_crawl_md_with_all_params(self, async_client: AsyncCont settle_animations=True, shorten_base64_images=True, stop_after_ms=10000, + tags=["production", "team-alpha"], timeout_ms=1000, url_regex="^https?://[^/]+/blog/", use_main_content_only=True, wait_for_ms=0, + zdr="enabled", ) assert_matches_type(WebWebCrawlMdResponse, web, path=["response"]) @@ -1034,22 +1080,30 @@ async def test_method_web_scrape_html(self, async_client: AsyncContextDev) -> No async def test_method_web_scrape_html_with_all_params(self, async_client: AsyncContextDev) -> None: web = await async_client.web.web_scrape_html( url="https://example.com", + actions=[ + { + "do": "wait", + "time_ms": 0, + } + ], country="de", - exclude_selectors=["string"], + exclude_selectors=["x"], headers={"foo": "J!"}, - include_frames=True, - include_selectors=["string"], + include_frames="true", + include_selectors=["x"], max_age_ms=0, pdf={ "end": 1, - "ocr": True, - "should_parse": True, + "ocr": "true", + "should_parse": "true", "start": 1, }, - settle_animations=True, - timeout_ms=1000, - use_main_content_only=True, + settle_animations="true", + tags=["production", "team-alpha"], + timeout_ms=1, + use_main_content_only="true", wait_for_ms=0, + zdr="enabled", ) assert_matches_type(WebWebScrapeHTMLResponse, web, path=["response"]) @@ -1092,16 +1146,23 @@ async def test_method_web_scrape_images(self, async_client: AsyncContextDev) -> async def test_method_web_scrape_images_with_all_params(self, async_client: AsyncContextDev) -> None: web = await async_client.web.web_scrape_images( url="https://example.com", - dedupe=True, + actions=[ + { + "do": "wait", + "time_ms": 0, + } + ], + dedupe="true", enrichment={ - "classification": True, - "hosted_url": True, + "classification": "true", + "hosted_url": "true", "max_time_per_ms": 1, - "resolution": True, + "resolution": "true", }, headers={"foo": "J!"}, max_age_ms=0, - timeout_ms=1000, + tags=["production", "team-alpha"], + timeout_ms=1, wait_for_ms=0, ) assert_matches_type(WebWebScrapeImagesResponse, web, path=["response"]) @@ -1145,25 +1206,33 @@ async def test_method_web_scrape_md(self, async_client: AsyncContextDev) -> None async def test_method_web_scrape_md_with_all_params(self, async_client: AsyncContextDev) -> None: web = await async_client.web.web_scrape_md( url="https://example.com", + actions=[ + { + "do": "wait", + "time_ms": 0, + } + ], country="de", - exclude_selectors=["string"], + exclude_selectors=["x"], headers={"foo": "J!"}, - include_frames=True, - include_images=True, - include_links=True, - include_selectors=["string"], + include_frames="true", + include_images="true", + include_links="true", + include_selectors=["x"], max_age_ms=0, pdf={ "end": 1, - "ocr": True, - "should_parse": True, + "ocr": "true", + "should_parse": "true", "start": 1, }, - settle_animations=True, - shorten_base64_images=True, - timeout_ms=1000, - use_main_content_only=True, + settle_animations="true", + shorten_base64_images="true", + tags=["production", "team-alpha"], + timeout_ms=1, + use_main_content_only="true", wait_for_ms=0, + zdr="enabled", ) assert_matches_type(WebWebScrapeMdResponse, web, path=["response"]) @@ -1197,7 +1266,7 @@ async def test_streaming_response_web_scrape_md(self, async_client: AsyncContext @parametrize async def test_method_web_scrape_sitemap(self, async_client: AsyncContextDev) -> None: web = await async_client.web.web_scrape_sitemap( - domain="domain", + domain="xxx", ) assert_matches_type(WebWebScrapeSitemapResponse, web, path=["response"]) @@ -1205,11 +1274,14 @@ async def test_method_web_scrape_sitemap(self, async_client: AsyncContextDev) -> @parametrize async def test_method_web_scrape_sitemap_with_all_params(self, async_client: AsyncContextDev) -> None: web = await async_client.web.web_scrape_sitemap( - domain="domain", + domain="xxx", headers={"foo": "J!"}, max_links=1, - timeout_ms=1000, + sitemap_url="https://example.com", + tags=["production", "team-alpha"], + timeout_ms=1, url_regex="^https?://[^/]+/blog/", + zdr="enabled", ) assert_matches_type(WebWebScrapeSitemapResponse, web, path=["response"]) @@ -1217,7 +1289,7 @@ async def test_method_web_scrape_sitemap_with_all_params(self, async_client: Asy @parametrize async def test_raw_response_web_scrape_sitemap(self, async_client: AsyncContextDev) -> None: response = await async_client.web.with_raw_response.web_scrape_sitemap( - domain="domain", + domain="xxx", ) assert response.is_closed is True @@ -1229,7 +1301,7 @@ async def test_raw_response_web_scrape_sitemap(self, async_client: AsyncContextD @parametrize async def test_streaming_response_web_scrape_sitemap(self, async_client: AsyncContextDev) -> None: async with async_client.web.with_streaming_response.web_scrape_sitemap( - domain="domain", + domain="xxx", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/test_client.py b/tests/test_client.py index 95769ce..3dd0a13 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -886,7 +886,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien respx_mock.post("/brand/retrieve").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - client.brand.with_streaming_response.retrieve(domain="domain", type="by_domain").__enter__() + client.brand.with_streaming_response.retrieve(domain="xxx", type="by_domain").__enter__() assert _get_open_connections(client) == 0 @@ -896,7 +896,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client respx_mock.post("/brand/retrieve").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - client.brand.with_streaming_response.retrieve(domain="domain", type="by_domain").__enter__() + client.brand.with_streaming_response.retrieve(domain="xxx", type="by_domain").__enter__() assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -925,7 +925,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/brand/retrieve").mock(side_effect=retry_handler) - response = client.brand.with_raw_response.retrieve(domain="domain", type="by_domain") + response = client.brand.with_raw_response.retrieve(domain="xxx", type="by_domain") assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -950,7 +950,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/brand/retrieve").mock(side_effect=retry_handler) response = client.brand.with_raw_response.retrieve( - domain="domain", type="by_domain", extra_headers={"x-stainless-retry-count": Omit()} + domain="xxx", type="by_domain", extra_headers={"x-stainless-retry-count": Omit()} ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -975,7 +975,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/brand/retrieve").mock(side_effect=retry_handler) response = client.brand.with_raw_response.retrieve( - domain="domain", type="by_domain", extra_headers={"x-stainless-retry-count": "42"} + domain="xxx", type="by_domain", extra_headers={"x-stainless-retry-count": "42"} ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" @@ -1824,7 +1824,7 @@ async def test_retrying_timeout_errors_doesnt_leak( respx_mock.post("/brand/retrieve").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - await async_client.brand.with_streaming_response.retrieve(domain="domain", type="by_domain").__aenter__() + await async_client.brand.with_streaming_response.retrieve(domain="xxx", type="by_domain").__aenter__() assert _get_open_connections(async_client) == 0 @@ -1836,7 +1836,7 @@ async def test_retrying_status_errors_doesnt_leak( respx_mock.post("/brand/retrieve").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - await async_client.brand.with_streaming_response.retrieve(domain="domain", type="by_domain").__aenter__() + await async_client.brand.with_streaming_response.retrieve(domain="xxx", type="by_domain").__aenter__() assert _get_open_connections(async_client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -1865,7 +1865,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/brand/retrieve").mock(side_effect=retry_handler) - response = await client.brand.with_raw_response.retrieve(domain="domain", type="by_domain") + response = await client.brand.with_raw_response.retrieve(domain="xxx", type="by_domain") assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -1890,7 +1890,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/brand/retrieve").mock(side_effect=retry_handler) response = await client.brand.with_raw_response.retrieve( - domain="domain", type="by_domain", extra_headers={"x-stainless-retry-count": Omit()} + domain="xxx", type="by_domain", extra_headers={"x-stainless-retry-count": Omit()} ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -1915,7 +1915,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/brand/retrieve").mock(side_effect=retry_handler) response = await client.brand.with_raw_response.retrieve( - domain="domain", type="by_domain", extra_headers={"x-stainless-retry-count": "42"} + domain="xxx", type="by_domain", extra_headers={"x-stainless-retry-count": "42"} ) assert response.http_request.headers.get("x-stainless-retry-count") == "42"