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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.2.0"
".": "1.3.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 25
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-4903d5902cec6a80f42b9adaa9cf0defa9805ff22d7ae96970d209a4f867e195.yml
openapi_spec_hash: 1097891c23530dfe0155f23170daf973
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d3da262409c68576e457536f6c0e7ecc538219e0af19df415111c18f8fe92cfd.yml
openapi_spec_hash: 25009575202702d24bc6672472eb8506
config_hash: c7b0cdaba3b9797b77efd89e1754d803
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.3.0 (2026-06-26)

Full Changelog: [v1.2.0...v1.3.0](https://github.com/context-dot-dev/context-php-sdk/compare/v1.2.0...v1.3.0)

### Features

* **api:** api update ([df50f08](https://github.com/context-dot-dev/context-php-sdk/commit/df50f08fb5e0eb21378598088d745bc3ebd6b1dd))
* **api:** api update ([8d1b848](https://github.com/context-dot-dev/context-php-sdk/commit/8d1b84827184cc37a49fa3c532e21c16fa7dbc47))

## 1.2.0 (2026-06-25)

Full Changelog: [v1.1.0...v1.2.0](https://github.com/context-dot-dev/context-php-sdk/compare/v1.1.0...v1.2.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The REST API documentation can be found on [docs.context.dev](https://docs.conte
<!-- x-release-please-start-version -->

```
composer require "context-dev/context-dev-php 1.2.0"
composer require "context-dev/context-dev-php 1.3.0"
```

<!-- x-release-please-end -->
Expand Down
15 changes: 14 additions & 1 deletion src/ServiceContracts/WebContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use ContextDev\Web\WebExtractParams\Pdf;
use ContextDev\Web\WebExtractResponse;
use ContextDev\Web\WebExtractStyleguideResponse;
use ContextDev\Web\WebScreenshotParams\Country;
use ContextDev\Web\WebScreenshotParams\FullScreenshot;
use ContextDev\Web\WebScreenshotParams\HandleCookiePopup;
use ContextDev\Web\WebScreenshotParams\Page;
Expand Down Expand Up @@ -133,6 +134,7 @@ public function extractStyleguide(
/**
* @api
*
* @param Country|value-of<Country> $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.
* @param string $directURL A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both.
* @param string $domain Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
* @param FullScreenshot|value-of<FullScreenshot> $fullScreenshot Optional parameter to determine screenshot type. If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view).
Expand All @@ -148,6 +150,7 @@ public function extractStyleguide(
* @throws APIException
*/
public function screenshot(
Country|string|null $country = null,
?string $directURL = null,
?string $domain = null,
FullScreenshot|string|null $fullScreenshot = null,
Expand All @@ -164,11 +167,13 @@ public function screenshot(
/**
* @api
*
* @param string $query natural-language search query
* @param string $query Search query. Accepts natural language as well as Google-style search operators such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`.
* @param \ContextDev\Web\WebSearchParams\Country|value-of<\ContextDev\Web\WebSearchParams\Country> $country Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific country (maps to Google's `gl` parameter). Example: "us", "gb", "de".
* @param list<string> $excludeDomains Blocklist — drop results from these domains. Example: ["pinterest.com", "reddit.com"].
* @param Freshness|value-of<Freshness> $freshness restrict results to content published within this window
* @param list<string> $includeDomains Allowlist — only return results from these domains. Example: ["arxiv.org", "github.com"].
* @param MarkdownOptions|MarkdownOptionsShape $markdownOptions Inline Markdown scraping for each result. Set `enabled: true` to activate.
* @param int $numResults Number of results to request and return (10–100). Defaults to 10.
* @param bool $queryFanout expand the query into multiple parallel variants for broader recall
* @param int $timeoutMs 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).
* @param RequestOpts|null $requestOptions
Expand All @@ -177,10 +182,12 @@ public function screenshot(
*/
public function search(
string $query,
\ContextDev\Web\WebSearchParams\Country|string|null $country = null,
?array $excludeDomains = null,
Freshness|string|null $freshness = null,
?array $includeDomains = null,
MarkdownOptions|array|null $markdownOptions = null,
int $numResults = 10,
?bool $queryFanout = null,
?int $timeoutMs = null,
RequestOptions|array|null $requestOptions = null,
Expand All @@ -190,6 +197,7 @@ public function search(
* @api
*
* @param string $url The starting URL for the crawl (must include http:// or https:// protocol)
* @param \ContextDev\Web\WebWebCrawlMdParams\Country|value-of<\ContextDev\Web\WebWebCrawlMdParams\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.
* @param list<string> $excludeSelectors CSS selectors to remove before each crawled page is converted to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
* @param bool $followSubdomains When true, follow links on subdomains of the starting URL's domain (e.g. docs.example.com when starting from example.com). www and apex are always treated as equivalent.
* @param bool $includeFrames when true, the contents of iframes are rendered to Markdown for each crawled page
Expand All @@ -212,6 +220,7 @@ public function search(
*/
public function webCrawlMd(
string $url,
\ContextDev\Web\WebWebCrawlMdParams\Country|string|null $country = null,
?array $excludeSelectors = null,
bool $followSubdomains = false,
bool $includeFrames = false,
Expand All @@ -237,6 +246,7 @@ public function webCrawlMd(
* @api
*
* @param string $url Full URL to scrape (must include http:// or https:// protocol)
* @param \ContextDev\Web\WebWebScrapeHTMLParams\Country|value-of<\ContextDev\Web\WebWebScrapeHTMLParams\Country> $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.
* @param list<string> $excludeSelectors CSS selectors to remove from the result. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
* @param array<string,string> $headers Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.
* @param bool $includeFrames when true, iframes are rendered inline into the returned HTML
Expand All @@ -252,6 +262,7 @@ public function webCrawlMd(
*/
public function webScrapeHTML(
string $url,
\ContextDev\Web\WebWebScrapeHTMLParams\Country|string|null $country = null,
?array $excludeSelectors = null,
?array $headers = null,
bool $includeFrames = false,
Expand Down Expand Up @@ -293,6 +304,7 @@ public function webScrapeImages(
* @api
*
* @param string $url Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol)
* @param \ContextDev\Web\WebWebScrapeMdParams\Country|value-of<\ContextDev\Web\WebWebScrapeMdParams\Country> $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.
* @param list<string> $excludeSelectors CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
* @param array<string,string> $headers Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.
* @param bool $includeFrames when true, the contents of iframes are rendered to Markdown
Expand All @@ -311,6 +323,7 @@ public function webScrapeImages(
*/
public function webScrapeMd(
string $url,
\ContextDev\Web\WebWebScrapeMdParams\Country|string|null $country = null,
?array $excludeSelectors = null,
?array $headers = null,
bool $includeFrames = false,
Expand Down
7 changes: 7 additions & 0 deletions src/Services/WebRawService.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use ContextDev\Web\WebExtractStyleguideParams;
use ContextDev\Web\WebExtractStyleguideResponse;
use ContextDev\Web\WebScreenshotParams;
use ContextDev\Web\WebScreenshotParams\Country;
use ContextDev\Web\WebScreenshotParams\FullScreenshot;
use ContextDev\Web\WebScreenshotParams\HandleCookiePopup;
use ContextDev\Web\WebScreenshotParams\Page;
Expand Down Expand Up @@ -215,6 +216,7 @@ public function extractStyleguide(
* Capture a screenshot of a website.
*
* @param array{
* country?: value-of<Country>,
* directURL?: string,
* domain?: string,
* fullScreenshot?: FullScreenshot|value-of<FullScreenshot>,
Expand Down Expand Up @@ -261,10 +263,12 @@ public function screenshot(
*
* @param array{
* query: string,
* country?: value-of<WebSearchParams\Country>,
* excludeDomains?: list<string>,
* freshness?: Freshness|value-of<Freshness>,
* includeDomains?: list<string>,
* markdownOptions?: MarkdownOptions|MarkdownOptionsShape,
* numResults?: int,
* queryFanout?: bool,
* timeoutMs?: int,
* }|WebSearchParams $params
Expand Down Expand Up @@ -300,6 +304,7 @@ public function search(
*
* @param array{
* url: string,
* country?: value-of<WebWebCrawlMdParams\Country>,
* excludeSelectors?: list<string>,
* followSubdomains?: bool,
* includeFrames?: bool,
Expand Down Expand Up @@ -349,6 +354,7 @@ public function webCrawlMd(
*
* @param array{
* url: string,
* country?: value-of<WebWebScrapeHTMLParams\Country>,
* excludeSelectors?: list<string>,
* headers?: array<string,string>,
* includeFrames?: bool,
Expand Down Expand Up @@ -429,6 +435,7 @@ public function webScrapeImages(
*
* @param array{
* url: string,
* country?: value-of<WebWebScrapeMdParams\Country>,
* excludeSelectors?: list<string>,
* headers?: array<string,string>,
* includeFrames?: bool,
Expand Down
Loading