From 713964bbe1868905959b6758a3da528ded51316e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 21:47:02 +0000 Subject: [PATCH 1/3] feat(api): api update --- .stats.yml | 4 ++-- src/context/dev/resources/web.py | 18 ++++++++++++++++++ src/context/dev/types/web_extract_params.py | 9 +++++++++ tests/api_resources/test_web.py | 4 ++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 793d9bf..a7bb92d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 25 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-5a8e1f6e16ecdbab4b2ff14701779818fe0328b06a1c7fa44a32da4f4bc87a49.yml -openapi_spec_hash: 4b5407859d1154232189ef440b783b17 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7002d4e40fb0a8dc4454b7f72f86d6068245cb367ddf7c784f00e35f6f75de1f.yml +openapi_spec_hash: da6f7b8ab297306b97ed9fe8df9ad1a0 config_hash: f86a4e06ae5ed725aa79d58d7a8dc27c diff --git a/src/context/dev/resources/web.py b/src/context/dev/resources/web.py index 92790f0..b615f3b 100644 --- a/src/context/dev/resources/web.py +++ b/src/context/dev/resources/web.py @@ -76,6 +76,8 @@ def extract( include_frames: bool | Omit = omit, instructions: str | Omit = omit, max_age_ms: int | Omit = omit, + max_depth: int | Omit = omit, + max_pages: int | Omit = omit, pdf: web_extract_params.Pdf | Omit = omit, stop_after_ms: int | Omit = omit, timeout_ms: int | Omit = omit, @@ -116,6 +118,11 @@ def extract( max_age_ms: Return cached scrape results if a prior scrape for the same parameters is younger than this many milliseconds. Defaults to 7 days (604800000 ms). + max_depth: Optional maximum link depth from the starting URL (0 = only the starting page). + If omitted, there is no crawl depth limit. + + max_pages: Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5. + stop_after_ms: Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s). @@ -145,6 +152,8 @@ def extract( "include_frames": include_frames, "instructions": instructions, "max_age_ms": max_age_ms, + "max_depth": max_depth, + "max_pages": max_pages, "pdf": pdf, "stop_after_ms": stop_after_ms, "timeout_ms": timeout_ms, @@ -985,6 +994,8 @@ async def extract( include_frames: bool | Omit = omit, instructions: str | Omit = omit, max_age_ms: int | Omit = omit, + max_depth: int | Omit = omit, + max_pages: int | Omit = omit, pdf: web_extract_params.Pdf | Omit = omit, stop_after_ms: int | Omit = omit, timeout_ms: int | Omit = omit, @@ -1025,6 +1036,11 @@ async def extract( max_age_ms: Return cached scrape results if a prior scrape for the same parameters is younger than this many milliseconds. Defaults to 7 days (604800000 ms). + max_depth: Optional maximum link depth from the starting URL (0 = only the starting page). + If omitted, there is no crawl depth limit. + + max_pages: Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5. + stop_after_ms: Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s). @@ -1054,6 +1070,8 @@ async def extract( "include_frames": include_frames, "instructions": instructions, "max_age_ms": max_age_ms, + "max_depth": max_depth, + "max_pages": max_pages, "pdf": pdf, "stop_after_ms": stop_after_ms, "timeout_ms": timeout_ms, diff --git a/src/context/dev/types/web_extract_params.py b/src/context/dev/types/web_extract_params.py index e357153..20137e3 100644 --- a/src/context/dev/types/web_extract_params.py +++ b/src/context/dev/types/web_extract_params.py @@ -52,6 +52,15 @@ class WebExtractParams(TypedDict, total=False): younger than this many milliseconds. Defaults to 7 days (604800000 ms). """ + max_depth: Annotated[int, PropertyInfo(alias="maxDepth")] + """Optional maximum link depth from the starting URL (0 = only the starting page). + + If omitted, there is no crawl depth limit. + """ + + max_pages: Annotated[int, PropertyInfo(alias="maxPages")] + """Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5.""" + pdf: Pdf stop_after_ms: Annotated[int, PropertyInfo(alias="stopAfterMs")] diff --git a/tests/api_resources/test_web.py b/tests/api_resources/test_web.py index ce43b3e..95a4074 100644 --- a/tests/api_resources/test_web.py +++ b/tests/api_resources/test_web.py @@ -59,6 +59,8 @@ def test_method_extract_with_all_params(self, client: ContextDev) -> None: include_frames=True, instructions="instructions", max_age_ms=0, + max_depth=0, + max_pages=1, pdf={ "end": 1, "should_parse": True, @@ -649,6 +651,8 @@ async def test_method_extract_with_all_params(self, async_client: AsyncContextDe include_frames=True, instructions="instructions", max_age_ms=0, + max_depth=0, + max_pages=1, pdf={ "end": 1, "should_parse": True, From 6721d0bb8b04b536a28ebc5dfbda87358ccb2f2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 01:09:46 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 ++-- src/context/dev/types/ai_ai_query_response.py | 22 ++++++++++++++++- .../dev/types/ai_extract_product_response.py | 22 ++++++++++++++++- .../dev/types/ai_extract_products_response.py | 22 ++++++++++++++++- ...rand_identify_from_transaction_response.py | 21 ++++++++++++++++ .../types/brand_retrieve_by_email_response.py | 21 ++++++++++++++++ .../types/brand_retrieve_by_isin_response.py | 21 ++++++++++++++++ .../types/brand_retrieve_by_name_response.py | 21 ++++++++++++++++ .../brand_retrieve_by_ticker_response.py | 21 ++++++++++++++++ .../dev/types/brand_retrieve_response.py | 21 ++++++++++++++++ .../brand_retrieve_simplified_response.py | 21 ++++++++++++++++ .../types/industry_retrieve_naics_response.py | 22 ++++++++++++++++- .../types/industry_retrieve_sic_response.py | 22 ++++++++++++++++- .../utility_prefetch_by_email_response.py | 22 ++++++++++++++++- .../dev/types/utility_prefetch_response.py | 22 ++++++++++++++++- .../types/web_extract_competitors_response.py | 24 +++++++++++++++++-- .../dev/types/web_extract_fonts_response.py | 22 ++++++++++++++++- src/context/dev/types/web_extract_response.py | 24 +++++++++++++++++-- .../types/web_extract_styleguide_response.py | 21 ++++++++++++++++ .../dev/types/web_screenshot_response.py | 22 ++++++++++++++++- src/context/dev/types/web_search_response.py | 22 ++++++++++++++++- .../dev/types/web_web_crawl_md_response.py | 24 +++++++++++++++++-- .../dev/types/web_web_scrape_html_response.py | 23 +++++++++++++++++- .../types/web_web_scrape_images_response.py | 22 ++++++++++++++++- .../dev/types/web_web_scrape_md_response.py | 23 +++++++++++++++++- .../types/web_web_scrape_sitemap_response.py | 24 +++++++++++++++++-- 26 files changed, 533 insertions(+), 23 deletions(-) diff --git a/.stats.yml b/.stats.yml index a7bb92d..2a5683f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 25 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7002d4e40fb0a8dc4454b7f72f86d6068245cb367ddf7c784f00e35f6f75de1f.yml -openapi_spec_hash: da6f7b8ab297306b97ed9fe8df9ad1a0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b84f53b1a92511eff85645f287ec08d43adcdcc589367c015770bde836422a65.yml +openapi_spec_hash: 71e317da7bc58cfc3bc2e4180f5b6267 config_hash: f86a4e06ae5ed725aa79d58d7a8dc27c diff --git a/src/context/dev/types/ai_ai_query_response.py b/src/context/dev/types/ai_ai_query_response.py index 1c49c53..634338b 100644 --- a/src/context/dev/types/ai_ai_query_response.py +++ b/src/context/dev/types/ai_ai_query_response.py @@ -4,7 +4,7 @@ from .._models import BaseModel -__all__ = ["AIAIQueryResponse", "DataExtracted"] +__all__ = ["AIAIQueryResponse", "DataExtracted", "KeyMetadata"] class DataExtracted(BaseModel): @@ -19,6 +19,19 @@ class DataExtracted(BaseModel): """ +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class AIAIQueryResponse(BaseModel): data_extracted: Optional[List[DataExtracted]] = None """Array of extracted data points""" @@ -26,6 +39,13 @@ class AIAIQueryResponse(BaseModel): domain: Optional[str] = None """The domain that was analyzed""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/ai_extract_product_response.py b/src/context/dev/types/ai_extract_product_response.py index 06a759f..d56e8d4 100644 --- a/src/context/dev/types/ai_extract_product_response.py +++ b/src/context/dev/types/ai_extract_product_response.py @@ -5,7 +5,20 @@ from .._models import BaseModel -__all__ = ["AIExtractProductResponse", "Product"] +__all__ = ["AIExtractProductResponse", "KeyMetadata", "Product"] + + +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" class Product(BaseModel): @@ -58,6 +71,13 @@ class AIExtractProductResponse(BaseModel): is_product_page: Optional[bool] = None """Whether the given URL is a product detail page""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + platform: Optional[Literal["amazon", "tiktok_shop", "etsy", "generic"]] = None """The detected ecommerce platform, or null if not a product page""" diff --git a/src/context/dev/types/ai_extract_products_response.py b/src/context/dev/types/ai_extract_products_response.py index 3893f7a..c26bdb1 100644 --- a/src/context/dev/types/ai_extract_products_response.py +++ b/src/context/dev/types/ai_extract_products_response.py @@ -5,7 +5,20 @@ from .._models import BaseModel -__all__ = ["AIExtractProductsResponse", "Product"] +__all__ = ["AIExtractProductsResponse", "KeyMetadata", "Product"] + + +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" class Product(BaseModel): @@ -53,5 +66,12 @@ class Product(BaseModel): class AIExtractProductsResponse(BaseModel): + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + products: Optional[List[Product]] = None """Array of products extracted from the website""" diff --git a/src/context/dev/types/brand_identify_from_transaction_response.py b/src/context/dev/types/brand_identify_from_transaction_response.py index 5d499ea..6147e92 100644 --- a/src/context/dev/types/brand_identify_from_transaction_response.py +++ b/src/context/dev/types/brand_identify_from_transaction_response.py @@ -21,6 +21,7 @@ "BrandLogoResolution", "BrandSocial", "BrandStock", + "KeyMetadata", ] @@ -650,6 +651,19 @@ class Brand(BaseModel): """The title or name of the brand""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class BrandIdentifyFromTransactionResponse(BaseModel): brand: Optional[Brand] = None """Detailed brand information""" @@ -657,5 +671,12 @@ class BrandIdentifyFromTransactionResponse(BaseModel): code: Optional[int] = None """HTTP status code""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/brand_retrieve_by_email_response.py b/src/context/dev/types/brand_retrieve_by_email_response.py index db6b862..6fe6482 100644 --- a/src/context/dev/types/brand_retrieve_by_email_response.py +++ b/src/context/dev/types/brand_retrieve_by_email_response.py @@ -21,6 +21,7 @@ "BrandLogoResolution", "BrandSocial", "BrandStock", + "KeyMetadata", ] @@ -650,6 +651,19 @@ class Brand(BaseModel): """The title or name of the brand""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class BrandRetrieveByEmailResponse(BaseModel): brand: Optional[Brand] = None """Detailed brand information""" @@ -657,5 +671,12 @@ class BrandRetrieveByEmailResponse(BaseModel): code: Optional[int] = None """HTTP status code""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/brand_retrieve_by_isin_response.py b/src/context/dev/types/brand_retrieve_by_isin_response.py index 3d080e9..8934a1f 100644 --- a/src/context/dev/types/brand_retrieve_by_isin_response.py +++ b/src/context/dev/types/brand_retrieve_by_isin_response.py @@ -21,6 +21,7 @@ "BrandLogoResolution", "BrandSocial", "BrandStock", + "KeyMetadata", ] @@ -650,6 +651,19 @@ class Brand(BaseModel): """The title or name of the brand""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class BrandRetrieveByIsinResponse(BaseModel): brand: Optional[Brand] = None """Detailed brand information""" @@ -657,5 +671,12 @@ class BrandRetrieveByIsinResponse(BaseModel): code: Optional[int] = None """HTTP status code""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/brand_retrieve_by_name_response.py b/src/context/dev/types/brand_retrieve_by_name_response.py index 9a5b18e..3830c92 100644 --- a/src/context/dev/types/brand_retrieve_by_name_response.py +++ b/src/context/dev/types/brand_retrieve_by_name_response.py @@ -21,6 +21,7 @@ "BrandLogoResolution", "BrandSocial", "BrandStock", + "KeyMetadata", ] @@ -650,6 +651,19 @@ class Brand(BaseModel): """The title or name of the brand""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class BrandRetrieveByNameResponse(BaseModel): brand: Optional[Brand] = None """Detailed brand information""" @@ -657,5 +671,12 @@ class BrandRetrieveByNameResponse(BaseModel): code: Optional[int] = None """HTTP status code""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/brand_retrieve_by_ticker_response.py b/src/context/dev/types/brand_retrieve_by_ticker_response.py index 964d7a4..63ba9a1 100644 --- a/src/context/dev/types/brand_retrieve_by_ticker_response.py +++ b/src/context/dev/types/brand_retrieve_by_ticker_response.py @@ -21,6 +21,7 @@ "BrandLogoResolution", "BrandSocial", "BrandStock", + "KeyMetadata", ] @@ -650,6 +651,19 @@ class Brand(BaseModel): """The title or name of the brand""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class BrandRetrieveByTickerResponse(BaseModel): brand: Optional[Brand] = None """Detailed brand information""" @@ -657,5 +671,12 @@ class BrandRetrieveByTickerResponse(BaseModel): code: Optional[int] = None """HTTP status code""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/brand_retrieve_response.py b/src/context/dev/types/brand_retrieve_response.py index d272dab..513402c 100644 --- a/src/context/dev/types/brand_retrieve_response.py +++ b/src/context/dev/types/brand_retrieve_response.py @@ -21,6 +21,7 @@ "BrandLogoResolution", "BrandSocial", "BrandStock", + "KeyMetadata", ] @@ -650,6 +651,19 @@ class Brand(BaseModel): """The title or name of the brand""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class BrandRetrieveResponse(BaseModel): brand: Optional[Brand] = None """Detailed brand information""" @@ -657,5 +671,12 @@ class BrandRetrieveResponse(BaseModel): code: Optional[int] = None """HTTP status code""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/brand_retrieve_simplified_response.py b/src/context/dev/types/brand_retrieve_simplified_response.py index 819e408..6684272 100644 --- a/src/context/dev/types/brand_retrieve_simplified_response.py +++ b/src/context/dev/types/brand_retrieve_simplified_response.py @@ -15,6 +15,7 @@ "BrandLogo", "BrandLogoColor", "BrandLogoResolution", + "KeyMetadata", ] @@ -119,6 +120,19 @@ class Brand(BaseModel): """The title or name of the brand""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class BrandRetrieveSimplifiedResponse(BaseModel): brand: Optional[Brand] = None """Simplified brand information""" @@ -126,5 +140,12 @@ class BrandRetrieveSimplifiedResponse(BaseModel): code: Optional[int] = None """HTTP status code of the response""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/industry_retrieve_naics_response.py b/src/context/dev/types/industry_retrieve_naics_response.py index bcfc2ad..ea93cfc 100644 --- a/src/context/dev/types/industry_retrieve_naics_response.py +++ b/src/context/dev/types/industry_retrieve_naics_response.py @@ -5,7 +5,7 @@ from .._models import BaseModel -__all__ = ["IndustryRetrieveNaicsResponse", "Code"] +__all__ = ["IndustryRetrieveNaicsResponse", "Code", "KeyMetadata"] class Code(BaseModel): @@ -19,6 +19,19 @@ class Code(BaseModel): """NAICS title""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class IndustryRetrieveNaicsResponse(BaseModel): codes: Optional[List[Code]] = None """Array of NAICS codes and titles.""" @@ -26,6 +39,13 @@ class IndustryRetrieveNaicsResponse(BaseModel): domain: Optional[str] = None """Domain found for the brand""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/industry_retrieve_sic_response.py b/src/context/dev/types/industry_retrieve_sic_response.py index 9a72bb6..c966f5f 100644 --- a/src/context/dev/types/industry_retrieve_sic_response.py +++ b/src/context/dev/types/industry_retrieve_sic_response.py @@ -7,7 +7,7 @@ from .._models import BaseModel -__all__ = ["IndustryRetrieveSicResponse", "Code"] +__all__ = ["IndustryRetrieveSicResponse", "Code", "KeyMetadata"] class Code(BaseModel): @@ -39,6 +39,19 @@ class Code(BaseModel): """ +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class IndustryRetrieveSicResponse(BaseModel): classification: Optional[Literal["original_sic", "latest_sec"]] = None """Echoes back which SIC dataset was used to classify the brand.""" @@ -54,6 +67,13 @@ class IndustryRetrieveSicResponse(BaseModel): domain: Optional[str] = None """Domain found for the brand""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/utility_prefetch_by_email_response.py b/src/context/dev/types/utility_prefetch_by_email_response.py index 7061284..cf7ee7f 100644 --- a/src/context/dev/types/utility_prefetch_by_email_response.py +++ b/src/context/dev/types/utility_prefetch_by_email_response.py @@ -4,13 +4,33 @@ from .._models import BaseModel -__all__ = ["UtilityPrefetchByEmailResponse"] +__all__ = ["UtilityPrefetchByEmailResponse", "KeyMetadata"] + + +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" class UtilityPrefetchByEmailResponse(BaseModel): domain: Optional[str] = None """The domain that was queued for prefetching""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + message: Optional[str] = None """Success message""" diff --git a/src/context/dev/types/utility_prefetch_response.py b/src/context/dev/types/utility_prefetch_response.py index b99a78d..b950e87 100644 --- a/src/context/dev/types/utility_prefetch_response.py +++ b/src/context/dev/types/utility_prefetch_response.py @@ -4,13 +4,33 @@ from .._models import BaseModel -__all__ = ["UtilityPrefetchResponse"] +__all__ = ["UtilityPrefetchResponse", "KeyMetadata"] + + +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" class UtilityPrefetchResponse(BaseModel): domain: Optional[str] = None """The domain that was queued for prefetching""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + message: Optional[str] = None """Success message""" diff --git a/src/context/dev/types/web_extract_competitors_response.py b/src/context/dev/types/web_extract_competitors_response.py index 3f6a68c..0481afc 100644 --- a/src/context/dev/types/web_extract_competitors_response.py +++ b/src/context/dev/types/web_extract_competitors_response.py @@ -1,13 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from typing_extensions import Literal from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["WebExtractCompetitorsResponse", "Competitor", "Target"] +__all__ = ["WebExtractCompetitorsResponse", "Competitor", "Target", "KeyMetadata"] class Competitor(BaseModel): @@ -46,6 +46,19 @@ class Target(BaseModel): """Resolved URL used for the landing page analysis.""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class WebExtractCompetitorsResponse(BaseModel): competitors: List[Competitor] """Direct competitors ordered by relevance and confidence.""" @@ -58,3 +71,10 @@ class WebExtractCompetitorsResponse(BaseModel): target: Target """Target company profile inferred from the landing page.""" + + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ diff --git a/src/context/dev/types/web_extract_fonts_response.py b/src/context/dev/types/web_extract_fonts_response.py index d8cd2a1..4a1ec98 100644 --- a/src/context/dev/types/web_extract_fonts_response.py +++ b/src/context/dev/types/web_extract_fonts_response.py @@ -7,7 +7,7 @@ from .._models import BaseModel -__all__ = ["WebExtractFontsResponse", "Font", "FontLinks"] +__all__ = ["WebExtractFontsResponse", "Font", "FontLinks", "KeyMetadata"] class Font(BaseModel): @@ -57,6 +57,19 @@ class FontLinks(BaseModel): """ +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class WebExtractFontsResponse(BaseModel): code: int """HTTP status code, e.g., 200""" @@ -76,3 +89,10 @@ class WebExtractFontsResponse(BaseModel): names only). Clients match entries in fonts to pick a file URL from files. Omitted when no families resolve to Google or custom @font-face URLs. """ + + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ diff --git a/src/context/dev/types/web_extract_response.py b/src/context/dev/types/web_extract_response.py index 713d345..715ac6e 100644 --- a/src/context/dev/types/web_extract_response.py +++ b/src/context/dev/types/web_extract_response.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List +from typing import Dict, List, Optional from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["WebExtractResponse", "Metadata"] +__all__ = ["WebExtractResponse", "Metadata", "KeyMetadata"] class Metadata(BaseModel): @@ -21,6 +21,19 @@ class Metadata(BaseModel): num_urls: int = FieldInfo(alias="numUrls") +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class WebExtractResponse(BaseModel): data: Dict[str, object] """Extracted data matching the request schema""" @@ -35,3 +48,10 @@ class WebExtractResponse(BaseModel): urls_analyzed: List[str] """List of URLs whose Markdown was used for extraction""" + + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ diff --git a/src/context/dev/types/web_extract_styleguide_response.py b/src/context/dev/types/web_extract_styleguide_response.py index 77e2b55..4592dd9 100644 --- a/src/context/dev/types/web_extract_styleguide_response.py +++ b/src/context/dev/types/web_extract_styleguide_response.py @@ -9,6 +9,7 @@ __all__ = [ "WebExtractStyleguideResponse", + "KeyMetadata", "Styleguide", "StyleguideColors", "StyleguideComponents", @@ -30,6 +31,19 @@ ] +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class StyleguideColors(BaseModel): """Primary colors used on the website""" @@ -420,6 +434,13 @@ class WebExtractStyleguideResponse(BaseModel): domain: Optional[str] = None """The normalized domain that was processed""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + status: Optional[str] = None """Status of the response, e.g., 'ok'""" diff --git a/src/context/dev/types/web_screenshot_response.py b/src/context/dev/types/web_screenshot_response.py index 382707d..a051831 100644 --- a/src/context/dev/types/web_screenshot_response.py +++ b/src/context/dev/types/web_screenshot_response.py @@ -7,7 +7,20 @@ from .._models import BaseModel -__all__ = ["WebScreenshotResponse"] +__all__ = ["WebScreenshotResponse", "KeyMetadata"] + + +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" class WebScreenshotResponse(BaseModel): @@ -20,6 +33,13 @@ class WebScreenshotResponse(BaseModel): height: Optional[int] = None """Height in pixels of the returned screenshot image""" + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ + screenshot: Optional[str] = None """Public URL of the uploaded screenshot image""" diff --git a/src/context/dev/types/web_search_response.py b/src/context/dev/types/web_search_response.py index 11c15d3..62d46ed 100644 --- a/src/context/dev/types/web_search_response.py +++ b/src/context/dev/types/web_search_response.py @@ -5,7 +5,7 @@ from .._models import BaseModel -__all__ = ["WebSearchResponse", "Result", "ResultMarkdown"] +__all__ = ["WebSearchResponse", "Result", "ResultMarkdown", "KeyMetadata"] class ResultMarkdown(BaseModel): @@ -38,8 +38,28 @@ class Result(BaseModel): """Canonical result URL.""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class WebSearchResponse(BaseModel): query: str """Echo of the original query (useful when fanout was enabled).""" results: List[Result] + + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ diff --git a/src/context/dev/types/web_web_crawl_md_response.py b/src/context/dev/types/web_web_crawl_md_response.py index c43975e..ae798bc 100644 --- a/src/context/dev/types/web_web_crawl_md_response.py +++ b/src/context/dev/types/web_web_crawl_md_response.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["WebWebCrawlMdResponse", "Metadata", "Result", "ResultMetadata"] +__all__ = ["WebWebCrawlMdResponse", "Metadata", "Result", "ResultMetadata", "KeyMetadata"] class Metadata(BaseModel): @@ -53,7 +53,27 @@ class Result(BaseModel): metadata: ResultMetadata +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class WebWebCrawlMdResponse(BaseModel): metadata: Metadata results: List[Result] + + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ diff --git a/src/context/dev/types/web_web_scrape_html_response.py b/src/context/dev/types/web_web_scrape_html_response.py index 2e8caa7..690047c 100644 --- a/src/context/dev/types/web_web_scrape_html_response.py +++ b/src/context/dev/types/web_web_scrape_html_response.py @@ -1,10 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from typing_extensions import Literal from .._models import BaseModel -__all__ = ["WebWebScrapeHTMLResponse"] +__all__ = ["WebWebScrapeHTMLResponse", "KeyMetadata"] + + +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" class WebWebScrapeHTMLResponse(BaseModel): @@ -27,3 +41,10 @@ class WebWebScrapeHTMLResponse(BaseModel): url: str """The URL that was scraped""" + + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ diff --git a/src/context/dev/types/web_web_scrape_images_response.py b/src/context/dev/types/web_web_scrape_images_response.py index 6bb1144..abd62f2 100644 --- a/src/context/dev/types/web_web_scrape_images_response.py +++ b/src/context/dev/types/web_web_scrape_images_response.py @@ -5,7 +5,7 @@ from .._models import BaseModel -__all__ = ["WebWebScrapeImagesResponse", "Image", "ImageEnrichment"] +__all__ = ["WebWebScrapeImagesResponse", "Image", "ImageEnrichment", "KeyMetadata"] class ImageEnrichment(BaseModel): @@ -46,6 +46,19 @@ class Image(BaseModel): """Requested metadata for images that could be processed.""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class WebWebScrapeImagesResponse(BaseModel): images: List[Image] """Images found on the page.""" @@ -55,3 +68,10 @@ class WebWebScrapeImagesResponse(BaseModel): url: str """Page URL that was scraped.""" + + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ diff --git a/src/context/dev/types/web_web_scrape_md_response.py b/src/context/dev/types/web_web_scrape_md_response.py index f99b67c..2510e1a 100644 --- a/src/context/dev/types/web_web_scrape_md_response.py +++ b/src/context/dev/types/web_web_scrape_md_response.py @@ -1,10 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from typing_extensions import Literal from .._models import BaseModel -__all__ = ["WebWebScrapeMdResponse"] +__all__ = ["WebWebScrapeMdResponse", "KeyMetadata"] + + +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" class WebWebScrapeMdResponse(BaseModel): @@ -16,3 +30,10 @@ class WebWebScrapeMdResponse(BaseModel): url: str """The URL that was scraped""" + + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ diff --git a/src/context/dev/types/web_web_scrape_sitemap_response.py b/src/context/dev/types/web_web_scrape_sitemap_response.py index 7bd55bf..331a0e0 100644 --- a/src/context/dev/types/web_web_scrape_sitemap_response.py +++ b/src/context/dev/types/web_web_scrape_sitemap_response.py @@ -1,13 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from typing_extensions import Literal from pydantic import Field as FieldInfo from .._models import BaseModel -__all__ = ["WebWebScrapeSitemapResponse", "Meta"] +__all__ = ["WebWebScrapeSitemapResponse", "Meta", "KeyMetadata"] class Meta(BaseModel): @@ -26,6 +26,19 @@ class Meta(BaseModel): """Number of sitemap files skipped (due to errors, timeouts, or limits)""" +class KeyMetadata(BaseModel): + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the response status is not 200. + """ + + credits_consumed: int + """The number of credits consumed by this request.""" + + credits_remaining: int + """The number of credits remaining for your organization after this request.""" + + class WebWebScrapeSitemapResponse(BaseModel): domain: str """The normalized domain that was crawled""" @@ -38,3 +51,10 @@ class WebWebScrapeSitemapResponse(BaseModel): urls: List[str] """Array of discovered page URLs from the sitemap (max 500)""" + + key_metadata: Optional[KeyMetadata] = None + """Metadata about the API key used for the request. + + Included in every response whenever a valid API key is provided, even when the + response status is not 200. + """ From 32230f7979bd327052ab2287697920fc237ff269 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 01:10:10 +0000 Subject: [PATCH 3/3] release: 0.35.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ pyproject.toml | 2 +- src/context/dev/_version.py | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e4e1c3c..ce5e5c7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.34.0" + ".": "0.35.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b975c93..4bd6209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.35.0 (2026-06-11) + +Full Changelog: [v0.34.0...v0.35.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.34.0...v0.35.0) + +### Features + +* **api:** api update ([6721d0b](https://github.com/context-dot-dev/context-python-sdk/commit/6721d0bb8b04b536a28ebc5dfbda87358ccb2f2b)) +* **api:** api update ([713964b](https://github.com/context-dot-dev/context-python-sdk/commit/713964bbe1868905959b6758a3da528ded51316e)) + ## 0.34.0 (2026-06-08) Full Changelog: [v0.33.0...v0.34.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.33.0...v0.34.0) diff --git a/pyproject.toml b/pyproject.toml index c6d3576..7ef0c26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "context.dev" -version = "0.34.0" +version = "0.35.0" description = "The official Python library for the context.dev API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/context/dev/_version.py b/src/context/dev/_version.py index 260a9df..aba26ef 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__ = "0.34.0" # x-release-please-version +__version__ = "0.35.0" # x-release-please-version