# VirginProxy documentation The complete documentation of the VirginProxy web scraping API (https://docs.virginproxy.com), one page after the other. API description: https://docs.virginproxy.com/openapi.json # Quick start > Send your first request through a clean, high-reputation IP in two minutes: create a key, call one endpoint, read the response and its price. Source: https://docs.virginproxy.com/ VirginProxy API · v1 # Fetch any page from a clean, high‑reputation IP One HTTP endpoint. Send a URL, get the target's answer back with the exit IP, the size and the exact price. Nothing to install, nothing to configure. - [Get a free API key](https://dash.virginproxy.com/signup) - [Open your API keys](https://dash.virginproxy.com/keys) - [Read the reference](https://docs.virginproxy.com/requests/) 0. [Create a free API key](https://dash.virginproxy.com/signup) (50 credits, no card) and put it into `VP_KEY`.Copy a key from [your API keys](https://dash.virginproxy.com/keys) and put it into `VP_KEY`. 1. Send a request **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/ip" }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={"url": "https://httpbin.org/ip"}, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["status"], data["exit"]["ip"], data["cost"]["credits"]) print(data["body"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/ip" }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.status, data.exit.ip, data.cost.credits); console.log(data.body); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({"url": "https://httpbin.org/ip"}) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/ip" }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode(["url" => "https://httpbin.org/ip"], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["status"], " ", $data["exit"]["ip"], " ", $data["cost"]["credits"], PHP_EOL; echo $data["body"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/ip" }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["status"], data["exit"].(map[string]any)["ip"], data["cost"].(map[string]any)["credits"]) fmt.Println(data["body"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL2lwIn0) 2. Get the answer and its receipt *Response · 200 OK:* ```json { "id": "req_s0F0gEspheQI7zpoNzwU", "status": 200, "final_url": "https://httpbin.org/ip", "headers": { "content-type": "application/json", "content-length": "33", "date": "Mon, 16 Nov 2026 19:41:35 GMT" }, "body": "{\n \"origin\": \"203.0.113.42\"\n}\n", "body_encoding": "utf8", "truncated": false, "exit": { "ip": "203.0.113.42", "country": "DE" }, "bytes": { "up": 1984, "down": 4212 }, "duration_ms": 583, "cost": { "credits": 1, "credits_used": 1, "credits_included": 1000 } } ``` ## Explore the API - [Make a request](https://docs.virginproxy.com/requests/): Every option of POST /v1/requests: method, browser, headers, cookies, body, sessions. - [Pages with JavaScript](https://docs.virginproxy.com/render/): Load pages in a real browser: steps, screenshots, PDFs, background requests. - [Output formats](https://docs.virginproxy.com/formats/): Get Markdown, plain text or clean HTML instead of raw markup. - [Parse pages](https://docs.virginproxy.com/parse/): Links, metadata, images, tables and JSON-LD, read out for you. - [Extract data](https://docs.virginproxy.com/extract/): CSS, XPath and JSON paths with types, regex and nested fields. - [Jobs and batches](https://docs.virginproxy.com/jobs/): Send up to 1,000 requests at once and collect the results later. - [Webhooks](https://docs.virginproxy.com/webhooks/): Get each result pushed to your server, signed and retried. - [Screenshots](https://docs.virginproxy.com/screenshot/): A picture of any page as PNG, JPEG or WebP with one GET request. - [Map and crawl](https://docs.virginproxy.com/crawl/): List every address of a site, or crawl it page by page in the background. - [AI agents](https://docs.virginproxy.com/ai-agents/): MCP server, tool definitions for OpenAI and Anthropic, Markdown docs. - [Parameter reference](https://docs.virginproxy.com/reference/): Every request parameter on one filterable page, and a request builder. - [Errors](https://docs.virginproxy.com/errors/): Every error code, its HTTP status and whether to retry. ## Get an API key You are signed in: your keys are under [API keys](https://dash.virginproxy.com/keys) in the dashboard. Create a new one there or reuse an existing one. [Create a free account](https://dash.virginproxy.com/signup). Your first key is shown once, right after you sign up. Then open the link in the e-mail we send you: requests work once your address is confirmed. The free plan includes 50 credits, once, and needs no card. Keep the key in an environment variable. All examples read it from `VP_KEY`. ```bash export VP_KEY="vp_live_…" ``` ## Read the response `status`, `headers` and `body` are the target's answer. Everything else is the receipt: which IP made the request, how many bytes were transferred, how long it took and how many credits it cost. A target that answers 404 or 500 is still an answered request; errors on our side come back as an [error object](https://docs.virginproxy.com/errors/) and are never charged. > **Tip:** Pick your language once in any code block: every example on every page follows it. ## Where to go next - [Browsers](https://docs.virginproxy.com/browsers/) explains how each request looks like a real browser, and how to pick one. - [Cookies and sessions](https://docs.virginproxy.com/cookies/) and [IPs and sessions](https://docs.virginproxy.com/sessions/) show how to keep one IP and its cookies, or ask for a new IP. - [Copy a request from your browser](https://docs.virginproxy.com/copy-from-browser/) turns a request from the developer tools into an API call. - [Credits and billing](https://docs.virginproxy.com/billing/) explains exactly what a request costs and when it costs nothing. - Ready-made clients for [Python](https://docs.virginproxy.com/python/), [Node.js](https://docs.virginproxy.com/nodejs/), [PHP](https://docs.virginproxy.com/php/) and [the Go language](https://docs.virginproxy.com/go/). --- # Make a request > Reference for POST /v1/requests: every request option with its type and limits, and every field of the response. Source: https://docs.virginproxy.com/requests/ `POST /v1/requests` runs one HTTP request through our network and returns the result as JSON. Only `url` is required; every other option has a sensible default. ## Authentication Send your key in the `Authorization` header. `X-API-Key: vp_live_…` works as well. ```http Authorization: Bearer vp_live_… ``` ## Request options The body is a JSON object. The options are grouped below by what they do. ### Target and method | Field | Type | Meaning | | --- | --- | --- | | `url` | string | Absolute `http` or `https` URL, up to 8,000 characters (also after `params` were added). Credentials inside the URL are rejected; send an `Authorization` header instead. | | `method` | string | `GET` (default), `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD` or `OPTIONS`. With `render` only `GET`. | | `params` | object | Query parameters, added to the query the URL already has. Values are strings, numbers, booleans or lists of them (a list repeats the name). At most 500 values. See [Headers and body](https://docs.virginproxy.com/headers/#params). | ### Browser and language | Field | Type | Meaning | | --- | --- | --- | | `browser` | string | Which browser the request looks like: `chrome` (default), `chrome_mac`, `chrome_android`, `edge`, `firefox`, `safari`, `safari_ios` or `none`. With `render` the default is `chrome_android`. See [Browsers](https://docs.virginproxy.com/browsers/). | | `locale` | string | Language of the visitor, such as `de-DE` (default), `en-US` or `fr`. Sets `Accept-Language`, and the browser language when rendering. | | `headers` | object | Headers for the target, as name and string value. At most 100; names up to 64 characters, values up to 8,000 without line breaks. They replace the browser's headers of the same name (case does not matter); an empty value leaves that header out. | ### Cookies | Field | Type | Meaning | | --- | --- | --- | | `cookies` | object or list | `{"name": "value"}`, or a list of `{"name", "value", "domain"?, "path"?}`. At most 200; values up to 8,000 characters without `;` or line breaks. A `Cookie` header in `headers` works as well. See [Cookies and sessions](https://docs.virginproxy.com/cookies/). | | `cookie_jar` | boolean | Only with `session`. Default `true`: cookies the site sets are remembered for the next requests of the session. `false` turns that off. | ### Body Send at most one of `json`, `form` and `body`. The body may be up to 5 MB. | Field | Type | Meaning | | --- | --- | --- | | `json` | any JSON | Sent as JSON. Sets `Content-Type: application/json` unless you send your own. | | `form` | object | Sent as an HTML form (`application/x-www-form-urlencoded`). Values as in `params`. | | `body` | string | Sent exactly as given. Set your own `Content-Type`. | | `body_encoding` | string | `"base64"` when `body` is base64-encoded binary data. Default is plain UTF-8 text. | ### IP and session | Field | Type | Meaning | | --- | --- | --- | | `session` | string | A name of your choice (letters, digits, `_ . : -`, up to 64). Requests with the same name leave through the same IP for up to 10 minutes and share their cookies. See [IPs and sessions](https://docs.virginproxy.com/sessions/). | | `fresh_ip` | boolean | `true` gets a new IP address before the request. Costs 5 extra credits. Cannot be combined with `session`. | | `ip_version` | string | `"4"` (default), `"6"` or `"auto"`. | ### Redirects, time and retries | Field | Type | Meaning | | --- | --- | --- | | `follow_redirects` | boolean | Default `true`: redirects are followed and count as one request. `false` returns the redirect response itself. | | `max_redirects` | integer | 0 to 10, default 5. More redirects end with `too_many_redirects`. | | `timeout_ms` | integer | How long one attempt may take, at least 1000. The upper limit and the default are your plan's timeout (30 to 120 seconds); larger values are lowered to it. A call you wait for ends after 90 seconds in total, see [Limits](https://docs.virginproxy.com/limits/#timeouts). | | `retry` | object | `{"times": 0–3, "on": […], "fresh_ip": true\|false}`: try again when the target answers with one of the listed statuses or fails. Default when given: once, on `403`, `429`, `503`, `timeout` and `connection_failed`. See [Automatic retries](https://docs.virginproxy.com/retries/). | ### Rendering | Field | Type | Meaning | | --- | --- | --- | | `render` | boolean or object | `true` loads the page in a real browser and returns it after its scripts ran. The object form sets when the page counts as loaded, steps (click, type, keys, select, scripts …), screenshot and PDF, blocked addresses, captured background requests and the whole device: time zone, location, screen, colour scheme, device properties, page storage. Costs 9 extra credits. See [Pages with JavaScript](https://docs.virginproxy.com/render/) and [Device and environment](https://docs.virginproxy.com/device/). | ### Output | Field | Type | Meaning | | --- | --- | --- | | `format` | string | `raw` (default), `markdown`, `text` or `clean_html`. Converts an HTML answer. See [Output formats](https://docs.virginproxy.com/formats/). | | `main_content` | boolean | `true` keeps only the main content of the page before converting. | | `parse` | list or true | Reads metadata, links, images, headings, e-mails, phones, tables and JSON-LD into `parsed`. See [Parse pages](https://docs.virginproxy.com/parse/). | ### Cost and tracking | Field | Type | Meaning | | --- | --- | --- | | `max_credits` | integer | 1 to 1,000. The request never costs more. See [Credits and billing](https://docs.virginproxy.com/billing/#max-credits). | | `tag` | string | Your label for the request, up to 64 characters. Stored, returned, filterable. See [Tags](https://docs.virginproxy.com/account/#tags). | | `echo` | any JSON | Up to 2 KB, returned unchanged as `echo`. See [Echo](https://docs.virginproxy.com/account/#echo). | ### Extraction and connection | Field | Type | Meaning | | --- | --- | --- | | `extract` | object | Up to 50 fields `{"name": "css selector"}` or `{"name": {"selector" \| "xpath" \| "json", "attr", "all", "type", "regex", "default", "fields"}}`. The result is in `extracted`. See [Extract data](https://docs.virginproxy.com/extract/). | | `http_version` | string | `"auto"` (default: as the chosen browser, usually HTTP/2) or `"1.1"` to force HTTP/1.1. Only for requests without `render`. | | `insecure` | boolean | `true` accepts invalid TLS certificates of the target, for example a test server with a self-signed certificate. Default `false`. | These headers are managed by the connection and dropped if you send them: `Host`, `Content-Length`, `Connection`, `Transfer-Encoding`, `Upgrade`, `TE`, `Trailer`, `Keep-Alive`, `Proxy-Authorization`, `Proxy-Connection`. ### Example: POST with a JSON body and a cookie **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/post", "method": "POST", "params": { "source": "docs" }, "cookies": { "theme": "dark" }, "json": { "q": "shoes", "size": 42 } }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://httpbin.org/post", "method": "POST", "params": {"source": "docs"}, "cookies": {"theme": "dark"}, "json": {"q": "shoes", "size": 42}, }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["status"], data["http_version"], data["browser"]) print(data["body"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/post", method: "POST", params: { source: "docs" }, cookies: { theme: "dark" }, json: { q: "shoes", size: 42 }, }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.status, data.http_version, data.browser); console.log(data.body); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://httpbin.org/post", "method": "POST", "params": {"source": "docs"}, "cookies": {"theme": "dark"}, "json": {"q": "shoes", "size": 42}, }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/post", method: "POST", params: { source: "docs" }, cookies: { theme: "dark" }, json: { q: "shoes", size: 42 }, }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://httpbin.org/post", "method" => "POST", "params" => ["source" => "docs"], "cookies" => ["theme" => "dark"], "json" => ["q" => "shoes", "size" => 42], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["status"], " ", $data["http_version"], " ", $data["browser"], PHP_EOL; echo $data["body"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/post", "method": "POST", "params": { "source": "docs" }, "cookies": { "theme": "dark" }, "json": { "q": "shoes", "size": 42 } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["status"], data["http_version"], data["browser"]) fmt.Println(data["body"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL3Bvc3QiLCJtZXRob2QiOiJQT1NUIiwicGFyYW1zIjp7InNvdXJjZSI6ImRvY3MifSwiY29va2llcyI6eyJ0aGVtZSI6ImRhcmsifSwianNvbiI6eyJxIjoic2hvZXMiLCJzaXplIjo0Mn19) ## Response When the target answered, you get HTTP 200 from us and the target's own status inside the JSON. A target that answers 404 or 500 is still an answered request. ```json { "id": "req_Hk2mQe8VtLw0pXr5sNa1", "status": 200, "final_url": "https://httpbin.org/cookies", "headers": { "content-type": "application/json", "content-length": "44", "date": "Tue, 17 Nov 2026 10:12:08 GMT" }, "cookies": [ { "name": "theme", "value": "dark", "domain": "httpbin.org", "path": "/", "secure": false, "http_only": false } ], "redirects": [ { "url": "https://httpbin.org/cookies/set?theme=dark", "status": 302 } ], "body": "{\n \"cookies\": {\n \"theme\": \"dark\"\n }\n}\n", "body_encoding": "utf8", "truncated": false, "browser": "chrome", "http_version": "HTTP/2.0", "attempts": 1, "exit": { "ip": "203.0.113.42", "country": "DE" }, "bytes": { "up": 2310, "down": 5021 }, "duration_ms": 912, "cost": { "credits": 1, "credits_used": 12, "credits_included": 1000 } } ``` | Field | Meaning | | --- | --- | | `id` | Our id for this request, e.g. `req_s0F0gEspheQI7zpoNzwU`. Quote it when you contact support. | | `status` | The target's HTTP status. | | `final_url` | The URL that produced the answer, after redirects. | | `headers` | The target's response headers, names in lower case, each as one string. `set-cookie` is a list with one entry per cookie. | | `cookies` | Every cookie the target set, also on the way through redirects, already parsed: `name`, `value`, `domain`, `path`, `secure`, `http_only`, and when present `expires`, `max_age` and `same_site`. | | `redirects` | The redirects that were followed, in order, each as `{"url", "status"}`. Empty when there were none. | | `body` | The response body. Text for textual content types, otherwise base64. With `render`, the page as HTML after its scripts ran. | | `body_encoding` | `"utf8"` or `"base64"`. Always check it before using `body`. | | `truncated` | `true` when the body was cut at your plan's size limit (2 to 25 MB) or by `max_credits`. | | `browser` | The browser the request was sent as. | | `http_version` | The HTTP version the target answered with, for example `HTTP/2.0`. | | `attempts` | How many attempts it took: 1 without `retry`. | | `rendered` | Only with `render`: `true`. | | `format` | The format that was applied: `raw` unless you asked for another one and the answer was HTML or a document. | | `tokens` | Only with `format` `markdown`, `text` or `clean_html`: about how many tokens the body is (estimated, about 4 characters per token in Latin script) – to plan what fits into an AI prompt. | | `document` | Only when the answer was a document (PDF, Word, Excel, PowerPoint, OpenDocument, CSV) and `format` converted it: `{"type", "pages", "truncated", "text"}`. `text` is `false` for a scanned PDF without a text layer. | | `strategy`, `strategy_attempts` | Only with `"render": "auto"`: `"http"` or `"browser"`, and every try with its status, the reason for the second one and its credits. | | `redacted` | Only with `redact`: how many of each kind were blacked out, e.g. `{"email": 2}`. | | `auto_extracted` | Only with `auto_extract`: `{"type", "data", "sources", "confidence"}`, or `null` when the page has no such record. | | `trace` | Only with `render.trace`: one entry per step and the end, each `{"step", "action", "at_ms", "url", "screenshot", "console"}` (JPEG as base64). | | `parsed` | Only with `parse`: the keys you asked for. | | `extracted` | Only with `extract`: your fields. | | `tag`, `echo` | Only when you sent them: returned unchanged. | | `preset` | Only with `preset`: the preset that was applied. | | `cached`, `cached_at`, `cache_expires_at` | Only for an answer from the cache: `true`, when it was fetched and until when it is kept. `id` is the request that fetched it; `cost.credits` is 0. | | `change` | Only with `track_changes`: `{"status": "new"\|"same"\|"changed", "previous_request", "previous_at"}`, with `diff` also `{"added", "removed", "added_count", "removed_count", "truncated"}`. | | `screenshot` | Only with `render`: the visible part of the page as a base64 PNG when you asked for `screenshot`, otherwise `null`. | | `exit.ip` | The public IP the target saw. | | `exit.country` | ISO country code of the exit IP. | | `bytes.up`, `bytes.down` | Bytes sent and received for the answer you got, including TLS and headers. That is why a 33-byte body shows about 4 kB. With `render`, everything the browser loaded for the page. | | `duration_ms` | Time from our network starting the request to the last byte, all attempts included. | | `cost.credits` | Credits charged for this request. | | `cost.credits_used`, `cost.credits_included` | Your total for the period after this request, and what your plan includes. | If the request could not be completed you get an error object instead. See [Errors](https://docs.virginproxy.com/errors/). ## Binary responses Images, PDFs and other non-text content arrive as base64 with `"body_encoding": "base64"`. If you would rather receive the bytes directly, use [raw mode](https://docs.virginproxy.com/raw/). --- # Parameter reference > Every request parameter of the VirginProxy API on one page: name, type, default and meaning, with a link to the detailed documentation. Source: https://docs.virginproxy.com/reference/ All 83 parameters of `POST /v1/requests` and `POST /v1/jobs` in one table. Dotted names are fields inside an object: `retry.times` is `"retry": {"times": 2}`, `extract.*.type` is the `type` of any field in `extract`. ## Build a request Choose an endpoint and the most common options, then copy the code in your language, open the request in the Playground or copy a cost estimate. Nothing is sent from this page; the key stays the placeholder `$VP_KEY`. **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/ip" }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={"url": "https://httpbin.org/ip"}, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["status"], data["cost"]["credits"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/ip" }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.status, data.cost.credits); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({"url": "https://httpbin.org/ip"}) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/ip" }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode(["url" => "https://httpbin.org/ip"], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["status"], " ", $data["cost"]["credits"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/ip" }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["status"], data["cost"].(map[string]any)["credits"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL2lwIn0) ## All parameters | Parameter | Type | Default | Description | | --- | --- | --- | --- | | **Target and method** | | | | | [`url`](https://docs.virginproxy.com/requests/#target)[#p-url](#p-url) | string | required | Absolute `http` or `https` URL, up to 8,000 characters. Credentials inside the URL are rejected. | | [`method`](https://docs.virginproxy.com/requests/#target)[#p-method](#p-method) | string | `"GET"` | `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD` or `OPTIONS`. With `render` only `GET`. | | [`params`](https://docs.virginproxy.com/headers/#params)[#p-params](#p-params) | object | – | Query parameters added to the URL. Values are strings, numbers, booleans or lists of them. At most 500 values. | | **Browser and language** | | | | | [`browser`](https://docs.virginproxy.com/browsers/)[#p-browser](#p-browser) | string | `"chrome"` | Which browser the request looks like: `chrome`, `chrome_mac`, `chrome_android`, `edge`, `firefox`, `safari`, `safari_ios` or `none`. With `render` the default is `chrome_android`. | | [`locale`](https://docs.virginproxy.com/requests/#identity)[#p-locale](#p-locale) | string | `"de-DE"` | Language of the visitor. Sets `Accept-Language`, and the browser language when rendering. | | [`headers`](https://docs.virginproxy.com/headers/)[#p-headers](#p-headers) | object | – | Headers for the target, at most 100. They replace the browser's headers of the same name; an empty value leaves that header out. | | **Cookies and body** | | | | | [`cookies`](https://docs.virginproxy.com/cookies/)[#p-cookies](#p-cookies) | object \| list | – | `{"name": "value"}` or a list of `{"name", "value", "domain"?, "path"?}`. At most 200. | | [`cookie_jar`](https://docs.virginproxy.com/cookies/)[#p-cookie-jar](#p-cookie-jar) | boolean | `true` | Only with `session`: remember cookies the site sets for the next requests of the session. | | [`json`](https://docs.virginproxy.com/headers/)[#p-json](#p-json) | any JSON | – | Body sent as JSON. Sets `Content-Type: application/json` unless you send your own. | | [`form`](https://docs.virginproxy.com/headers/)[#p-form](#p-form) | object | – | Body sent as an HTML form (`application/x-www-form-urlencoded`). | | [`body`](https://docs.virginproxy.com/headers/)[#p-body](#p-body) | string | – | Body sent exactly as given, up to 5 MB. Set your own `Content-Type`. | | [`body_encoding`](https://docs.virginproxy.com/headers/)[#p-body-encoding](#p-body-encoding) | string | `"utf8"` | `"base64"` when `body` is base64-encoded binary data. | | **IP and session** | | | | | [`session`](https://docs.virginproxy.com/sessions/)[#p-session](#p-session) | string | – | A name of your choice. Requests with the same name leave through the same IP for up to 10 minutes and share their cookies. | | [`fresh_ip`](https://docs.virginproxy.com/sessions/)[#p-fresh-ip](#p-fresh-ip) | boolean | `false` | Get a new IP address before the request. 5 extra credits. Not with `session`. | | [`ip_version`](https://docs.virginproxy.com/requests/#ip-options)[#p-ip-version](#p-ip-version) | string | `"4"` | `"4"`, `"6"` or `"auto"`. | | **Redirects, time and retries** | | | | | [`follow_redirects`](https://docs.virginproxy.com/requests/#flow)[#p-follow-redirects](#p-follow-redirects) | boolean | `true` | Follow redirects. `false` returns the redirect response itself. | | [`max_redirects`](https://docs.virginproxy.com/requests/#flow)[#p-max-redirects](#p-max-redirects) | integer | `5` | 0 to 10. More redirects end with `too_many_redirects`. | | [`timeout_ms`](https://docs.virginproxy.com/limits/#timeouts)[#p-timeout-ms](#p-timeout-ms) | integer | plan timeout | How long one attempt may take, at least 1000, at most your plan's timeout (30 to 120 seconds). | | [`retry`](https://docs.virginproxy.com/retries/)[#p-retry](#p-retry) | object | – | Try again before answering when the target refuses or fails. `{}` uses all defaults. | | [`retry.times`](https://docs.virginproxy.com/retries/#fields)[#p-retry-times](#p-retry-times) | integer | `1` | How many more attempts at most: 0 to 3. | | [`retry.on`](https://docs.virginproxy.com/retries/#fields)[#p-retry-on](#p-retry-on) | list | `[403, 429, 503, "timeout", "connection_failed"]` | Statuses 300–599 and the errors `timeout`, `connection_failed`, `target_unreachable`, `tls_error`, `text_match`, `selector_missing`. At most 20. | | [`retry.fresh_ip`](https://docs.virginproxy.com/retries/#fields)[#p-retry-fresh-ip](#p-retry-fresh-ip) | boolean | `false` | A new IP before each further attempt (5 credits each). | | [`retry.if_text`](https://docs.virginproxy.com/retries/#content)[#p-retry-if-text](#p-retry-if-text) | list | – | Up to 10 texts (each up to 200 characters, case ignored). An answer whose body contains one of them is tried again. | | [`retry.if_missing`](https://docs.virginproxy.com/retries/#content)[#p-retry-if-missing](#p-retry-if-missing) | string | – | A CSS selector. An HTML answer in which it finds nothing is tried again. | | **Rendering** | | | | | [`render`](https://docs.virginproxy.com/render/)[#p-render](#p-render) | boolean \| object \| "auto" | `false` | Load the page in a real browser and return it after its scripts ran. 9 extra credits. `"auto"`: first without a browser, with it only when the page needs it – the browser part is charged only then. | | [`render_options`](https://docs.virginproxy.com/render/#auto)[#p-render-options](#p-render-options) | object | – | Only with `"render": "auto"`: the browser settings for the second try (the options of `render`, without screenshot, PDF, steps, capture). | | [`render.wait_until`](https://docs.virginproxy.com/render/#options)[#p-render-wait-until](#p-render-wait-until) | string | `"load"` | `load`, `domcontentloaded` or `networkidle`. | | [`render.wait_for`](https://docs.virginproxy.com/render/#options)[#p-render-wait-for](#p-render-wait-for) | string | – | CSS selector to wait for until it is visible. | | [`render.wait_ms`](https://docs.virginproxy.com/render/#options)[#p-render-wait-ms](#p-render-wait-ms) | integer | `0` | 0 to 15,000 milliseconds to wait at the end. | | [`render.scroll`](https://docs.virginproxy.com/render/#options)[#p-render-scroll](#p-render-scroll) | integer | `0` | Scroll to the bottom 0 to 20 times. | | [`render.screenshot`](https://docs.virginproxy.com/render/#options)[#p-render-screenshot](#p-render-screenshot) | boolean \| object | `false` | Screenshot of the visible area, the full page or one element; PNG, JPEG or WebP. | | [`render.pdf`](https://docs.virginproxy.com/render/#options)[#p-render-pdf](#p-render-pdf) | boolean | `false` | Also return the page as a PDF. | | [`render.block`](https://docs.virginproxy.com/render/#options)[#p-render-block](#p-render-block) | list | `["image", "media", "font"]` | Resource types the browser does not load: `image`, `media`, `font`, `stylesheet`. | | [`render.block_urls`](https://docs.virginproxy.com/render/#options)[#p-render-block-urls](#p-render-block-urls) | list | `[]` | Up to 50 address patterns the browser does not load. | | [`render.capture`](https://docs.virginproxy.com/render/#capture)[#p-render-capture](#p-render-capture) | list | `[]` | Up to 10 address patterns; matching background requests come back in `captured`. | | [`render.actions`](https://docs.virginproxy.com/render/#actions)[#p-render-actions](#p-render-actions) | list | `[]` | Up to 30 steps: click, type, press, hover, select, scroll, wait, evaluate, goto. | | [`render.timezone`](https://docs.virginproxy.com/device/#options)[#p-render-timezone](#p-render-timezone) | string | `"Europe/Berlin"` | IANA time zone the page sees. | | [`render.geolocation`](https://docs.virginproxy.com/device/#options)[#p-render-geolocation](#p-render-geolocation) | object | – | `{"latitude", "longitude", "accuracy"}` reported by `navigator.geolocation`. | | [`render.viewport`](https://docs.virginproxy.com/device/#options)[#p-render-viewport](#p-render-viewport) | object | by browser | `{"width", "height", "scale"}`: screen size and pixel density. | | [`render.color_scheme`](https://docs.virginproxy.com/device/#options)[#p-render-color-scheme](#p-render-color-scheme) | string | `"light"` | `"light"` or `"dark"` for `prefers-color-scheme`. | | [`render.reduced_motion`](https://docs.virginproxy.com/device/#options)[#p-render-reduced-motion](#p-render-reduced-motion) | boolean | `false` | Report `prefers-reduced-motion: reduce`. | | [`render.cpu_cores`](https://docs.virginproxy.com/device/#options)[#p-render-cpu-cores](#p-render-cpu-cores) | integer | by browser | 1 to 64: `navigator.hardwareConcurrency`. | | [`render.memory_gb`](https://docs.virginproxy.com/device/#options)[#p-render-memory-gb](#p-render-memory-gb) | number | by browser | 0.25 to 8: `navigator.deviceMemory`. | | [`render.javascript`](https://docs.virginproxy.com/device/#options)[#p-render-javascript](#p-render-javascript) | boolean | `true` | `false` loads the page without running its scripts. | | [`render.local_storage`](https://docs.virginproxy.com/device/#options)[#p-render-local-storage](#p-render-local-storage) | object | – | Up to 100 entries put into `localStorage` before the page's scripts run. | | [`render.session_storage`](https://docs.virginproxy.com/device/#options)[#p-render-session-storage](#p-render-session-storage) | object | – | The same for `sessionStorage`. | | [`render.trace`](https://docs.virginproxy.com/render/#trace)[#p-render-trace](#p-render-trace) | boolean | `false` | A small picture after every step and at the end, with the page's console messages, in `trace`: to see where a sequence of steps went wrong. | | **Output** | | | | | [`format`](https://docs.virginproxy.com/formats/#format)[#p-format](#p-format) | string | `"raw"` | `raw`, `markdown`, `text` or `clean_html`. Converts an HTML answer before it is returned. | | [`main_content`](https://docs.virginproxy.com/formats/#main-content)[#p-main-content](#p-main-content) | boolean | `false` | Keep only the main content of the page (without navigation, header, footer, sidebars and forms) before converting. | | [`format_options`](https://docs.virginproxy.com/formats/#options)[#p-format-options](#p-format-options) | object | – | With `format`: `include_selector` (keep only this part), `exclude_selector` (leave this out), `images` and `links` (`false` drops them), `max_pages` (documents, 1–500, default 100). | | [`redact`](https://docs.virginproxy.com/formats/#redact)[#p-redact](#p-redact) | list \| true | – | Black out personal data in the text you get: `email`, `phone`, `iban`, `card`, `ip`; `true` for all. Counted in `redacted`. | | [`auto_extract`](https://docs.virginproxy.com/auto-extract/)[#p-auto-extract](#p-auto-extract) | string | – | Read a standard record without selectors: `product`, `article`, `job`, `review_list`, `recipe`, `event`, `organization`. Result in `auto_extracted`. | | [`parse`](https://docs.virginproxy.com/parse/)[#p-parse](#p-parse) | list \| true | – | Standard records `product`, `article`, `organization`, `breadcrumbs` come from the page's structured data. Read out `metadata`, `links`, `images`, `headings`, `emails`, `phones`, `tables`, `json_ld`; `true` for all. Result in `parsed`. | | [`extract`](https://docs.virginproxy.com/extract/)[#p-extract](#p-extract) | object | – | Up to 50 named fields read from the answer with CSS, XPath or JSON paths. Result in `extracted`. | | [`extract.*.selector`](https://docs.virginproxy.com/extract/#fields)[#p-extract-selector](#p-extract-selector) | string | – | CSS selector, up to 500 characters. Exactly one of `selector`, `xpath`, `json`. | | [`extract.*.xpath`](https://docs.virginproxy.com/extract/#xpath)[#p-extract-xpath](#p-extract-xpath) | string | – | XPath expression, up to 500 characters. | | [`extract.*.json`](https://docs.virginproxy.com/extract/#json)[#p-extract-json](#p-extract-json) | string | – | Path into a JSON answer such as `data.items[*].name`. | | [`extract.*.attr`](https://docs.virginproxy.com/extract/#fields)[#p-extract-attr](#p-extract-attr) | string | `"text"` | `text`, `html`, `outer_html` or an attribute name such as `href`. | | [`extract.*.all`](https://docs.virginproxy.com/extract/#fields)[#p-extract-all](#p-extract-all) | boolean | `false` | A list of all matches (up to 1,000) instead of the first. | | [`extract.*.type`](https://docs.virginproxy.com/extract/#types)[#p-extract-type](#p-extract-type) | string | `"string"` | `string`, `number`, `integer` or `boolean`. | | [`extract.*.regex`](https://docs.virginproxy.com/extract/#regex)[#p-extract-regex](#p-extract-regex) | string | – | Regular expression applied to the value; the first group, otherwise the whole match. | | [`extract.*.default`](https://docs.virginproxy.com/extract/#regex)[#p-extract-default](#p-extract-default) | any | `null` | Returned when nothing matched. | | [`extract.*.fields`](https://docs.virginproxy.com/extract/#nested)[#p-extract-fields](#p-extract-fields) | object | – | Sub-fields read relative to each match: objects, or a list of objects with `all`. Up to 3 levels. | | **Connection** | | | | | [`http_version`](https://docs.virginproxy.com/requests/#extract-options)[#p-http-version](#p-http-version) | string | `"auto"` | `"auto"` or `"1.1"`. Only without `render`. | | [`insecure`](https://docs.virginproxy.com/requests/#extract-options)[#p-insecure](#p-insecure) | boolean | `false` | Accept invalid TLS certificates of the target. | | **Cost and tracking** | | | | | [`max_credits`](https://docs.virginproxy.com/billing/#max-credits)[#p-max-credits](#p-max-credits) | integer | – | 1 to 1,000. The request never costs more; the answer is cut to fit. | | [`tag`](https://docs.virginproxy.com/account/#tags)[#p-tag](#p-tag) | string | – | 1 to 64 characters `A–Z a–z 0–9 _ . : / -`. Stored with the request, returned in the answer, filterable. | | [`echo`](https://docs.virginproxy.com/account/#echo)[#p-echo](#p-echo) | any JSON | – | Up to 2 KB of your own data, returned unchanged as `echo`. Useful to match results to your records. | | **Reuse and watch** | | | | | [`cache`](https://docs.virginproxy.com/automation/#cache)[#p-cache](#p-cache) | true \| object | – | Keep the answer and give it again to the same request within `max_age_s` (60 to 604,800 seconds; `true` = one hour): free, at once, marked `"cached": true`. Off unless you send it. | | [`track_changes`](https://docs.virginproxy.com/automation/#changes)[#p-track-changes](#p-track-changes) | true \| object | – | Compare with your last request of the same page: `change.status` is `new`, `same` or `changed`. `{"on": "extracted"}` compares what was read, `{"diff": true}` names the changed lines. | | [`preset`](https://docs.virginproxy.com/automation/#presets)[#p-preset](#p-preset) | string | – | Use the options saved under this name (`POST /v1/presets`); options you send win. | | **Jobs (POST /v1/jobs)** | | | | | [`requests`](https://docs.virginproxy.com/jobs/#create)[#p-requests](#p-requests) | list | – | The requests of the job: 1 to your plan's limit (10, 100, 500 or 1,000). Each is a request body as for `POST /v1/requests`. | | [`request`](https://docs.virginproxy.com/jobs/#create)[#p-request](#p-request) | object | – | A single request instead of `requests`. | | [`urls`](https://docs.virginproxy.com/jobs/#create)[#p-urls](#p-urls) | list | – | Addresses instead of `requests`; each is sent with the options in `defaults`. | | [`defaults`](https://docs.virginproxy.com/jobs/#create)[#p-defaults](#p-defaults) | object | – | With `urls`: the options for every address (as for `POST /v1/requests`, without `url`). | | [`max_credits`](https://docs.virginproxy.com/automation/#job-cap)[#p-max-credits](#p-max-credits) | integer | – | Cost cap of the whole job: once it used that many credits, requests not started end as `job_budget_reached`. | | [`webhook`](https://docs.virginproxy.com/webhooks/)[#p-webhook](#p-webhook) | object | – | `{"url", "events"}`: where to send the results. | | [`webhook.url`](https://docs.virginproxy.com/webhooks/#setup)[#p-webhook-url](#p-webhook-url) | string | – | A public `https://` address. | | [`webhook.events`](https://docs.virginproxy.com/webhooks/#events)[#p-webhook-events](#p-webhook-events) | list | `["done"]` | `item` (each finished request), `item.succeeded`, `item.failed`, `item.changed` (only pages that changed, with `track_changes`) and/or `done` (the whole job). | | [`webhook.include_body`](https://docs.virginproxy.com/webhooks/#events)[#p-webhook-include-body](#p-webhook-include-body) | boolean | `true` | `false`: item events carry the figures and `id`, not the page – fetch it from the results. | | [`webhook.metadata`](https://docs.virginproxy.com/webhooks/#events)[#p-webhook-metadata](#p-webhook-metadata) | object | – | Up to 1 KB of your own data, sent back in every webhook call of the job. | | [`delivery`](https://docs.virginproxy.com/delivery/)[#p-delivery](#p-delivery) | object | – | Write the results into your own storage when the job ends: `{"destination": "dst_…", "format": "ndjson"\|"json"\|"csv", "path": "{date}/{job_id}.ndjson"}`. | | [`Idempotency-Key`](https://docs.virginproxy.com/jobs/#idempotency)[#p-idempotency-key](#p-idempotency-key) | header | – | The same key within 24 hours returns the same job instead of creating a second one. | > **Note:** A dotted name is never sent as a key with a dot. Write the object: `{"retry": {"if_text": ["Please try again"]}}`. The `{ }` button next to a name copies it in that form, with its default value. --- # All endpoints > Every endpoint of the VirginProxy API on one page: method, path, permission, parameters, answer schema and the error codes it can return. Generated from the OpenAPI description. Source: https://docs.virginproxy.com/endpoints/ All 71 endpoints in one place, generated from the [OpenAPI description](https://docs.virginproxy.com/openapi.json) – so nothing here can differ from it. Each shows the permission a key needs, its parameters, the shape of its answer and the error codes it can return. The base URL is `https://api.virginproxy.com`; send your key as `Authorization: Bearer vp_live_…`. Permissions (requests read manage) are explained in [Key permissions](https://docs.virginproxy.com/security/#scopes). ## Overview | Endpoint | What it does | Permission | | --- | --- | --- | | [POST `/v1/requests`](#op-createRequest) | Run one request | requests | | [GET `/v1/raw`](#op-rawRequest) | The target's answer as it is | requests | | [GET `/v1/screenshot`](#op-screenshot) | Screenshot as an image | requests | | [POST `/v1/estimate`](#op-estimate) | What a request may cost, without running it | requests or read | | [GET `/v1/pdf`](#op-pdf) | The page as a PDF document | requests | | [POST `/v1/batch`](#op-createBatch) | A few requests in one call, answered together | requests | | [POST `/v1/map`](#op-mapSite) | The addresses of a website | requests | | [POST `/v1/search`](#op-search) | Search the web and get the results as JSON | requests | | [POST `/v1/crawl`](#op-createCrawl) | Crawl a website in the background | requests | | [GET `/v1/jobs`](#op-listJobs) | Your jobs, newest first | requests or read | | [POST `/v1/jobs`](#op-createJob) | Many requests in the background | requests | | [GET `/v1/jobs/{id}`](#op-getJob) | Progress of a job | requests or read | | [DELETE `/v1/jobs/{id}`](#op-cancelJob) | Cancel a job | requests | | [GET `/v1/jobs/{id}/results`](#op-getJobResults) | Results of a job | requests or read | | [GET `/v1/jobs/{id}/stream`](#op-streamJobResults) | Finished items as they come (NDJSON) | requests or read | | [GET `/v1/jobs/{id}/export`](#op-exportJobResults) | All results of a job as one download | requests or read | | [POST `/v1/jobs/{id}/retry`](#op-retryJob) | Send the failed requests of a job again | requests | | [GET `/v1/requests`](#op-listRequests) | Your recent requests | read | | [GET `/v1/requests/{id}`](#op-getRequest) | One request record | read | | [GET `/v1/requests/{id}/answer`](#op-getRequestAnswer) | The kept answer of a request | read | | [GET `/v1/limits`](#op-getLimits) | What you may still do right now | requests or read | | [PATCH `/v1/account/settings`](#op-updateAccountSettings) | Daily cap, credit alerts, alert webhook | manage | | [GET `/v1/account`](#op-getAccount) | Plan, credits and limits | requests or read | | [GET `/v1/usage`](#op-getUsage) | Usage per day (UTC) | read | | [GET `/v1/usage/breakdown`](#op-getUsageBreakdown) | Usage per target domain, key or tag | read | | [GET `/v1/destinations`](#op-listDestinations) | Your storage destinations | requests or read | | [POST `/v1/destinations`](#op-createDestination) | Add your own storage (S3-compatible) | manage | | [DELETE `/v1/destinations/{id}`](#op-deleteDestination) | Delete a storage destination | manage | | [POST `/v1/destinations/{id}/test`](#op-testDestination) | Write a test file | manage | | [GET `/v1/keys`](#op-listKeys) | Your API keys | manage | | [POST `/v1/keys`](#op-createKey) | Create an API key | manage | | [PATCH `/v1/keys/{id}`](#op-updateKey) | Change name, credit limit, daily limit or IP list of a key | manage | | [DELETE `/v1/keys/{id}`](#op-revokeKey) | Revoke a key | manage | | [POST `/v1/keys/{id}/roll`](#op-rollKey) | Roll a key: a new secret, the old one keeps working for a grace period | manage | | [GET `/v1/webhooks`](#op-getWebhooks) | Webhook secret and recent deliveries | manage | | [POST `/v1/webhooks/secret`](#op-rotateWebhookSecret) | Make a new webhook secret | manage | | [GET `/v1/webhooks/deliveries`](#op-listWebhookDeliveries) | Webhook deliveries, filtered and page by page | manage | | [GET `/v1/webhooks/deliveries/{id}`](#op-getWebhookDelivery) | One delivery with its attempts | manage | | [POST `/v1/webhooks/test`](#op-testWebhook) | Send a signed test delivery now | manage | | [POST `/v1/webhooks/deliveries/{id}/redeliver`](#op-redeliverWebhook) | Send a delivery again | manage | | [GET `/v1/presets`](#op-listPresets) | Your presets | requests or read | | [POST `/v1/presets`](#op-createPreset) | Save request options under a name | manage | | [GET `/v1/presets/{name}`](#op-getPreset) | One preset | requests or read | | [PATCH `/v1/presets/{name}`](#op-updatePreset) | Change a preset | manage | | [DELETE `/v1/presets/{name}`](#op-deletePreset) | Delete a preset | manage | | [GET `/v1/schedules`](#op-listSchedules) | Your schedules | requests or read | | [POST `/v1/schedules`](#op-createSchedule) | Run a job or crawl again and again | manage | | [GET `/v1/schedules/{id}`](#op-getSchedule) | One schedule | requests or read | | [PATCH `/v1/schedules/{id}`](#op-updateSchedule) | Change, pause or resume a schedule | manage | | [DELETE `/v1/schedules/{id}`](#op-deleteSchedule) | Delete a schedule | manage | | [POST `/v1/schedules/preview`](#op-previewSchedule) | Check a rhythm and see its next runs | requests or read | | [GET `/v1/schedules/{id}/reports`](#op-listScheduleReports) | What each run found (monitors) | requests or read | | [POST `/v1/schedules/{id}/run`](#op-runSchedule) | Start a run now | manage | | [GET `/.well-known/ai-catalog.json`](#op-aiCatalog) | AI catalog | No key needed | | [GET `/mcp/server-card`](#op-mcpServerCard) | MCP server card | No key needed | | [GET `/v1/docs`](#op-listMemberDocs) | The complete documentation for your AI | Any key | | [GET `/v1/docs/{name}`](#op-getMemberDoc) | One file of the complete documentation | Any key | | [POST `/mcp`](#op-mcp) | Model Context Protocol endpoint | Key or sign-in | | [GET `/.well-known/oauth-authorization-server`](#op-oauthServerMetadata) | Authorization server metadata (RFC 8414) | No key needed | | [GET `/.well-known/oauth-protected-resource/mcp`](#op-oauthResourceMetadata) | Protected resource metadata of /mcp (RFC 9728) | No key needed | | [POST `/oauth/register`](#op-oauthRegister) | Register an MCP client (RFC 7591) | No key needed | | [POST `/oauth/token`](#op-oauthToken) | Exchange a code or refresh token for tokens | No key needed | | [POST `/oauth/revoke`](#op-oauthRevoke) | Revoke a token (RFC 7009) | No key needed | | [GET `/.well-known/api-catalog`](#op-apiCatalog) | API catalog (RFC 9727) | No key needed | | [GET `/.well-known/security.txt`](#op-securityTxt) | Security contact (RFC 9116) | No key needed | | [GET `/v1/status`](#op-getStatus) | Service status | No key needed | | [GET `/v1/errors`](#op-listErrors) | Every error code | No key needed | | [GET `/healthz`](#op-health) | Up or down | No key needed | | [GET `/openapi.json`](#op-openapiJson) | This description (JSON) | No key needed | | [GET `/openapi.yaml`](#op-openapiYaml) | This description (YAML) | No key needed | | [GET `/`](#op-root) | Service name and docs link | No key needed | ## Requests Run requests. ### POST /v1/requests Run one requestPermissionrequests Fetches one URL through our network and returns the answer with our figures. Charged only when the target answered: 1 credit per started MB, +9 with `render`, +5 per new IP. Waits for the answer (up to about 90 seconds). | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `Idempotency-Key` | header | string | Optional. The same key with the same body within 24 hours returns the first (recorded) answer again, marked with `Idempotent-Replayed: true`, instead of running and charging a second time. A failure that was not charged is not kept: sending it again runs it again. | **Request body application/json · RequestBody** Every field is in the [parameter reference](https://docs.virginproxy.com/reference/#parameters). object **Answer 200 OK · RequestResponse** - `id`stringrequiredOur id for this request, e.g. `req_s0F0gEspheQI7zpoNzwU`. Quote it when you contact support. - `status`integerrequiredThe target's HTTP status. - `final_url`stringrequiredThe URL that produced the answer, after redirects. - `headers`objectrequiredThe target's response headers, names in lower case, each as one string. `set-cookie` is a list with one entry per cookie. - `cookies`list of objectEvery cookie the target set, also on the way through redirects, already parsed: `name`, `value`, `domain`, `path`, `secure`, `http_only`, and when present `expires`, `max_age` and `same_site`. - `redirects`list of objectThe redirects that were followed, in order, each as `{"url", "status"}`. Empty when there were none. - `url`string - `status`integer - `body`stringrequiredThe response body. Text for textual content types, otherwise base64. With `render`, the page as HTML after its scripts ran. - `body_encoding`stringrequired`"utf8"` or `"base64"`. Always check it before using `body`. `"utf8"` `"base64"` - `truncated`boolean`true` when the body was cut at your plan's size limit (2 to 25 MB) or by `max_credits`. - `browser`string | nullThe browser the request was sent as. - `http_version`string | nullThe HTTP version the target answered with, for example `HTTP/2.0`. - `attempts`integerHow many attempts it took: 1 without `retry`. - `rendered`booleanOnly with `render`: `true`. - `format`stringThe format that was applied: `raw` unless you asked for another one and the answer was HTML or a document. `"raw"` `"markdown"` `"text"` `"clean_html"` - `tokens`integerOnly with `format` `markdown`, `text` or `clean_html`: about how many tokens the body is (estimated, about 4 characters per token in Latin script) – to plan what fits into an AI prompt. - `document`objectOnly when the answer was a document (PDF, Word, Excel, PowerPoint, OpenDocument, CSV) and `format` converted it: `{"type", "pages", "truncated", "text"}`. `text` is `false` for a scanned PDF without a text layer. - `type`string `"pdf"` `"docx"` `"xlsx"` `"csv"` `"pptx"` `"odt"` - `pages`integer - `truncated`boolean - `text`boolean - `strategy`stringOnly with `"render": "auto"`: `"http"` or `"browser"`, and every try with its status, the reason for the second one and its credits. `"http"` `"browser"` - `strategy_attempts`list of objectOnly with `"render": "auto"`: `"http"` or `"browser"`, and every try with its status, the reason for the second one and its credits. - `strategy`string `"http"` `"browser"` - `status`integer | null - `error`string - `reason`string `"no_answer"` `"blocked_status"` `"challenge_page"` `"javascript_shell"` `"wait_for_missing"` `"nothing_extracted"` - `credits`integer - `redacted`objectOnly with `redact`: how many of each kind were blacked out, e.g. `{"email": 2}`. - `auto_extracted`object | nullOnly with `auto_extract`: `{"type", "data", "sources", "confidence"}`, or `null` when the page has no such record. - `type`string - `data`object - `sources`list of string - `confidence`number - `trace`list of objectOnly with `render.trace`: one entry per step and the end, each `{"step", "action", "at_ms", "url", "screenshot", "console"}` (JPEG as base64). - `step`integer | null - `action`string - `at_ms`integer - `url`string - `screenshot`stringJPEG as base64. - `console`list of object - `level`string - `text`string - `parsed`objectOnly with `parse`: the keys you asked for. - `extracted`objectOnly with `extract`: your fields. - `tag`stringOnly when you sent them: returned unchanged. - `echo`anyOnly when you sent them: returned unchanged. - `preset`stringOnly with `preset`: the preset that was applied. - `cached`trueOnly for an answer from the cache: `true`, when it was fetched and until when it is kept. `id` is the request that fetched it; `cost.credits` is 0. - `cached_at`stringOnly for an answer from the cache: `true`, when it was fetched and until when it is kept. `id` is the request that fetched it; `cost.credits` is 0. - `cache_expires_at`stringOnly for an answer from the cache: `true`, when it was fetched and until when it is kept. `id` is the request that fetched it; `cost.credits` is 0. - `change`objectOnly with `track_changes`: `{"status": "new"|"same"|"changed", "previous_request", "previous_at"}`, with `diff` also `{"added", "removed", "added_count", "removed_count", "truncated"}`. - `status`string `"new"` `"same"` `"changed"` `"unknown"` - `previous_request`string - `previous_at`string - `diff`object | null - `added`list of string - `removed`list of string - `added_count`integer - `removed_count`integer - `truncated`boolean - `screenshot`string | nullOnly with `render`: the visible part of the page as a base64 PNG when you asked for `screenshot`, otherwise `null`. - `duration_ms`integerrequiredTime from our network starting the request to the last byte, all attempts included. - `exit`objectrequired - `ip`string | nullThe public IP the target saw. - `country`stringISO country code of the exit IP. - `bytes`objectrequired - `up`integerBytes sent and received for the answer you got, including TLS and headers. That is why a 33-byte body shows about 4 kB. With `render`, everything the browser loaded for the page. - `down`integerBytes sent and received for the answer you got, including TLS and headers. That is why a 33-byte body shows about 4 kB. With `render`, everything the browser loaded for the page. - `cost`objectrequired - `credits`integerCredits charged for this request. - `credits_used`integerYour total for the period after this request, and what your plan includes. - `credits_included`integerYour total for the period after this request, and what your plan includes. - `screenshot_type`string | nullOnly with `render`: the image type of `screenshot` (image/png, image/jpeg or image/webp). - `pdf`stringOnly with `render.pdf`: the page as a base64 PDF. - `steps`list of objectOnly with `render.actions`: one entry per step, with its outcome (and `value` for `evaluate`). - `captured`list of objectOnly with `render.capture`: matching background requests of the page with their bodies. - `test`trueOnly with a test key (`vp_test_…`): a sample answer; nothing was fetched or charged. See [Test mode](https://docs.virginproxy.com/test-mode/). Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_url`](https://docs.virginproxy.com/errors/#e-invalid_url) [`invalid_method`](https://docs.virginproxy.com/errors/#e-invalid_method) [`invalid_headers`](https://docs.virginproxy.com/errors/#e-invalid_headers) [`invalid_params`](https://docs.virginproxy.com/errors/#e-invalid_params) [`invalid_browser`](https://docs.virginproxy.com/errors/#e-invalid_browser) [`invalid_locale`](https://docs.virginproxy.com/errors/#e-invalid_locale) [`invalid_cookies`](https://docs.virginproxy.com/errors/#e-invalid_cookies) [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large) [`invalid_session`](https://docs.virginproxy.com/errors/#e-invalid_session) [`invalid_retry`](https://docs.virginproxy.com/errors/#e-invalid_retry) [`invalid_render`](https://docs.virginproxy.com/errors/#e-invalid_render) [`invalid_format`](https://docs.virginproxy.com/errors/#e-invalid_format) [`invalid_parse`](https://docs.virginproxy.com/errors/#e-invalid_parse) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_extract`](https://docs.virginproxy.com/errors/#e-invalid_extract) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_options`](https://docs.virginproxy.com/errors/#e-invalid_options) [`invalid_timeout`](https://docs.virginproxy.com/errors/#e-invalid_timeout) [`invalid_idempotency_key`](https://docs.virginproxy.com/errors/#e-invalid_idempotency_key) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 402 [`credits_exhausted`](https://docs.virginproxy.com/errors/#e-credits_exhausted) [`key_limit_reached`](https://docs.virginproxy.com/errors/#e-key_limit_reached) [`daily_limit_reached`](https://docs.virginproxy.com/errors/#e-daily_limit_reached) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`email_not_verified`](https://docs.virginproxy.com/errors/#e-email_not_verified) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`target_not_allowed`](https://docs.virginproxy.com/errors/#e-target_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 409 [`idempotency_in_progress`](https://docs.virginproxy.com/errors/#e-idempotency_in_progress) [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) - 413 [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large-413) - 422 [`idempotency_key_reused`](https://docs.virginproxy.com/errors/#e-idempotency_key_reused) - 424 [`search_failed`](https://docs.virginproxy.com/errors/#e-search_failed) [`timeout`](https://docs.virginproxy.com/errors/#e-timeout) [`target_unreachable`](https://docs.virginproxy.com/errors/#e-target_unreachable) [`connection_failed`](https://docs.virginproxy.com/errors/#e-connection_failed) [`tls_error`](https://docs.virginproxy.com/errors/#e-tls_error) [`too_many_redirects`](https://docs.virginproxy.com/errors/#e-too_many_redirects) [`request_failed`](https://docs.virginproxy.com/errors/#e-request_failed) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [`concurrency_limited`](https://docs.virginproxy.com/errors/#e-concurrency_limited) - 500 [`internal_error`](https://docs.virginproxy.com/errors/#e-internal_error) - 503 [`busy`](https://docs.virginproxy.com/errors/#e-busy) [`render_unavailable`](https://docs.virginproxy.com/errors/#e-render_unavailable) [`rotation_failed`](https://docs.virginproxy.com/errors/#e-rotation_failed) [`executor_unavailable`](https://docs.virginproxy.com/errors/#e-executor_unavailable) [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) [How to use it](https://docs.virginproxy.com/requests/) ### GET /v1/raw The target's answer as it isPermissionrequests Like POST /v1/requests, but answers with the target's status, content type and body itself; our figures travel in `X-VP-*` headers. Headers for the target are sent as `X-VP-Header-`. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `url` required | query | string | Absolute http(s) URL. | | `session` | query | string | Session name. | | `fresh_ip` | query | string | New IP first (5 credits): true or false (also 1 or 0). | | `ip_version` | query | string | IP version. One of `4`, `6`, `auto`. | | `timeout_ms` | query | integer | Time limit of one attempt. | | `browser` | query | string | Browser profile. One of `chrome`, `chrome_mac`, `chrome_android`, `edge`, `firefox`, `safari`, `safari_ios`, `none`. | | `locale` | query | string | Visitor language. | | `follow_redirects` | query | string | true or false (also 1 or 0) | | `max_redirects` | query | integer | Redirects at most. 0 to 10. | | `cookie_jar` | query | string | true or false (also 1 or 0) | | `http_version` | query | string | HTTP version. One of `auto`, `1.1`. | | `insecure` | query | string | true or false (also 1 or 0) | | `format` | query | string | Convert an HTML answer. One of `raw`, `markdown`, `text`, `clean_html`. | | `main_content` | query | string | true or false (also 1 or 0) | | `tag` | query | string | Tag. | | `max_credits` | query | integer | Cost cap. 1 to 1000. | | `render` | query | string | Render in a browser: true or false (also 1 or 0). | | `timezone` | query | string | With render: IANA time zone. | | `wait_until` | query | string | With render. One of `load`, `domcontentloaded`, `networkidle`. | **Answer 200 The target's answer (any status from 200 to 599 is passed on; 1xx and others arrive as 502 with `X-VP-Status`).** `*/*` - `X-VP-Request-Id`header - `X-VP-Status`header - `X-VP-Credits`header - `X-VP-Bytes-Down`header - `X-VP-Final-URL`header Errors - 400 [`invalid_url`](https://docs.virginproxy.com/errors/#e-invalid_url) [`invalid_method`](https://docs.virginproxy.com/errors/#e-invalid_method) [`invalid_headers`](https://docs.virginproxy.com/errors/#e-invalid_headers) [`invalid_params`](https://docs.virginproxy.com/errors/#e-invalid_params) [`invalid_browser`](https://docs.virginproxy.com/errors/#e-invalid_browser) [`invalid_locale`](https://docs.virginproxy.com/errors/#e-invalid_locale) [`invalid_cookies`](https://docs.virginproxy.com/errors/#e-invalid_cookies) [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large) [`invalid_session`](https://docs.virginproxy.com/errors/#e-invalid_session) [`invalid_retry`](https://docs.virginproxy.com/errors/#e-invalid_retry) [`invalid_render`](https://docs.virginproxy.com/errors/#e-invalid_render) [`invalid_format`](https://docs.virginproxy.com/errors/#e-invalid_format) [`invalid_parse`](https://docs.virginproxy.com/errors/#e-invalid_parse) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_extract`](https://docs.virginproxy.com/errors/#e-invalid_extract) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_options`](https://docs.virginproxy.com/errors/#e-invalid_options) [`invalid_timeout`](https://docs.virginproxy.com/errors/#e-invalid_timeout) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 402 [`credits_exhausted`](https://docs.virginproxy.com/errors/#e-credits_exhausted) [`key_limit_reached`](https://docs.virginproxy.com/errors/#e-key_limit_reached) [`daily_limit_reached`](https://docs.virginproxy.com/errors/#e-daily_limit_reached) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`email_not_verified`](https://docs.virginproxy.com/errors/#e-email_not_verified) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`target_not_allowed`](https://docs.virginproxy.com/errors/#e-target_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 413 [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large-413) - 424 [`search_failed`](https://docs.virginproxy.com/errors/#e-search_failed) [`timeout`](https://docs.virginproxy.com/errors/#e-timeout) [`target_unreachable`](https://docs.virginproxy.com/errors/#e-target_unreachable) [`connection_failed`](https://docs.virginproxy.com/errors/#e-connection_failed) [`tls_error`](https://docs.virginproxy.com/errors/#e-tls_error) [`too_many_redirects`](https://docs.virginproxy.com/errors/#e-too_many_redirects) [`request_failed`](https://docs.virginproxy.com/errors/#e-request_failed) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [`concurrency_limited`](https://docs.virginproxy.com/errors/#e-concurrency_limited) - 500 [`internal_error`](https://docs.virginproxy.com/errors/#e-internal_error) - 503 [`busy`](https://docs.virginproxy.com/errors/#e-busy) [`render_unavailable`](https://docs.virginproxy.com/errors/#e-render_unavailable) [`rotation_failed`](https://docs.virginproxy.com/errors/#e-rotation_failed) [`executor_unavailable`](https://docs.virginproxy.com/errors/#e-executor_unavailable) [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) [How to use it](https://docs.virginproxy.com/raw/) ### GET /v1/screenshot Screenshot as an imagePermissionrequests Loads the page in a browser and answers with the picture itself (PNG, JPEG or WebP). Costs like a rendered request: 10 credits for up to 1 MB loaded, 1 more per further MB. Images and fonts are loaded (unlike `render` in POST /v1/requests). The target's status is in `X-VP-Status`. Unknown options are refused. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `url` required | query | string | Absolute http(s) URL. | | `full_page` | query | string | The whole page: true or false (also 1 or 0). | | `selector` | query | string | CSS selector of one element instead. | | `format` | query | string | Image type. One of `png`, `jpeg`, `webp`. Default `"png"`. | | `quality` | query | integer | JPEG/WebP quality (default 80). 1 to 100. | | `width` | query | integer | Viewport width in CSS pixels (default 1366 when height or scale is given, otherwise the browser's own size). 240 to 3840. | | `height` | query | integer | Viewport height. 240 to 4320. | | `scale` | query | number | Pixel density (default 1 when width or height is given). 0.5 to 4. | | `wait_until` | query | string | When the page counts as loaded. One of `load`, `domcontentloaded`, `networkidle`. | | `wait_for` | query | string | CSS selector to wait for. | | `wait_ms` | query | integer | Extra wait at the end. 0 to 15000. | | `scroll` | query | integer | Scroll to the bottom this many times first. 0 to 20. | | `browser` | query | string | Browser profile (default chrome, a desktop browser). One of `chrome`, `chrome_mac`, `chrome_android`, `edge`, `firefox`, `safari`, `safari_ios`, `none`. | | `locale` | query | string | Visitor language. | | `timezone` | query | string | IANA time zone. | | `color_scheme` | query | string | prefers-color-scheme. One of `light`, `dark`. | | `block` | query | string | Comma-separated resource types not to load: image, media, font, stylesheet (default none). | | `session` | query | string | Session name. | | `fresh_ip` | query | string | true or false (also 1 or 0) | | `max_credits` | query | integer | Cost cap. 10 to 1000. | | `tag` | query | string | Tag. | **Answer 200 The image.** `image/png`, `image/jpeg`, `image/webp` - `X-VP-Request-Id`header - `X-VP-Credits`header - `X-VP-Status`header - `X-VP-Final-URL`header Errors - 400 [`invalid_url`](https://docs.virginproxy.com/errors/#e-invalid_url) [`invalid_method`](https://docs.virginproxy.com/errors/#e-invalid_method) [`invalid_headers`](https://docs.virginproxy.com/errors/#e-invalid_headers) [`invalid_params`](https://docs.virginproxy.com/errors/#e-invalid_params) [`invalid_browser`](https://docs.virginproxy.com/errors/#e-invalid_browser) [`invalid_locale`](https://docs.virginproxy.com/errors/#e-invalid_locale) [`invalid_cookies`](https://docs.virginproxy.com/errors/#e-invalid_cookies) [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large) [`invalid_session`](https://docs.virginproxy.com/errors/#e-invalid_session) [`invalid_retry`](https://docs.virginproxy.com/errors/#e-invalid_retry) [`invalid_render`](https://docs.virginproxy.com/errors/#e-invalid_render) [`invalid_format`](https://docs.virginproxy.com/errors/#e-invalid_format) [`invalid_parse`](https://docs.virginproxy.com/errors/#e-invalid_parse) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_extract`](https://docs.virginproxy.com/errors/#e-invalid_extract) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_options`](https://docs.virginproxy.com/errors/#e-invalid_options) [`invalid_timeout`](https://docs.virginproxy.com/errors/#e-invalid_timeout) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 402 [`credits_exhausted`](https://docs.virginproxy.com/errors/#e-credits_exhausted) [`key_limit_reached`](https://docs.virginproxy.com/errors/#e-key_limit_reached) [`daily_limit_reached`](https://docs.virginproxy.com/errors/#e-daily_limit_reached) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`email_not_verified`](https://docs.virginproxy.com/errors/#e-email_not_verified) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`target_not_allowed`](https://docs.virginproxy.com/errors/#e-target_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 413 [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large-413) - 422 [`screenshot_failed`](https://docs.virginproxy.com/errors/#e-screenshot_failed) - 424 [`search_failed`](https://docs.virginproxy.com/errors/#e-search_failed) [`timeout`](https://docs.virginproxy.com/errors/#e-timeout) [`target_unreachable`](https://docs.virginproxy.com/errors/#e-target_unreachable) [`connection_failed`](https://docs.virginproxy.com/errors/#e-connection_failed) [`tls_error`](https://docs.virginproxy.com/errors/#e-tls_error) [`too_many_redirects`](https://docs.virginproxy.com/errors/#e-too_many_redirects) [`request_failed`](https://docs.virginproxy.com/errors/#e-request_failed) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [`concurrency_limited`](https://docs.virginproxy.com/errors/#e-concurrency_limited) - 500 [`internal_error`](https://docs.virginproxy.com/errors/#e-internal_error) - 503 [`busy`](https://docs.virginproxy.com/errors/#e-busy) [`render_unavailable`](https://docs.virginproxy.com/errors/#e-render_unavailable) [`rotation_failed`](https://docs.virginproxy.com/errors/#e-rotation_failed) [`executor_unavailable`](https://docs.virginproxy.com/errors/#e-executor_unavailable) [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) [How to use it](https://docs.virginproxy.com/screenshot/) ### POST /v1/estimate What a request may cost, without running itPermissionrequests or read Checks a request body exactly like POST /v1/requests (or a job body with `requests`) and returns the least and the most it can cost with your plan. Runs nothing and charges nothing. Up to 120 per minute. **Request body application/json** - `url`stringrequiredAbsolute `http` or `https` URL, up to 8,000 characters. Credentials inside the URL are rejected. - `method`string`GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD` or `OPTIONS`. With `render` only `GET`. `"GET"` `"POST"` `"PUT"` `"PATCH"` `"DELETE"` `"HEAD"` `"OPTIONS"` - `params`objectQuery parameters added to the URL. Values are strings, numbers, booleans or lists of them. At most 500 values. - `browser`stringWhich browser the request looks like: `chrome`, `chrome_mac`, `chrome_android`, `edge`, `firefox`, `safari`, `safari_ios` or `none`. With `render` the default is `chrome_android`. `"chrome"` `"chrome_mac"` `"chrome_android"` `"edge"` `"firefox"` `"safari"` `"safari_ios"` `"none"` - `locale`stringLanguage of the visitor. Sets `Accept-Language`, and the browser language when rendering. - `headers`objectHeaders for the target, at most 100. They replace the browser's headers of the same name; an empty value leaves that header out. - `cookies`object | list of object`{"name": "value"}` or a list of `{"name", "value", "domain"?, "path"?}`. At most 200. - `cookie_jar`booleanOnly with `session`: remember cookies the site sets for the next requests of the session. - `json`anyBody sent as JSON. Sets `Content-Type: application/json` unless you send your own. - `form`objectBody sent as an HTML form (`application/x-www-form-urlencoded`). - `body`stringBody sent exactly as given, up to 5 MB. Set your own `Content-Type`. - `body_encoding`string`"base64"` when `body` is base64-encoded binary data. `"utf8"` `"base64"` - `session`stringA name of your choice. Requests with the same name leave through the same IP for up to 10 minutes and share their cookies. - `fresh_ip`booleanGet a new IP address before the request. 5 extra credits. Not with `session`. - `ip_version`string`"4"`, `"6"` or `"auto"`. `"4"` `"6"` `"auto"` - `follow_redirects`booleanFollow redirects. `false` returns the redirect response itself. - `max_redirects`integer0 to 10. More redirects end with `too_many_redirects`. - `timeout_ms`integerHow long one attempt may take, at least 1000, at most your plan's timeout (30 to 120 seconds). - `retry`objectTry again before answering when the target refuses or fails. `{}` uses all defaults. - `times`integerHow many more attempts at most: 0 to 3. - `on`list of integer | stringStatuses 300–599 and the errors `timeout`, `connection_failed`, `target_unreachable`, `tls_error`, `text_match`, `selector_missing`. At most 20. - `fresh_ip`booleanA new IP before each further attempt (5 credits each). - `if_text`list of anyUp to 10 texts (each up to 200 characters, case ignored). An answer whose body contains one of them is tried again. - `if_missing`stringA CSS selector. An HTML answer in which it finds nothing is tried again. - `render`boolean | object | "auto"Load the page in a real browser and return it after its scripts ran. 9 extra credits. `"auto"`: first without a browser, with it only when the page needs it – the browser part is charged only then. - `render_options`objectOnly with `"render": "auto"`: the browser settings for the second try (the options of `render`, without screenshot, PDF, steps, capture). - `format`string`raw`, `markdown`, `text` or `clean_html`. Converts an HTML answer before it is returned. `"raw"` `"markdown"` `"text"` `"clean_html"` - `main_content`booleanKeep only the main content of the page (without navigation, header, footer, sidebars and forms) before converting. - `format_options`objectWith `format`: `include_selector` (keep only this part), `exclude_selector` (leave this out), `images` and `links` (`false` drops them), `max_pages` (documents, 1–500, default 100). - `redact`list of string | trueBlack out personal data in the text you get: `email`, `phone`, `iban`, `card`, `ip`; `true` for all. Counted in `redacted`. - `auto_extract`stringRead a standard record without selectors: `product`, `article`, `job`, `review_list`, `recipe`, `event`, `organization`. Result in `auto_extracted`. `"product"` `"article"` `"job"` `"review_list"` `"recipe"` `"event"` `"organization"` - `parse`list of string | trueStandard records `product`, `article`, `organization`, `breadcrumbs` come from the page's structured data. Read out `metadata`, `links`, `images`, `headings`, `emails`, `phones`, `tables`, `json_ld`; `true` for all. Result in `parsed`. - `extract`objectUp to 50 named fields read from the answer with CSS, XPath or JSON paths. Result in `extracted`. - `http_version`string`"auto"` or `"1.1"`. Only without `render`. `"auto"` `"1.1"` - `insecure`booleanAccept invalid TLS certificates of the target. - `max_credits`integer1 to 1,000. The request never costs more; the answer is cut to fit. - `tag`string1 to 64 characters `A–Z a–z 0–9 _ . : / -`. Stored with the request, returned in the answer, filterable. - `echo`anyUp to 2 KB of your own data, returned unchanged as `echo`. Useful to match results to your records. - `cache`true | objectKeep the answer and give it again to the same request within `max_age_s` (60 to 604,800 seconds; `true` = one hour): free, at once, marked `"cached": true`. Off unless you send it. - `track_changes`true | objectCompare with your last request of the same page: `change.status` is `new`, `same` or `changed`. `{"on": "extracted"}` compares what was read, `{"diff": true}` names the changed lines. - `preset`stringUse the options saved under this name (`POST /v1/presets`); options you send win. **Answer 200 OK · Estimate** - `credits`object - `min`integerWhen the target answers with up to 1 MB. - `max`integerThe most the request may cost (size limit, browser traffic, retries with a new IP). - `parts`object - `factor`numberCredit factor of the target (1 for most). - `max_response_bytes`integer - `requests`integerOnly for a job body. - `items`list of object - `credits_remaining`integer - `fits`booleanWhether the worst case fits into the credits left (otherwise the request runs with a cost cap of what is left). - `charged`false Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_url`](https://docs.virginproxy.com/errors/#e-invalid_url) [`invalid_method`](https://docs.virginproxy.com/errors/#e-invalid_method) [`invalid_headers`](https://docs.virginproxy.com/errors/#e-invalid_headers) [`invalid_params`](https://docs.virginproxy.com/errors/#e-invalid_params) [`invalid_browser`](https://docs.virginproxy.com/errors/#e-invalid_browser) [`invalid_locale`](https://docs.virginproxy.com/errors/#e-invalid_locale) [`invalid_cookies`](https://docs.virginproxy.com/errors/#e-invalid_cookies) [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large) [`invalid_session`](https://docs.virginproxy.com/errors/#e-invalid_session) [`invalid_retry`](https://docs.virginproxy.com/errors/#e-invalid_retry) [`invalid_render`](https://docs.virginproxy.com/errors/#e-invalid_render) [`invalid_format`](https://docs.virginproxy.com/errors/#e-invalid_format) [`invalid_parse`](https://docs.virginproxy.com/errors/#e-invalid_parse) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_extract`](https://docs.virginproxy.com/errors/#e-invalid_extract) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_options`](https://docs.virginproxy.com/errors/#e-invalid_options) [`invalid_timeout`](https://docs.virginproxy.com/errors/#e-invalid_timeout) [`invalid_job`](https://docs.virginproxy.com/errors/#e-invalid_job) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`target_not_allowed`](https://docs.virginproxy.com/errors/#e-target_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/billing/#estimate-api) ### GET /v1/pdf The page as a PDF documentPermissionrequests Loads the page in a browser and answers with a PDF of it. Costs like a rendered request: 10 credits for up to 1 MB loaded, 1 more per further MB. Images and fonts are loaded. The target's status is in `X-VP-Status`. Unknown options are refused. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `url` required | query | string | Absolute http(s) URL. | | `wait_until` | query | string | When the page counts as loaded. One of `load`, `domcontentloaded`, `networkidle`. | | `wait_for` | query | string | CSS selector to wait for. | | `wait_ms` | query | integer | Extra wait at the end. 0 to 15000. | | `scroll` | query | integer | Scroll to the bottom this many times first (loads lazy content). 0 to 20. | | `browser` | query | string | Browser profile (default chrome, a desktop browser). One of `chrome`, `chrome_mac`, `chrome_android`, `edge`, `firefox`, `safari`, `safari_ios`, `none`. | | `locale` | query | string | Visitor language. | | `timezone` | query | string | IANA time zone. | | `color_scheme` | query | string | prefers-color-scheme. One of `light`, `dark`. | | `block` | query | string | Comma-separated resource types not to load: image, media, font, stylesheet (default none). | | `session` | query | string | Session name. | | `fresh_ip` | query | string | true or false (also 1 or 0) | | `max_credits` | query | integer | Cost cap. 10 to 1000. | | `tag` | query | string | Tag. | **Answer 200 The PDF.** `application/pdf` - `X-VP-Request-Id`header - `X-VP-Credits`header - `X-VP-Status`header - `X-VP-Final-URL`header Errors - 400 [`invalid_url`](https://docs.virginproxy.com/errors/#e-invalid_url) [`invalid_method`](https://docs.virginproxy.com/errors/#e-invalid_method) [`invalid_headers`](https://docs.virginproxy.com/errors/#e-invalid_headers) [`invalid_params`](https://docs.virginproxy.com/errors/#e-invalid_params) [`invalid_browser`](https://docs.virginproxy.com/errors/#e-invalid_browser) [`invalid_locale`](https://docs.virginproxy.com/errors/#e-invalid_locale) [`invalid_cookies`](https://docs.virginproxy.com/errors/#e-invalid_cookies) [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large) [`invalid_session`](https://docs.virginproxy.com/errors/#e-invalid_session) [`invalid_retry`](https://docs.virginproxy.com/errors/#e-invalid_retry) [`invalid_render`](https://docs.virginproxy.com/errors/#e-invalid_render) [`invalid_format`](https://docs.virginproxy.com/errors/#e-invalid_format) [`invalid_parse`](https://docs.virginproxy.com/errors/#e-invalid_parse) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_extract`](https://docs.virginproxy.com/errors/#e-invalid_extract) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_options`](https://docs.virginproxy.com/errors/#e-invalid_options) [`invalid_timeout`](https://docs.virginproxy.com/errors/#e-invalid_timeout) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 402 [`credits_exhausted`](https://docs.virginproxy.com/errors/#e-credits_exhausted) [`key_limit_reached`](https://docs.virginproxy.com/errors/#e-key_limit_reached) [`daily_limit_reached`](https://docs.virginproxy.com/errors/#e-daily_limit_reached) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`email_not_verified`](https://docs.virginproxy.com/errors/#e-email_not_verified) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`target_not_allowed`](https://docs.virginproxy.com/errors/#e-target_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 413 [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large-413) - 422 [`pdf_failed`](https://docs.virginproxy.com/errors/#e-pdf_failed) - 424 [`search_failed`](https://docs.virginproxy.com/errors/#e-search_failed) [`timeout`](https://docs.virginproxy.com/errors/#e-timeout) [`target_unreachable`](https://docs.virginproxy.com/errors/#e-target_unreachable) [`connection_failed`](https://docs.virginproxy.com/errors/#e-connection_failed) [`tls_error`](https://docs.virginproxy.com/errors/#e-tls_error) [`too_many_redirects`](https://docs.virginproxy.com/errors/#e-too_many_redirects) [`request_failed`](https://docs.virginproxy.com/errors/#e-request_failed) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [`concurrency_limited`](https://docs.virginproxy.com/errors/#e-concurrency_limited) - 500 [`internal_error`](https://docs.virginproxy.com/errors/#e-internal_error) - 503 [`busy`](https://docs.virginproxy.com/errors/#e-busy) [`render_unavailable`](https://docs.virginproxy.com/errors/#e-render_unavailable) [`rotation_failed`](https://docs.virginproxy.com/errors/#e-rotation_failed) [`executor_unavailable`](https://docs.virginproxy.com/errors/#e-executor_unavailable) [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) [How to use it](https://docs.virginproxy.com/screenshot/#pdf) ### POST /v1/batch A few requests in one call, answered togetherPermissionrequests 1 to your plan's batch limit (free 3, starter 10, growth 20, scale 25) requests, run at the same time up to your plan's parallel limit and answered together within about 85 seconds. Each request is an ordinary request (same checks, charges and request log); one that fails does not stop the others. Send `requests` (full request bodies) or `urls` with the options for every URL in `request`. A request that could not start in time, or would exceed the batch's `max_credits`, is skipped and not charged (`batch_item_skipped`). No Idempotency-Key: for more requests, more time or kept results use POST /v1/jobs. **Request body application/json · BatchRequest** - `requests`list of objectRequest bodies, as for POST /v1/requests. Either this or `urls`.[every field in the parameter reference](https://docs.virginproxy.com/reference/#parameters) - `urls`list of stringAddresses; each is sent with the options in `request`. Either this or `requests`. - `request`objectWith `urls`: the options for every URL, as for POST /v1/requests without `url`. - `max_credits`integerBound for all requests of the batch together. A request that would exceed what is left is skipped (not charged). - `tag`stringTag for requests without their own. **Answer 200 OK · BatchResponse** - `requests`integer - `succeeded`integer - `failed`integer - `skipped`integer - `items`list of objectOne entry per request, in the order sent. - `index`integer - `status`string `"succeeded"` `"failed"` `"skipped"` - `response`object[the answer of POST /v1/requests](https://docs.virginproxy.com/endpoints/#op-createRequest) - `request_id`string | nullFor a failed request that was run. - `error`object - `code`string - `message`string - `charged`boolean - `credits`integer - `cost`object - `credits`integerAll requests of the batch together. - `credits_used`integer - `credits_included`integer - `duration_ms`integer - `tag`string - `test`true Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_url`](https://docs.virginproxy.com/errors/#e-invalid_url) [`invalid_method`](https://docs.virginproxy.com/errors/#e-invalid_method) [`invalid_headers`](https://docs.virginproxy.com/errors/#e-invalid_headers) [`invalid_params`](https://docs.virginproxy.com/errors/#e-invalid_params) [`invalid_browser`](https://docs.virginproxy.com/errors/#e-invalid_browser) [`invalid_locale`](https://docs.virginproxy.com/errors/#e-invalid_locale) [`invalid_cookies`](https://docs.virginproxy.com/errors/#e-invalid_cookies) [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large) [`invalid_session`](https://docs.virginproxy.com/errors/#e-invalid_session) [`invalid_retry`](https://docs.virginproxy.com/errors/#e-invalid_retry) [`invalid_render`](https://docs.virginproxy.com/errors/#e-invalid_render) [`invalid_format`](https://docs.virginproxy.com/errors/#e-invalid_format) [`invalid_parse`](https://docs.virginproxy.com/errors/#e-invalid_parse) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_extract`](https://docs.virginproxy.com/errors/#e-invalid_extract) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_options`](https://docs.virginproxy.com/errors/#e-invalid_options) [`invalid_timeout`](https://docs.virginproxy.com/errors/#e-invalid_timeout) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`invalid_batch`](https://docs.virginproxy.com/errors/#e-invalid_batch) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 402 [`credits_exhausted`](https://docs.virginproxy.com/errors/#e-credits_exhausted) [`key_limit_reached`](https://docs.virginproxy.com/errors/#e-key_limit_reached) [`daily_limit_reached`](https://docs.virginproxy.com/errors/#e-daily_limit_reached) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`email_not_verified`](https://docs.virginproxy.com/errors/#e-email_not_verified) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`target_not_allowed`](https://docs.virginproxy.com/errors/#e-target_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 413 [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large-413) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [`concurrency_limited`](https://docs.virginproxy.com/errors/#e-concurrency_limited) - 503 [`busy`](https://docs.virginproxy.com/errors/#e-busy) [`render_unavailable`](https://docs.virginproxy.com/errors/#e-render_unavailable) [`rotation_failed`](https://docs.virginproxy.com/errors/#e-rotation_failed) [`executor_unavailable`](https://docs.virginproxy.com/errors/#e-executor_unavailable) [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) [How to use it](https://docs.virginproxy.com/jobs/#batch) ## Discovery Find the addresses of a site. ### POST /v1/map The addresses of a websitePermissionrequests Reads the page's links and the site's sitemaps (from robots.txt, otherwise /sitemap.xml; sitemap indexes and .gz files included) and returns the addresses of the same site, each once. Every page and file read is an ordinary request in your log: usually 1 credit each; at most the page, robots.txt and 5 sitemap files of up to 10 credits each. `max_credits` bounds the whole call. **Request body application/json · MapRequest** - `url`stringrequiredA page of the site, usually its home page. - `sitemap`stringAlso read the sitemaps, skip them, or read only them. `"include"` `"skip"` `"only"` - `include_subdomains`boolean - `search`stringKeep only addresses (or link texts) containing this text, case ignored. - `limit`integer - `render`booleanLoad the page in a browser first (10 credits or more). - `robots`string`respect` leaves out addresses robots.txt disallows, `report` marks them with `disallowed: true`. `"ignore"` `"respect"` `"report"` - `browser`string `"chrome"` `"chrome_mac"` `"chrome_android"` `"edge"` `"firefox"` `"safari"` `"safari_ios"` `"none"` - `locale`string - `session`string - `max_credits`integerBound for all reads of this call together. - `tag`string **Answer 200 OK · MapResponse** - `url`string - `host`stringThe host after redirects. - `links`list of object - `url`string - `text`stringLink text (page links only). - `source`string `"page"` `"sitemap"` - `disallowed`trueWith `robots: report`: robots.txt disallows it. - `robots`objectOnly with `robots`. - `mode`string - `read`boolean - `stopped`string - `total`integerAddresses found (after search), before limit. - `truncated`boolean - `sitemaps`object - `read`integer - `stopped`stringWhy reading sitemaps stopped early, if it did. - `requests`list of objectEvery read of this call; each is in your request log. - `id`string - `url`string - `status`integer | null - `error`string - `credits`integer - `cost`object - `credits`integerSum of all reads. - `credits_used`integer | null - `credits_included`integer - `tag`string Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_url`](https://docs.virginproxy.com/errors/#e-invalid_url) [`invalid_method`](https://docs.virginproxy.com/errors/#e-invalid_method) [`invalid_headers`](https://docs.virginproxy.com/errors/#e-invalid_headers) [`invalid_params`](https://docs.virginproxy.com/errors/#e-invalid_params) [`invalid_browser`](https://docs.virginproxy.com/errors/#e-invalid_browser) [`invalid_locale`](https://docs.virginproxy.com/errors/#e-invalid_locale) [`invalid_cookies`](https://docs.virginproxy.com/errors/#e-invalid_cookies) [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large) [`invalid_session`](https://docs.virginproxy.com/errors/#e-invalid_session) [`invalid_retry`](https://docs.virginproxy.com/errors/#e-invalid_retry) [`invalid_render`](https://docs.virginproxy.com/errors/#e-invalid_render) [`invalid_format`](https://docs.virginproxy.com/errors/#e-invalid_format) [`invalid_parse`](https://docs.virginproxy.com/errors/#e-invalid_parse) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_extract`](https://docs.virginproxy.com/errors/#e-invalid_extract) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_options`](https://docs.virginproxy.com/errors/#e-invalid_options) [`invalid_timeout`](https://docs.virginproxy.com/errors/#e-invalid_timeout) [`invalid_map`](https://docs.virginproxy.com/errors/#e-invalid_map) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 402 [`credits_exhausted`](https://docs.virginproxy.com/errors/#e-credits_exhausted) [`key_limit_reached`](https://docs.virginproxy.com/errors/#e-key_limit_reached) [`daily_limit_reached`](https://docs.virginproxy.com/errors/#e-daily_limit_reached) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`email_not_verified`](https://docs.virginproxy.com/errors/#e-email_not_verified) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`target_not_allowed`](https://docs.virginproxy.com/errors/#e-target_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 413 [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large-413) - 424 [`search_failed`](https://docs.virginproxy.com/errors/#e-search_failed) [`timeout`](https://docs.virginproxy.com/errors/#e-timeout) [`target_unreachable`](https://docs.virginproxy.com/errors/#e-target_unreachable) [`connection_failed`](https://docs.virginproxy.com/errors/#e-connection_failed) [`tls_error`](https://docs.virginproxy.com/errors/#e-tls_error) [`too_many_redirects`](https://docs.virginproxy.com/errors/#e-too_many_redirects) [`request_failed`](https://docs.virginproxy.com/errors/#e-request_failed) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [`concurrency_limited`](https://docs.virginproxy.com/errors/#e-concurrency_limited) - 500 [`internal_error`](https://docs.virginproxy.com/errors/#e-internal_error) - 503 [`busy`](https://docs.virginproxy.com/errors/#e-busy) [`render_unavailable`](https://docs.virginproxy.com/errors/#e-render_unavailable) [`rotation_failed`](https://docs.virginproxy.com/errors/#e-rotation_failed) [`executor_unavailable`](https://docs.virginproxy.com/errors/#e-executor_unavailable) [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) [How to use it](https://docs.virginproxy.com/map/) ### POST /v1/search Search the web and get the results as JSONPermissionrequests Searches DuckDuckGo and returns the results (position, title, address, snippet), and where the engine shows them ads, related searches and questions. `include_domains` and `exclude_domains` filter the results; `scrape` also fetches every result page with the options you give (for example Markdown of the main content). Each result page of the engine and each fetched result is an ordinary request in your log (usually 1 credit each); up to 5 result pages are read to reach `limit`. `max_credits` bounds the whole call. **Request body application/json · SearchRequest** - `query`stringrequiredThe search text; operators of the engine (quotes, site:, -word) work. - `engine`string `"duckduckgo"` - `limit`integer - `language`stringLanguage of the results, e.g. `en`, `de` or `pt-BR`. - `country`stringThe country the results are for (a search setting of the engine, not the address the request comes from). - `time_range`stringOnly results from this period. `"day"` `"week"` `"month"` `"year"` - `include_domains`list of string - `exclude_domains`list of string - `scrape`boolean | object`true`: fetch every result as Markdown of its main content; an object: with these options. - `max_credits`integerBound for the whole call, fetched results included. - `tag`string **Answer 200 OK · SearchResponse** - `query`string - `engine`string `"duckduckgo"` - `results`list of object - `position`integer - `title`string - `url`string - `display_url`stringThe address as the engine shows it, when it does. - `snippet`string - `date`string - `page`objectOnly with `scrape`: the fetched page (`body`, `body_encoding`, `format`, `tokens`, `status`, `final_url`, `extracted`, `parsed`, `auto_extracted`, `credits`), or `error` with its code. - `ads`list of object - `related`list of string - `questions`list of string - `credits`integerSum of all requests of this call. - `requests`list of stringIds of every request of this call; each is in your request log. - `tag`string - `test`true Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 402 See the errors page. - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 413 See the errors page. - 424 [`search_failed`](https://docs.virginproxy.com/errors/#e-search_failed) [`timeout`](https://docs.virginproxy.com/errors/#e-timeout) [`target_unreachable`](https://docs.virginproxy.com/errors/#e-target_unreachable) [`connection_failed`](https://docs.virginproxy.com/errors/#e-connection_failed) [`tls_error`](https://docs.virginproxy.com/errors/#e-tls_error) [`too_many_redirects`](https://docs.virginproxy.com/errors/#e-too_many_redirects) [`request_failed`](https://docs.virginproxy.com/errors/#e-request_failed) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) - 500 [`internal_error`](https://docs.virginproxy.com/errors/#e-internal_error) - 503 [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) ## Jobs Many requests and crawls in the background. ### POST /v1/crawl Crawl a website in the backgroundPermissionrequests Starts a job that reads the start page and follows links of the same site, breadth first, up to `max_depth` links away and `max_pages` pages (your plan's crawl limit: 10, 100, 500, 1000). Each page is an ordinary request with the options in `request`. Progress, results (24 hours), cancel and webhooks work as for every job. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `Idempotency-Key` | header | string | The same key within 24 hours returns the same crawl instead of starting a second one. | **Request body application/json · CrawlRequest** - `url`stringrequiredThe start page. - `max_pages`integerPages at most; up to your plan's crawl limit (free 10, starter 100, growth 500, scale 1000). Default 100 or the plan limit if lower. - `only_changed`booleanOnly pages that changed since they were last read (best in a schedule): unchanged pages are left out of results, exports, the stream, deliveries and item webhooks. Each page is still read and charged. - `delivery`objectAs for jobs: write the results into your own storage when the crawl ends. - `max_depth`integerLinks away from the start page (0 = only the start page). - `include_paths`list of stringFollow only paths matching one of these patterns (`*` = any characters except `/`, `` = anything), e.g. `/blog/`. - `exclude_paths`list of stringNever follow paths matching one of these patterns. - `include_subdomains`booleanAlso follow links to subdomains of the start host. - `ignore_query`booleanTreat addresses that differ only in the query string as the same page. - `request`objectOptions for every page, as for POST /v1/requests, without url, method and body. Links are read for the crawl in any case; they are in `parsed.links` only if you ask for them. - `webhook`object`{"url", "events"}`: where to send the results. - `url`stringA public `https://` address. - `events`list of string`item` (each finished request), `item.succeeded`, `item.failed`, `item.changed` (only pages that changed, with `track_changes`) and/or `done` (the whole job). - `include_body`boolean`false`: item events carry the figures and `id`, not the page – fetch it from the results. - `metadata`objectUp to 1 KB of your own data, sent back in every webhook call of the job. - `tag`string - `max_credits`integerCost cap of the whole crawl: once it has used that many credits, pages not started end as `job_budget_reached`. - `robots`string`respect`: pages the site's robots.txt disallows are not read (reading robots.txt costs 1 credit). `"ignore"` `"respect"` **Answer 200 Replayed: the crawl started earlier with the same Idempotency-Key. · Job** - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean **Answer 202 The crawl was accepted. · Job** - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_idempotency_key`](https://docs.virginproxy.com/errors/#e-invalid_idempotency_key) [`invalid_crawl`](https://docs.virginproxy.com/errors/#e-invalid_crawl) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`invalid_webhook`](https://docs.virginproxy.com/errors/#e-invalid_webhook) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [`too_many_jobs`](https://docs.virginproxy.com/errors/#e-too_many_jobs) [How to use it](https://docs.virginproxy.com/crawl/) ### GET /v1/jobs Your jobs, newest firstPermissionrequests or read | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `limit` | query | integer | Jobs per page. Default `20`. 1 to 100. | | `before` | query | string | Continue after this job id. | **Answer 200 OK** - `items`list of object - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean - `next`string | null Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) [How to use it](https://docs.virginproxy.com/jobs/#list) ### POST /v1/jobs Many requests in the backgroundPermissionrequests 1 to your plan's limit (10, 1,000, 10,000, 50,000) requests per job, at most 20 open jobs. Results are kept 24 hours after the job ended. A long list can be sent as NDJSON (`Content-Type: application/x-ndjson`, up to 32 MB): one request per line, and an optional first line `{"job": {…}}` with the job's own options (webhook, tag, max_credits, delivery). | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `Idempotency-Key` | header | string | The same key within 24 hours returns the same job instead of creating a second one. | **Request body application/json · JobRequest** - `requests`list of objectThe requests of the job: 1 to your plan's limit (10, 100, 500 or 1,000). Each is a request body as for `POST /v1/requests`.[every field in the parameter reference](https://docs.virginproxy.com/reference/#parameters) - `request`objectA single request instead of `requests`.[every field in the parameter reference](https://docs.virginproxy.com/reference/#parameters) - `urls`list of anyAddresses instead of `requests`; each is sent with the options in `defaults`. - `defaults`objectWith `urls`: the options for every address (as for `POST /v1/requests`, without `url`). - `max_credits`integerCost cap of the whole job: once it used that many credits, requests not started end as `job_budget_reached`. - `webhook`object`{"url", "events"}`: where to send the results. - `url`stringA public `https://` address. - `events`list of string`item` (each finished request), `item.succeeded`, `item.failed`, `item.changed` (only pages that changed, with `track_changes`) and/or `done` (the whole job). - `include_body`boolean`false`: item events carry the figures and `id`, not the page – fetch it from the results. - `metadata`objectUp to 1 KB of your own data, sent back in every webhook call of the job. - `delivery`objectWrite the results into your own storage when the job ends: `{"destination": "dst_…", "format": "ndjson"|"json"|"csv", "path": "{date}/{job_id}.ndjson"}`. - `tag`stringTag for the job; requests without their own tag get it. **Answer 200 Replayed: the job created earlier with the same Idempotency-Key. · Job** - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean **Answer 202 The job was accepted. · Job** - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_url`](https://docs.virginproxy.com/errors/#e-invalid_url) [`invalid_method`](https://docs.virginproxy.com/errors/#e-invalid_method) [`invalid_headers`](https://docs.virginproxy.com/errors/#e-invalid_headers) [`invalid_params`](https://docs.virginproxy.com/errors/#e-invalid_params) [`invalid_browser`](https://docs.virginproxy.com/errors/#e-invalid_browser) [`invalid_locale`](https://docs.virginproxy.com/errors/#e-invalid_locale) [`invalid_cookies`](https://docs.virginproxy.com/errors/#e-invalid_cookies) [`body_too_large`](https://docs.virginproxy.com/errors/#e-body_too_large) [`invalid_session`](https://docs.virginproxy.com/errors/#e-invalid_session) [`invalid_retry`](https://docs.virginproxy.com/errors/#e-invalid_retry) [`invalid_render`](https://docs.virginproxy.com/errors/#e-invalid_render) [`invalid_format`](https://docs.virginproxy.com/errors/#e-invalid_format) [`invalid_parse`](https://docs.virginproxy.com/errors/#e-invalid_parse) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_extract`](https://docs.virginproxy.com/errors/#e-invalid_extract) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_options`](https://docs.virginproxy.com/errors/#e-invalid_options) [`invalid_timeout`](https://docs.virginproxy.com/errors/#e-invalid_timeout) [`invalid_idempotency_key`](https://docs.virginproxy.com/errors/#e-invalid_idempotency_key) [`invalid_job`](https://docs.virginproxy.com/errors/#e-invalid_job) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`invalid_webhook`](https://docs.virginproxy.com/errors/#e-invalid_webhook) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [`too_many_jobs`](https://docs.virginproxy.com/errors/#e-too_many_jobs) [How to use it](https://docs.virginproxy.com/jobs/#create) ### GET /v1/jobs/{id} Progress of a jobPermissionrequests or read With `?wait=1…30` the answer waits until the job moves on (an item finishes, the status changes) or the seconds pass – instead of polling every second. Up to 5 waiting calls per account. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The job id. | | `wait` | query | integer | Wait up to this many seconds for a change. 1 to 30. | **Answer 200 OK · Job** - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`job_expired`](https://docs.virginproxy.com/errors/#e-job_expired) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/jobs/#status) ### DELETE /v1/jobs/{id} Cancel a jobPermissionrequests Requests that have not started are canceled (not charged); running ones finish. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The job id. | **Answer 200 OK · Job** - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`job_expired`](https://docs.virginproxy.com/errors/#e-job_expired) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/jobs/#cancel) ### GET /v1/jobs/{id}/results Results of a jobPermissionrequests or read | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The job id. | | `offset` | query | integer | First index. Default `0`. 0 to …. | | `limit` | query | integer | Items per page. Default `100`. 1 to 100. | | `status` | query | string | Only items with this status. One of `queued`, `running`, `succeeded`, `failed`, `canceled`. | **Answer 200 OK · JobResults** - `job`object - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean - `items`list of object - `index`integer - `status`string - `url`string | null - `depth`integerOnly for crawls: links away from the start page. - `request_id`string | null - `credits`integer - `finished_at`string | null - `response`object[the answer of POST /v1/requests](https://docs.virginproxy.com/endpoints/#op-createRequest) - `error`object - `code`string - `message`string - `next_offset`integer | null Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`job_expired`](https://docs.virginproxy.com/errors/#e-job_expired) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/jobs/#results) ### GET /v1/jobs/{id}/stream Finished items as they come (NDJSON)Permissionrequests or read Keeps the connection open and sends one line per finished item while the job runs – `{"type": "item", "index", "status", "response" | "error", …}` – starting with `{"type": "start", "job"}` and ending with `{"type": "end", "job"}`. A `{"type": "ping"}` line comes every 25 seconds without news. After 15 minutes a `{"type": "reconnect", "after"}` line ends the call: call again with `?after=` that value. Crawls with `only_changed` leave out unchanged pages. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The job id. | | `after` | query | integer | Only items after this index (from a `reconnect` line or your last item). | | `include_body` | query | string | Include page bodies, screenshots and PDFs (default true). One of `true`, `false`, `1`, `0`. | **Answer 200 The stream.** `application/x-ndjson` Errors - 400 [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`job_expired`](https://docs.virginproxy.com/errors/#e-job_expired) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) ### GET /v1/jobs/{id}/export All results of a job as one downloadPermissionrequests or read The results streamed as NDJSON (one item per line, as in GET /v1/jobs/{id}/results), CSV (one row per item; `extracted` and `parsed` as JSON text) or JSON (`{"job": …, "items": [ … ]}`). Works while the job runs (what has finished so far) and up to 24 hours after it ended. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The job id. | | `format` | query | string | File format. One of `ndjson`, `csv`, `json`. Default `"ndjson"`. | | `status` | query | string | Only items with this status. One of `queued`, `running`, `succeeded`, `failed`, `canceled`. | | `include_body` | query | string | Include page bodies, screenshots and PDFs (default true for ndjson and json, false for csv). One of `true`, `false`, `1`, `0`. | **Answer 200 The file (Content-Disposition: attachment). · JobResults** - `job`object - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean - `items`list of object - `index`integer - `status`string - `url`string | null - `depth`integerOnly for crawls: links away from the start page. - `request_id`string | null - `credits`integer - `finished_at`string | null - `response`object[the answer of POST /v1/requests](https://docs.virginproxy.com/endpoints/#op-createRequest) - `error`object - `code`string - `message`string - `next_offset`integer | null Also as `application/x-ndjson`, `text/csv`. Errors - 400 [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`job_expired`](https://docs.virginproxy.com/errors/#e-job_expired) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/jobs/#export) ### POST /v1/jobs/{id}/retry Send the failed requests of a job againPermissionrequests Creates a new job from the failed requests of this one, exactly as they were sent, with the same webhook and tag. Requests that succeeded are not sent again. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The job id. | **Answer 202 The new job was accepted. · Job** - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean Errors - 400 [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`job_expired`](https://docs.virginproxy.com/errors/#e-job_expired) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) - 409 [`nothing_to_retry`](https://docs.virginproxy.com/errors/#e-nothing_to_retry) [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [`too_many_jobs`](https://docs.virginproxy.com/errors/#e-too_many_jobs) [How to use it](https://docs.virginproxy.com/jobs/#retry) ## Account Credits, limits and your request log. ### GET /v1/requests Your recent requestsPermissionread Newest first, 1 to 100 per page; `next` continues the list as `before`. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `limit` | query | integer | Records per page. Default `50`. 1 to 100. | | `result` | query | string | Only answers below 400, only answers of 400 and above, or only requests without an answer. One of `ok`, `http_error`, `failed`. | | `since` | query | string | Only this recent. One of `24h`, `7d`, `30d`, `90d`. | | `tag` | query | string | Only requests with this tag. | | `before` | query | string | Continue after this request id (`next` of the previous page). | | `host` | query | string | Only targets whose host contains this text. | | `kind` | query | string | Only requests of this kind (page, render, screenshot, pdf, batch, job, crawl, map, mcp). One of `page`, `render`, `screenshot`, `pdf`, `batch`, `job`, `crawl`, `map`, `mcp`, `search`. | | `key` | query | string | Only requests of this key (its id). | | `from` | query | string | From this time on (ISO 8601). | | `to` | query | string | Before this time (ISO 8601). | | `status_class` | query | string | Only answers of the target with a status in this class. One of `2xx`, `3xx`, `4xx`, `5xx`. | | `status` | query | integer | Only answers with exactly this status. 100 to 599. | | `error` | query | string | Only failed requests with this error code (e.g. timeout). | | `min_ms` | query | integer | Only requests that took at least this long. 0 to …. | | `fresh_ip` | query | boolean | Only requests with (true) or without (false) a new IP. | | `charged` | query | boolean | Only charged (true) or free (false) requests. | **Answer 200 OK** - `items`list of object - `id`string - `created_at`string - `method`string - `target_host`string - `ok`booleanfalse when the target never answered. - `status`integer | null - `error`string | null - `exit`object - `ip`string | null - `country`string - `bytes`object - `up`integer - `down`integer - `duration_ms`integer | null - `cost`object - `credits`integer - `parts`objectOf the credits: the browser part, the new-IP part and the AI part. - `fresh_ip`boolean - `tag`string | null - `kind`string | null `"page"` `"render"` `"screenshot"` `"pdf"` `"batch"` `"job"` `"crawl"` `"map"` `"mcp"` `"search"` `null` - `key_id`string | nullThe key that sent it. - `next`string | null Errors - 400 [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) [How to use it](https://docs.virginproxy.com/account/#list) ### GET /v1/requests/{id} One request recordPermissionread Figures of one of your requests (not its content). | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The request id. | **Answer 200 OK · RequestRecord** - `id`string - `created_at`string - `method`string - `target_host`string - `ok`booleanfalse when the target never answered. - `status`integer | null - `error`string | null - `exit`object - `ip`string | null - `country`string - `bytes`object - `up`integer - `down`integer - `duration_ms`integer | null - `cost`object - `credits`integer - `parts`objectOf the credits: the browser part, the new-IP part and the AI part. - `render`integer - `fresh_ip`integer - `ai`integer - `fresh_ip`boolean - `tag`string | null - `kind`string | null `"page"` `"render"` `"screenshot"` `"pdf"` `"batch"` `"job"` `"crawl"` `"map"` `"mcp"` `"search"` `null` - `key_id`string | nullThe key that sent it. Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/account/#request) ### GET /v1/requests/{id}/answer The kept answer of a requestPermissionread The answer itself, when it is kept: requests sent with an `Idempotency-Key` (24 hours) and answers in the cache (`cache`, up to their age). Free; nothing runs again. Otherwise 404 `answer_not_kept`. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The request id. | **Answer 200 OK** - `request_id`string - `http_status`integer - `created_at`string - `expires_at`string - `answer`object[the answer of POST /v1/requests](https://docs.virginproxy.com/endpoints/#op-createRequest) Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/automation/#answers) ### GET /v1/limits What you may still do right nowPermissionrequests or read Parallel requests and the rate of your plan with their current use, the daily credit cap and the calling key's limits – for clients that pace themselves instead of running into 429 or 402. Free. **Answer 200 OK · Limits** - `concurrency`object - `limit`integer - `in_use`integer - `peak_today`integer - `rate`object - `limit`integerRequests per second. - `now`number - `avg_5s`number - `peak_today`number - `daily_cap`object | nullOnly with a daily cap set. - `cap`integer - `used`integer - `left`integer - `resets_at`string - `key`object | null - `id`string - `credit_limit`integer | null - `daily_limit`integer | null - `daily_used`integer - `daily_left`integer | null - `test_mode`true Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) [How to use it](https://docs.virginproxy.com/automation/#limits) ### PATCH /v1/account/settings Daily cap, credit alerts, alert webhookPermissionmanage Needs a key with the `manage` scope and without its own credit limit. Every change is in the audit log. **Request body application/json · AccountSettings** - `daily_cap`integer | nullCredits per UTC day for the whole account, or null for none. - `alert_thresholds`list of integer | nullPercentages of the credits at which you are told (null: 80 and 100). - `alert_hook_url`string | nullAn https address of yours for account alerts, or null. - `alert_hook_slack`booleanSend alerts in Slack's message format. **Answer 200 OK · AccountSettings** - `daily_cap`integer | nullCredits per UTC day for the whole account, or null for none. - `alert_thresholds`list of integer | nullPercentages of the credits at which you are told (null: 80 and 100). - `alert_hook_url`string | nullAn https address of yours for account alerts, or null. - `alert_hook_slack`booleanSend alerts in Slack's message format. Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/automation/#limits) ### GET /v1/account Plan, credits and limitsPermissionrequests or read **Answer 200 OK · Account** - `id`string - `plan`string `"free"` `"starter"` `"growth"` `"scale"` - `status`string - `credits`object - `included`integer - `used`integer - `extra`integer - `remaining`integer - `period_start`string | null - `period_end`string | null - `limits`object - `concurrency`integer - `requests_per_second`integer - `max_response_bytes`integer - `timeout_ms`integer - `priority`integer - `requests_per_job`integer - `requests_per_batch`integer - `test_mode`trueOnly when called with a test key. Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) [How to use it](https://docs.virginproxy.com/account/#account) ### GET /v1/usage Usage per day (UTC)Permissionread Days without requests are left out of `data`. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `days` | query | integer | Days back, today included. Default `30`. 1 to 90. | | `tag` | query | string | Only requests with this tag. | **Answer 200 OK · Usage** - `days`integer - `from`string - `to`string - `tag`string - `data`list of object - `day`string - `requests`integer - `successful`integer - `credits`integer - `bytes_down`integer - `bytes_up`integer Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) [How to use it](https://docs.virginproxy.com/account/#usage) ### GET /v1/usage/breakdown Usage per target domain, key or tagPermissionread With a time series per row. Up to 30 per minute. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `by` | query | string | Group by. One of `host`, `key`, `tag`. Default `"host"`. | | `since` | query | string | Period. One of `24h`, `7d`, `30d`, `90d`. Default `"7d"`. | | `sort` | query | string | Order. One of `requests`, `credits`, `failed`, `avg_ms`. Default `"requests"`. | | `limit` | query | integer | Rows. Default `20`. 1 to 100. | | `tag` | query | string | Only this tag. | | `key` | query | string | Only this key (its id). | **Answer 200 OK** by, since, sort, bucket (hour or day), buckets, total and items with their series. Errors - 400 [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_tag`](https://docs.virginproxy.com/errors/#e-invalid_tag) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/account/#breakdown) ## Keys and webhooks Manage API keys and webhook settings from your own tools. ### GET /v1/destinations Your storage destinationsPermissionrequests or read **Answer 200 OK** - `items`list of object - `id`string - `name`string - `type`"s3" - `endpoint`string | null - `region`string - `bucket`string - `prefix`string - `access_key_id`string - `path_style`boolean | null - `created_at`string - `last_test`object | null - `at`string - `ok`boolean - `error`string - `limit`integer Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) ### POST /v1/destinations Add your own storage (S3-compatible)Permissionmanage A bucket of AWS S3 or any S3-compatible service (Cloudflare R2, Google Cloud Storage in interoperability mode, MinIO, Wasabi, Backblaze B2 …) that jobs, crawls and schedules can write their results to (`delivery`). The secret key is stored encrypted and never shown again. Give the key write access (PutObject) to the bucket or prefix only. Needs the `manage` scope; at most 10. **Request body application/json · DestinationBody** - `name`stringrequired - `type`"s3" - `endpoint`string | nullThe https address of the service; leave out for AWS S3. - `region`stringCloudflare R2: `auto`. - `bucket`stringrequired - `prefix`stringA folder in the bucket, e.g. `virginproxy/`. - `access_key_id`stringrequired - `secret_access_key`stringrequired - `path_style`booleanAddress the bucket as / (default for services other than AWS) or as .. **Answer 201 Created. · Destination** - `id`string - `name`string - `type`"s3" - `endpoint`string | null - `region`string - `bucket`string - `prefix`string - `access_key_id`string - `path_style`boolean | null - `created_at`string - `last_test`object | null - `at`string - `ok`boolean - `error`string Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 409 [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) ### DELETE /v1/destinations/{id} Delete a storage destinationPermissionmanage | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The destination id. | **Answer 200 OK** - `deleted`true - `id`string Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) ### POST /v1/destinations/{id}/test Write a test filePermissionmanage Writes `virginproxy-test.txt` into the bucket (inside the prefix) and says whether it worked, with the storage service's own error when not. The file stays there. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The destination id. | **Answer 200 OK** - `ok`boolean - `key`string - `error`string Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) ### GET /v1/keys Your API keysPermissionmanage Every key that is not revoked, with its usage. Needs a live key without its own credit limit and with the manage permission. The full keys are never shown again, only their prefix. **Answer 200 OK** - `items`list of object - `id`string - `name`string - `prefix`stringThe visible start of the key, e.g. vp_live_Ab3d. - `mode`string `"live"` `"test"` - `ip_allowlist`list of string - `credit_limit`integer | null - `daily_limit`integer | nullCredits this key may use per UTC day; null = no daily limit. - `last_used_at`string | null - `created_at`string - `current`booleanThis is the key of the call. - `scopes`list of stringWhat the key may do: requests (send requests, jobs, crawls), read (account, usage, request log), manage (keys and webhooks). Keys without stored scopes have all three. - `expires_at`string | nullAfter this time the key no longer works (401). Set by you, or by a roll (the end of its grace period). - `rolled_to`string | nullThe id of the key that replaced this one in a roll. - `usage`object - `period_credits`integerCredits in the current period (what counts against credit_limit). - `requests_30d`integer - `credits_30d`integer - `max_keys`integer - `period_start`string | null Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/security/#keys-api) ### POST /v1/keys Create an API keyPermissionmanage Creates a live or test key, optionally with a credit limit and an IP list. The full key is in this answer only. At most 20 keys per account. Needs a live key without its own credit limit and with the manage permission. **Request body application/json · KeyCreate** - `name`stringrequired - `mode`stringtest: sample answers, never charged (see Test mode). `"live"` `"test"` - `credit_limit`integer | nullCredits this key may use per period. - `daily_limit`integer | nullCredits this key may use per UTC day (daily_limit_reached past it). - `ip_allowlist`list of string | nullOnly these addresses may use the key. - `scopes`list of string | nullPermissions of the new key; never more than the calling key has. Default: the calling key's own. - `expires_at`string | nullOptional expiry date, at least 5 minutes and at most 366 days ahead. **Answer 201 The key was created. · KeyCreated** - `id`string - `name`string - `prefix`string - `mode`string - `key`stringThe full key. Shown only here. - `credit_limit`integer | null - `daily_limit`integer | null - `ip_allowlist`list of string - `scopes`list of stringWhat the key may do: requests (send requests, jobs, crawls), read (account, usage, request log), manage (keys and webhooks). Keys without stored scopes have all three. - `expires_at`string | null - `created_at`string - `note`string Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_scopes`](https://docs.virginproxy.com/errors/#e-invalid_scopes) [`invalid_expiry`](https://docs.virginproxy.com/errors/#e-invalid_expiry) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) [`invalid_name`](https://docs.virginproxy.com/errors/#e-invalid_name) [`invalid_ip_list`](https://docs.virginproxy.com/errors/#e-invalid_ip_list) [`invalid_limit`](https://docs.virginproxy.com/errors/#e-invalid_limit) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 409 [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`too_many_keys`](https://docs.virginproxy.com/errors/#e-too_many_keys) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/security/#keys-api) ### PATCH /v1/keys/{id} Change name, credit limit, daily limit or IP list of a keyPermissionmanage An IP list that would lock out the key you are calling with is refused (`own_key`). | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The key id (from GET /v1/keys). | **Request body application/json · KeyUpdate** - `name`string - `credit_limit`integer | null - `daily_limit`integer | null - `ip_allowlist`list of string | null - `scopes`list of string | nullOnly within the calling key's own permissions. - `expires_at`string | nullnull removes the expiry date. **Answer 200 OK · Key** - `id`string - `name`string - `prefix`stringThe visible start of the key, e.g. vp_live_Ab3d. - `mode`string `"live"` `"test"` - `ip_allowlist`list of string - `credit_limit`integer | null - `daily_limit`integer | nullCredits this key may use per UTC day; null = no daily limit. - `last_used_at`string | null - `created_at`string - `current`booleanThis is the key of the call. - `scopes`list of stringWhat the key may do: requests (send requests, jobs, crawls), read (account, usage, request log), manage (keys and webhooks). Keys without stored scopes have all three. - `expires_at`string | nullAfter this time the key no longer works (401). Set by you, or by a roll (the end of its grace period). - `rolled_to`string | nullThe id of the key that replaced this one in a roll. - `usage`object - `period_credits`integerCredits in the current period (what counts against credit_limit). - `requests_30d`integer - `credits_30d`integer Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_scopes`](https://docs.virginproxy.com/errors/#e-invalid_scopes) [`invalid_expiry`](https://docs.virginproxy.com/errors/#e-invalid_expiry) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) [`invalid_name`](https://docs.virginproxy.com/errors/#e-invalid_name) [`invalid_ip_list`](https://docs.virginproxy.com/errors/#e-invalid_ip_list) [`invalid_limit`](https://docs.virginproxy.com/errors/#e-invalid_limit) [`nothing_to_change`](https://docs.virginproxy.com/errors/#e-nothing_to_change) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) - 409 [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`own_key`](https://docs.virginproxy.com/errors/#e-own_key) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/security/#keys-api) ### DELETE /v1/keys/{id} Revoke a keyPermissionmanage The key stops working at once. Revoking the key you are calling with needs `?confirm=revoke_current_key`. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The key id. | | `confirm` | query | string | Only to revoke the key of this call. One of `revoke_current_key`. | **Answer 200 OK** - `id`string - `revoked`true - `current`boolean Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) - 409 [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`own_key`](https://docs.virginproxy.com/errors/#e-own_key) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/security/#keys-api) ### POST /v1/keys/{id}/roll Roll a key: a new secret, the old one keeps working for a grace periodPermissionmanage Creates a new key with the same name, mode, limits, IP list and permissions; the old key keeps working for `grace` (1h, 24h, 7d; default 24h) and then gives 401. The full new key is in this answer only. The new key's credit limits count from zero. Never for a key with more permissions than the calling one. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The key to roll. | **Request body application/json** - `grace`string `"1h"` `"24h"` `"7d"` **Answer 201 The new key was created.** any Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_grace`](https://docs.virginproxy.com/errors/#e-invalid_grace) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) - 409 [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`cannot_roll`](https://docs.virginproxy.com/errors/#e-cannot_roll) [`too_many_keys`](https://docs.virginproxy.com/errors/#e-too_many_keys) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/security/#rotate-keys) ### GET /v1/webhooks Webhook secret and recent deliveriesPermissionmanage The secret that signs your webhooks and the latest deliveries with their outcome (kept 7 days; their content 72 hours after the last attempt, for redelivery). Needs a live key without its own credit limit and with the manage permission. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `limit` | query | integer | Deliveries. Default `50`. 1 to 100. | **Answer 200 OK** - `secret`stringwhsec_… - `previous_until`string | nullWhile a rotation's grace period runs: until when deliveries also carry a signature with the previous secret. - `deliveries`list of object - `id`string - `job_id`string | nullnull for an alert of the account webhook (event alert.…). - `event`stringjob.item, job.done, or alert.… for the account webhook for alerts. - `index`integer | null - `url`string - `status`string `"pending"` `"delivered"` `"failed"` - `attempts`integer - `next_attempt_at`string | null - `last_code`integer | null - `last_error`string | null - `last_attempt_at`string | null - `created_at`string - `delivered_at`string | null - `redeliverable`booleanCan be sent again (finished, and its last attempt less than 72 hours ago). - `redelivered_at`string | nullWhen it was last sent again on request. Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/webhooks/#api) ### POST /v1/webhooks/secret Make a new webhook secretPermissionmanage Makes a new secret. Without `grace` (or with `now`) the old one stops verifying at once. With a grace period, deliveries carry two signatures until it ends – `X-VP-Signature: t=…,v1=,v1=` – so receivers can switch to the new secret in their own time: accept a call when any v1 matches. **Request body application/json** - `grace`string `"now"` `"1h"` `"24h"` `"7d"` **Answer 200 OK** - `secret`string - `previous_until`string | null - `note`string Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_grace`](https://docs.virginproxy.com/errors/#e-invalid_grace) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/webhooks/#rotate) ### GET /v1/webhooks/deliveries Webhook deliveries, filtered and page by pagePermissionmanage Newest first, from the last 7 days. Continue with `before` = the `next` of the previous page. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `status` | query | string | Only this state. One of `pending`, `delivered`, `failed`. | | `event` | query | string | job.item, job.done, alert (every alert) or one alert.… event. | | `job` | query | string | Only deliveries of this job. | | `before` | query | string | Continue after this delivery. | | `limit` | query | integer | Deliveries per page. Default `50`. 1 to 100. | **Answer 200 OK** - `items`list of object - `id`string - `job_id`string | nullnull for an alert of the account webhook (event alert.…). - `event`stringjob.item, job.done, or alert.… for the account webhook for alerts. - `index`integer | null - `url`string - `status`string `"pending"` `"delivered"` `"failed"` - `attempts`integer - `next_attempt_at`string | null - `last_code`integer | null - `last_error`string | null - `last_attempt_at`string | null - `created_at`string - `delivered_at`string | null - `redeliverable`booleanCan be sent again (finished, and its last attempt less than 72 hours ago). - `redelivered_at`string | nullWhen it was last sent again on request. - `next`string | null - `keep_hours`integer Errors - 400 [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) [`invalid_limit`](https://docs.virginproxy.com/errors/#e-invalid_limit) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/webhooks/#delivery-log) ### GET /v1/webhooks/deliveries/{id} One delivery with its attemptsPermissionmanage The delivery, its body while it is kept (72 hours after the last attempt; cut at 20 KB here) and every attempt: time, duration, status or error, the headers we sent and the start of your server's answer (at most 2048 bytes). | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The delivery id. | **Answer 200 OK** any Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/webhooks/#delivery-log) ### POST /v1/webhooks/test Send a signed test delivery nowPermissionmanage Sends one signed sample event (webhook.test, job.done, job.item) to your URL and answers with the outcome. Nothing is stored or retried; the body carries `"test": true`. Up to 10 per minute. **Request body application/json** - `url`stringrequiredA public https:// address of yours. - `event`string `"webhook.test"` `"job.done"` `"job.item"` **Answer 200 OK** - `id`string - `event`string - `url`string - `delivered`booleanYour endpoint answered with 2xx. - `status_code`integer | null - `error`string - `duration_ms`integer Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/webhooks/#api) ### POST /v1/webhooks/deliveries/{id}/redeliver Send a delivery againPermissionmanage Puts a finished delivery (delivered or given up) back in the queue: the same id and body, signed with the current secret, with a fresh retry schedule. Possible for 72 hours after its last attempt. Another account's delivery is "not found". Up to 20 per minute. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The delivery id (from GET /v1/webhooks). | **Answer 200 The delivery is queued again (status pending). · WebhookDelivery** - `id`string - `job_id`string | nullnull for an alert of the account webhook (event alert.…). - `event`stringjob.item, job.done, or alert.… for the account webhook for alerts. - `index`integer | null - `url`string - `status`string `"pending"` `"delivered"` `"failed"` - `attempts`integer - `next_attempt_at`string | null - `last_code`integer | null - `last_error`string | null - `last_attempt_at`string | null - `created_at`string - `delivered_at`string | null - `redeliverable`booleanCan be sent again (finished, and its last attempt less than 72 hours ago). - `redelivered_at`string | nullWhen it was last sent again on request. Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) - 409 [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) [`delivery_pending`](https://docs.virginproxy.com/errors/#e-delivery_pending) - 410 [`delivery_expired`](https://docs.virginproxy.com/errors/#e-delivery_expired) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/webhooks/#redeliver) ## Presets and schedules Saved request options, and jobs or crawls that run again every interval with a cost cap. ### GET /v1/presets Your presetsPermissionrequests or read **Answer 200 OK** - `items`list of object - `name`string - `description`string | null - `request`object - `created_at`string - `updated_at`string - `max_presets`integer Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) [How to use it](https://docs.virginproxy.com/automation/#presets) ### POST /v1/presets Save request options under a namePermissionmanage Use it with `"preset": "name"` in a request, a job (or its items), a crawl's `request` or a batch; options sent with the request win. Up to 100 per account. Needs the `manage` scope. **Request body application/json · PresetBody** - `name`string - `description`string | null - `request`objectRequest options as for POST /v1/requests, without `url` (checked when saved). **Answer 201 Created. · Preset** - `name`string - `description`string | null - `request`object - `created_at`string - `updated_at`string Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 409 [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) [How to use it](https://docs.virginproxy.com/automation/#presets) ### GET /v1/presets/{name} One presetPermissionrequests or read | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `name` required | path | string | | **Answer 200 OK · Preset** - `name`string - `description`string | null - `request`object - `created_at`string - `updated_at`string Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/automation/#presets) ### PATCH /v1/presets/{name} Change a presetPermissionmanage | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `name` required | path | string | | **Request body application/json · PresetBody** - `name`string - `description`string | null - `request`objectRequest options as for POST /v1/requests, without `url` (checked when saved). **Answer 200 OK · Preset** - `name`string - `description`string | null - `request`object - `created_at`string - `updated_at`string Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) - 409 [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) [How to use it](https://docs.virginproxy.com/automation/#presets) ### DELETE /v1/presets/{name} Delete a presetPermissionmanage | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `name` required | path | string | | **Answer 200 OK** - `deleted`true - `name`string Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/automation/#presets) ### GET /v1/schedules Your schedulesPermissionrequests or read **Answer 200 OK** - `items`list of object - `id`string - `name`string | null - `every`string - `rhythm`stringThe rhythm in words, also for the fixed codes. - `time_zone`stringOnly for wall-clock rhythms: the zone they run in. - `notify`object - `email`boolean - `webhook`boolean - `track`string | null - `goal`stringOnly when set. - `next_runs`list of stringThe next three runs (empty when paused). - `kind`string `"job"` `"crawl"` - `job`object - `crawl`object - `max_credits`integer - `status`string `"active"` `"paused"` - `paused_reason`string | null `"by_you"` `"credits_exhausted"` `"daily_limit_reached"` `"key_limit_reached"` `"key_revoked"` `"account_suspended"` `"email_not_verified"` `null` - `next_run_at`string | null - `last_run_at`string | null - `last_job`string | null - `runs`integer - `created_at`string - `limits`object Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) [How to use it](https://docs.virginproxy.com/automation/#schedules) ### POST /v1/schedules Run a job or crawl again and againPermissionmanage Starts the job or crawl every interval (5m, 15m, 30m, 1h, 6h, 12h, 1d, 7d), each run with its own cost cap `max_credits` (required). Runs never overlap. The schedule pauses itself when credits or the daily cap are used up, its key is revoked or the account is suspended. Per plan: free 1, starter 5, growth 20, scale 50 schedules. Needs the `manage` scope. **Request body application/json · ScheduleBody** - `name`string | null - `every`stringA fixed interval (5m, 15m, 30m, 1h, 6h, 12h, 1d, 7d) or a rhythm in words in your account's time zone: `every 30 minutes`, `hourly`, `every 6 hours`, `daily at 08:00`, `weekdays at 09:30`, `weekly on monday at 07:00`, `every 2 days`. At least every 5 minutes, and not more often than your plan allows. - `notify`object | nullWith `track`: when a run finds new, removed or changed pages. E-mail at most once per hour and schedule. - `email`boolean - `webhook`booleanTo your alert webhook as `alert.monitor_changed`. - `track`string | null`pages`: compare every run with the last one (a monitor); see `/v1/schedules/{id}/reports`. `"pages"` `null` - `goal`string | nullWith `track`: which changes matter, in words ("a price drops"). Only when the service has AI features switched on; then only changes that matter are reported. - `max_credits`integerThe most one run may cost (required when creating). - `job`objectAs for POST /v1/jobs (without max_credits). Either this or crawl. - `crawl`objectAs for POST /v1/crawl (without max_credits). - `start_at`stringThe first run (default: now). - `status`string `"active"` `"paused"` **Answer 201 Created. · Schedule** - `id`string - `name`string | null - `every`string - `rhythm`stringThe rhythm in words, also for the fixed codes. - `time_zone`stringOnly for wall-clock rhythms: the zone they run in. - `notify`object - `email`boolean - `webhook`boolean - `track`string | null - `goal`stringOnly when set. - `next_runs`list of stringThe next three runs (empty when paused). - `kind`string `"job"` `"crawl"` - `job`object - `crawl`object - `max_credits`integer - `status`string `"active"` `"paused"` - `paused_reason`string | null `"by_you"` `"credits_exhausted"` `"daily_limit_reached"` `"key_limit_reached"` `"key_revoked"` `"account_suspended"` `"email_not_verified"` `null` - `next_run_at`string | null - `last_run_at`string | null - `last_job`string | null - `runs`integer - `created_at`string Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 409 [`too_many_schedules`](https://docs.virginproxy.com/errors/#e-too_many_schedules) [`too_many_destinations`](https://docs.virginproxy.com/errors/#e-too_many_destinations) [`preset_exists`](https://docs.virginproxy.com/errors/#e-preset_exists) [`too_many_presets`](https://docs.virginproxy.com/errors/#e-too_many_presets) [How to use it](https://docs.virginproxy.com/automation/#schedules) ### GET /v1/schedules/{id} One schedulePermissionrequests or read | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The schedule id. | **Answer 200 OK · Schedule** - `id`string - `name`string | null - `every`string - `rhythm`stringThe rhythm in words, also for the fixed codes. - `time_zone`stringOnly for wall-clock rhythms: the zone they run in. - `notify`object - `email`boolean - `webhook`boolean - `track`string | null - `goal`stringOnly when set. - `next_runs`list of stringThe next three runs (empty when paused). - `kind`string `"job"` `"crawl"` - `job`object - `crawl`object - `max_credits`integer - `status`string `"active"` `"paused"` - `paused_reason`string | null `"by_you"` `"credits_exhausted"` `"daily_limit_reached"` `"key_limit_reached"` `"key_revoked"` `"account_suspended"` `"email_not_verified"` `null` - `next_run_at`string | null - `last_run_at`string | null - `last_job`string | null - `runs`integer - `created_at`string Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/automation/#schedules) ### PATCH /v1/schedules/{id} Change, pause or resume a schedulePermissionmanage | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The schedule id. | **Request body application/json · ScheduleBody** - `name`string | null - `every`stringA fixed interval (5m, 15m, 30m, 1h, 6h, 12h, 1d, 7d) or a rhythm in words in your account's time zone: `every 30 minutes`, `hourly`, `every 6 hours`, `daily at 08:00`, `weekdays at 09:30`, `weekly on monday at 07:00`, `every 2 days`. At least every 5 minutes, and not more often than your plan allows. - `notify`object | nullWith `track`: when a run finds new, removed or changed pages. E-mail at most once per hour and schedule. - `email`boolean - `webhook`booleanTo your alert webhook as `alert.monitor_changed`. - `track`string | null`pages`: compare every run with the last one (a monitor); see `/v1/schedules/{id}/reports`. `"pages"` `null` - `goal`string | nullWith `track`: which changes matter, in words ("a price drops"). Only when the service has AI features switched on; then only changes that matter are reported. - `max_credits`integerThe most one run may cost (required when creating). - `job`objectAs for POST /v1/jobs (without max_credits). Either this or crawl. - `crawl`objectAs for POST /v1/crawl (without max_credits). - `start_at`stringThe first run (default: now). - `status`string `"active"` `"paused"` **Answer 200 OK · Schedule** - `id`string - `name`string | null - `every`string - `rhythm`stringThe rhythm in words, also for the fixed codes. - `time_zone`stringOnly for wall-clock rhythms: the zone they run in. - `notify`object - `email`boolean - `webhook`boolean - `track`string | null - `goal`stringOnly when set. - `next_runs`list of stringThe next three runs (empty when paused). - `kind`string `"job"` `"crawl"` - `job`object - `crawl`object - `max_credits`integer - `status`string `"active"` `"paused"` - `paused_reason`string | null `"by_you"` `"credits_exhausted"` `"daily_limit_reached"` `"key_limit_reached"` `"key_revoked"` `"account_suspended"` `"email_not_verified"` `null` - `next_run_at`string | null - `last_run_at`string | null - `last_job`string | null - `runs`integer - `created_at`string Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/automation/#schedules) ### DELETE /v1/schedules/{id} Delete a schedulePermissionmanage | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The schedule id. | **Answer 200 OK** - `deleted`true - `id`string Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/automation/#schedules) ### POST /v1/schedules/preview Check a rhythm and see its next runsPermissionrequests or read Saves nothing. `every` as for a schedule: a fixed code or a rhythm in words; the answer says it back the way it is stored, whether your plan allows it, and the next three runs in your account's time zone. **Request body application/json** - `every`stringrequired **Answer 200 OK** - `every`string - `allowed`boolean - `shortest_every`string - `time_zone`string - `next_runs`list of string Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) ### GET /v1/schedules/{id}/reports What each run found (monitors)Permissionrequests or read Only for schedules with `track: "pages"`: one report per finished run, newest first (the last 100 are kept) – pages new since the run before, removed, changed (each list up to 200 addresses; the counts are complete). | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The schedule id. | | `limit` | query | integer | Default `20`. 1 to 50. | **Answer 200 OK** - `items`list of object - `judgement`objectOnly for monitors with a goal: whether the change mattered, and why. - `meaningful`boolean - `reason`string - `job`string - `at`string - `first_run`booleanThe first run only records the pages; nothing is reported as new. - `pages`integer - `counts`object - `added`integer - `removed`integer - `changed`integer - `added`list of string - `removed`list of string - `changed`list of string Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) ### POST /v1/schedules/{id}/run Start a run nowPermissionmanage Also for a paused schedule; the next regular run stays as planned. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `id` required | path | string | The schedule id. | **Answer 202 Started.** - `schedule`object - `id`string - `name`string | null - `every`string - `rhythm`stringThe rhythm in words, also for the fixed codes. - `time_zone`stringOnly for wall-clock rhythms: the zone they run in. - `notify`object - `email`boolean - `webhook`boolean - `track`string | null - `goal`stringOnly when set. - `next_runs`list of stringThe next three runs (empty when paused). - `kind`string `"job"` `"crawl"` - `job`object - `crawl`object - `max_credits`integer - `status`string `"active"` `"paused"` - `paused_reason`string | null `"by_you"` `"credits_exhausted"` `"daily_limit_reached"` `"key_limit_reached"` `"key_revoked"` `"account_suspended"` `"email_not_verified"` `null` - `next_run_at`string | null - `last_run_at`string | null - `last_job`string | null - `runs`integer - `created_at`string - `job`object - `id`string - `status`string `"queued"` `"running"` `"done"` `"canceled"` `"expired"` - `total`integerRequests in the job (a crawl grows as it finds pages). - `succeeded`integer - `failed`integer - `canceled`integer - `pending`integer - `credits`integer - `tag`string | null - `webhook`object | null - `url`string - `events`list of string - `include_body`false - `metadata`object - `budget`objectOnly with `max_credits`: the cap, what was used and what is left. - `max_credits`integer - `spent`integer - `left`integer - `created_at`string - `started_at`string | null - `finished_at`string | null - `expires_at`string | nullResults are deleted 24 hours after the end. - `last_progress_at`string | null - `kind`stringOnly for crawls. `"crawl"` - `delivery`objectOnly with `delivery`: where the results go and how it went. - `destination`string - `format`string `"ndjson"` `"json"` `"csv"` - `path`string - `status`string `"pending"` `"delivered"` `"failed"` - `key`string - `bytes`integer - `parts`integerResults above 90 MB are written as numbered parts. - `keys`list of string - `error`string - `crawl`objectOnly for crawls: the settings. - `url`string - `max_pages`integer - `max_depth`integer - `include_paths`list of string - `exclude_paths`list of string - `include_subdomains`boolean - `ignore_query`boolean Errors - 400 [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 402 See the errors page. - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`key_management_not_allowed`](https://docs.virginproxy.com/errors/#e-key_management_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`not_found`](https://docs.virginproxy.com/errors/#e-not_found) [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) [How to use it](https://docs.virginproxy.com/automation/#schedules) ## AI agents Use VirginProxy from AI clients. ### GET /.well-known/ai-catalog.json AI catalogPermissionNo key needed No key needed. Points to the MCP server card. **Answer 200 OK** `application/ai-catalog+json` ### GET /mcp/server-card MCP server cardPermissionNo key needed No key needed. How to connect to the MCP server: address, transport, authentication, protocol versions. **Answer 200 OK** `application/mcp-server-card+json` [How to use it](https://docs.virginproxy.com/ai-agents/#protocol) ### GET /v1/docs The complete documentation for your AIPermissionAny key Lists the files of the complete documentation (member guides included) for your AI assistant or agent: Markdown, OpenAPI, error list, tool definitions. Any key of the account works, test keys too; free and not in the request log; up to 60 files per minute. The key goes in the header only, never in the address. **Answer 200 OK** - `description`string - `files`list of object - `name`string - `url`string - `type`string - `title`string - `available`boolean - `mcp`object Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) ### GET /v1/docs/{name} One file of the complete documentationPermissionAny key One file of the complete documentation (see GET /v1/docs). `llms-full.txt` is the whole documentation as one Markdown text, member guides included. | Parameter | In | Type | Meaning | | --- | --- | --- | --- | | `name` required | path | string | A file name from GET /v1/docs (10 files). | **Answer 200 The file.** object Also as `text/markdown`, `application/yaml`. Errors - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 [`account_suspended`](https://docs.virginproxy.com/errors/#e-account_suspended) [`ip_not_allowed`](https://docs.virginproxy.com/errors/#e-ip_not_allowed) [`insufficient_scope`](https://docs.virginproxy.com/errors/#e-insufficient_scope) - 404 [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) - 429 [`rate_limited`](https://docs.virginproxy.com/errors/#e-rate_limited) - 503 [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) ### POST /mcp Model Context Protocol endpointPermissionKey or sign-in For AI clients (MCP, Streamable HTTP transport, no sessions, JSON answers). Send JSON-RPC 2.0 messages with your API key as Bearer token. Protocol versions: 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05 (2026-07-28 without handshake: version in `params._meta` and the MCP-Protocol-Version, Mcp-Method and Mcp-Name headers; earlier ones with initialize). Methods: server/discover, initialize, ping, tools/list, tools/call, resources/list, resources/templates/list, resources/read, prompts/list, prompts/get. Tools: scrape, batch_scrape, screenshot, pdf, search, map, crawl, export_job, retry_job, get_job, list_jobs, cancel_job, estimate, account, usage, list_requests, limits, get_answer, list_presets, get_request. Each tool call is an ordinary API call (same limits, same charges, same request log). GET and DELETE answer 405. **Request body application/json** - `jsonrpc`"2.0"required - `id`string | integer - `method`stringrequired - `params`object **Answer 200 OK** JSON-RPC response (or a list of them for a batch). **Answer 202 Only notifications were sent: nothing to answer.** No body. Errors - 400 [`invalid_body`](https://docs.virginproxy.com/errors/#e-invalid_body) [`invalid_format_options`](https://docs.virginproxy.com/errors/#e-invalid_format_options) [`invalid_redact`](https://docs.virginproxy.com/errors/#e-invalid_redact) [`invalid_auto_extract`](https://docs.virginproxy.com/errors/#e-invalid_auto_extract) [`invalid_render_auto`](https://docs.virginproxy.com/errors/#e-invalid_render_auto) [`invalid_query`](https://docs.virginproxy.com/errors/#e-invalid_query) [`invalid_delivery`](https://docs.virginproxy.com/errors/#e-invalid_delivery) [`job_budget_reached`](https://docs.virginproxy.com/errors/#e-job_budget_reached) [`invalid_schedule`](https://docs.virginproxy.com/errors/#e-invalid_schedule) [`invalid_destination`](https://docs.virginproxy.com/errors/#e-invalid_destination) [`invalid_value`](https://docs.virginproxy.com/errors/#e-invalid_value) [`invalid_preset`](https://docs.virginproxy.com/errors/#e-invalid_preset) - 401 [`invalid_api_key`](https://docs.virginproxy.com/errors/#e-invalid_api_key) - 403 See the errors page. - 404 Protocol 2026-07-28: the method is not supported (JSON-RPC error -32601). - 503 [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) [How to use it](https://docs.virginproxy.com/ai-agents/#mcp) ## OAuth Sign-in for MCP clients that connect with OAuth: register, approve on the dashboard, get tokens for /mcp. ### GET /.well-known/oauth-authorization-server Authorization server metadata (RFC 8414)PermissionNo key needed No key needed. Endpoints and capabilities of the OAuth sign-in for MCP clients. **Answer 200 OK** object [How to use it](https://docs.virginproxy.com/ai-agents/#oauth-clients) ### GET /.well-known/oauth-protected-resource/mcp Protected resource metadata of /mcp (RFC 9728)PermissionNo key needed No key needed. Which authorization server issues tokens for the MCP endpoint. A 401 from /mcp points here in its WWW-Authenticate header. **Answer 200 OK** object [How to use it](https://docs.virginproxy.com/ai-agents/#oauth-clients) ### POST /oauth/register Register an MCP client (RFC 7591)PermissionNo key needed No key needed; up to 20 registrations per hour from one address. Redirect URIs: https, http on localhost / 127.0.0.1 / [::1] (any port), or an app's own scheme; no fragments, at most 2000 characters. Clients that are never authorised are deleted after 24 hours. **Request body application/json** - `redirect_uris`list of stringrequired - `client_name`stringShown on the consent screen. - `client_uri`string - `logo_uri`stringStored, not shown. - `token_endpoint_auth_method`string `"none"` `"client_secret_post"` `"client_secret_basic"` - `grant_types`list of string - `response_types`list of "code" - `scope`string **Answer 201 Registered.** - `client_id`stringrequired - `client_id_issued_at`integerrequired - `client_secret`stringOnly with client_secret_post / client_secret_basic. Shown once. - `client_secret_expires_at`0 - `redirect_uris`list of stringrequired - `client_name`string - `token_endpoint_auth_method`string - `grant_types`list of string - `response_types`list of string - `scope`"mcp" Errors - 400 invalid_redirect_uri or invalid_client_metadata. - 429 rate_limited. [How to use it](https://docs.virginproxy.com/ai-agents/#oauth-clients) ### POST /oauth/token Exchange a code or refresh token for tokensPermissionNo key needed grant_type=authorization_code (with PKCE S256: code, redirect_uri, code_verifier, client_id) or grant_type=refresh_token (rotating). Access tokens are valid 60 minutes and work only on https://api.virginproxy.com/mcp. A code works once; using it again revokes the tokens issued from it. The answer has Cache-Control: no-store. **Request body application/x-www-form-urlencoded** - `grant_type`stringrequired `"authorization_code"` `"refresh_token"` - `code`string - `redirect_uri`string - `code_verifier`string - `refresh_token`string - `resource`"https://api.virginproxy.com/mcp" - `scope`"mcp" - `client_id`stringYour client_id (or send it with the secret as HTTP Basic). - `client_secret`stringOnly for clients registered with client_secret_post. **Answer 200 Tokens.** - `access_token`stringrequiredSend as "Authorization: Bearer …" to https://api.virginproxy.com/mcp – the only endpoint that accepts it. - `token_type`"Bearer"required - `expires_in`3600requiredSeconds. - `refresh_token`stringrequiredValid 30 days from its issue; replaced by a new one on every use. Using a replaced one again ends the connection's sign-in. - `scope`"mcp"required Errors - 400 invalid_request, invalid_grant, unsupported_grant_type, invalid_scope or invalid_target. - 401 invalid_client. - 429 rate_limited. [How to use it](https://docs.virginproxy.com/ai-agents/#oauth-clients) ### POST /oauth/revoke Revoke a token (RFC 7009)PermissionNo key needed Always 200, whether or not the token existed. Revoking a refresh token ends the whole sign-in it belongs to; the connection itself stays on the Keys page until you revoke it there. **Request body application/x-www-form-urlencoded** - `token`stringrequired - `token_type_hint`string `"access_token"` `"refresh_token"` - `client_id`stringYour client_id (or send it with the secret as HTTP Basic). - `client_secret`stringOnly for clients registered with client_secret_post. **Answer 200 Done (also for an unknown token).** object Errors - 401 invalid_client: a registered secret was missing or wrong. [How to use it](https://docs.virginproxy.com/ai-agents/#oauth-clients) ## Service Status and machine-readable descriptions. ### GET /.well-known/api-catalog API catalog (RFC 9727)PermissionNo key needed No key needed. Where this API's description, documentation and status are, as a linkset. **Answer 200 OK** `application/linkset+json` ### GET /.well-known/security.txt Security contact (RFC 9116)PermissionNo key needed **Answer 200 OK** `text/plain` ### GET /v1/status Service statusPermissionNo key needed No key needed. `ok`, `maintenance` (paused, nothing is charged) or `disturbed`. **Answer 200 OK** - `status`string `"ok"` `"maintenance"` `"disturbed"` - `api_version`string - `time`string - `docs`string [How to use it](https://docs.virginproxy.com/status/) ### GET /v1/errors Every error codePermissionNo key needed No key needed. The same list as on the errors page, as JSON. **Answer 200 OK · ErrorList** - `description`string - `docs`string - `errors`list of object - `code`string - `http`integer - `group`string - `group_title`string - `retry`string `"wait"` `"yes"` `"no"` - `description`string Errors - 404 [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/errors/) ### GET /healthz Up or downPermissionNo key needed **Answer 200 OK** - `ok`true Errors - 503 Down. [How to use it](https://docs.virginproxy.com/account/#health) ### GET /openapi.json This description (JSON)PermissionNo key needed **Answer 200 OK** object Errors - 404 [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/ai-agents/#openapi) ### GET /openapi.yaml This description (YAML)PermissionNo key needed **Answer 200 OK** `application/yaml` Errors - 404 [`answer_not_kept`](https://docs.virginproxy.com/errors/#e-answer_not_kept) [`preset_not_found`](https://docs.virginproxy.com/errors/#e-preset_not_found) [How to use it](https://docs.virginproxy.com/ai-agents/#openapi) ### GET / Service name and docs linkPermissionNo key needed **Answer 200 OK** - `service`string - `version`string - `docs`string > **Note:** The error codes under each endpoint are the ones it can return in practice; the full list with what to do is on the [errors page](https://docs.virginproxy.com/errors/). Every authenticated call can also answer `invalid_api_key` (401), `rate_limited` (429) and `maintenance` (503). --- # Recipes > Complete workflows built from several endpoints: nightly price monitoring with webhooks and CSV export, a site inventory with map and batch, a crawl kept as a file, an AI agent with its own budget. Source: https://docs.virginproxy.com/recipes/ Each recipe combines a few endpoints into a complete workflow, with code you can copy. The figure under each example is about what that call costs. - [Price monitoring every night](#price-monitoring) - [Inventory of a website](#site-inventory) - [Crawl a site and keep it as a file](#crawl-export) - [An AI agent with its own budget](#agent-mcp) - [Watch prices every hour, hear only about changes](#price-monitor) ## Price monitoring every night Read the prices of a list of product pages once a night, get told when the run is done, never pay twice for the same night, and keep the result as a spreadsheet. 1. Start the night's jobOne [job](https://docs.virginproxy.com/jobs/) with every product page and the same [extract rule](https://docs.virginproxy.com/extract/) for all of them (in `request`). The `Idempotency-Key` carries the date: if your scheduler starts twice, or your connection breaks, the second call returns the same job instead of a second run. cURLPythonNode.jsPython SDKNode SDKPHPGoRubyJavaC#`curl https://api.virginproxy.com/v1/jobs \ -H "Authorization: Bearer $VP_KEY" \ -H "Idempotency-Key: prices-2026-11-25" \ -H "Content-Type: application/json" \ -d '{ "requests": [ { "url": "https://shop.example/product/42" }, { "url": "https://shop.example/product/43" }, { "url": "https://shop.example/product/44" } ], "request": { "extract": { "price": { "selector": "[itemprop=price]", "attr": "content", "type": "number" }, "title": "h1" } }, "webhook": { "url": "https://example.com/hooks/virginproxy", "events": [ "done" ] }, "tag": "prices/nightly" }'``import os, requests r = requests.post( "https://api.virginproxy.com/v1/jobs", headers={"Authorization": "Bearer " + os.environ["VP_KEY"], "Idempotency-Key": "prices-2026-11-25"}, json={ "requests": [ {"url": "https://shop.example/product/42"}, {"url": "https://shop.example/product/43"}, {"url": "https://shop.example/product/44"}, ], "request": { "extract": { "price": { "selector": "[itemprop=price]", "attr": "content", "type": "number", }, "title": "h1", }, }, "webhook": { "url": "https://example.com/hooks/virginproxy", "events": ["done"], }, "tag": "prices/nightly", }, timeout=30, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["id"], data["status"])``const res = await fetch("https://api.virginproxy.com/v1/jobs", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json", "Idempotency-Key": "prices-2026-11-25" }, body: JSON.stringify({ requests: [ { url: "https://shop.example/product/42" }, { url: "https://shop.example/product/43" }, { url: "https://shop.example/product/44" }, ], request: { extract: { price: { selector: "[itemprop=price]", attr: "content", type: "number", }, title: "h1", }, }, webhook: { url: "https://example.com/hooks/virginproxy", events: ["done"], }, tag: "prices/nightly", }), signal: AbortSignal.timeout(30_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.id, data.status);``from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.create_job({ "requests": [ {"url": "https://shop.example/product/42"}, {"url": "https://shop.example/product/43"}, {"url": "https://shop.example/product/44"}, ], "request": { "extract": { "price": { "selector": "[itemprop=price]", "attr": "content", "type": "number", }, "title": "h1", }, }, "webhook": { "url": "https://example.com/hooks/virginproxy", "events": ["done"], }, "tag": "prices/nightly", }) print(data)``import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.createJob({ requests: [ { url: "https://shop.example/product/42" }, { url: "https://shop.example/product/43" }, { url: "https://shop.example/product/44" }, ], request: { extract: { price: { selector: "[itemprop=price]", attr: "content", type: "number", }, title: "h1", }, }, webhook: { url: "https://example.com/hooks/virginproxy", events: ["done"], }, tag: "prices/nightly", }); console.log(data);`` true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", "Idempotency-Key: prices-2026-11-25", ], CURLOPT_POSTFIELDS => json_encode([ "requests" => [ ["url" => "https://shop.example/product/42"], ["url" => "https://shop.example/product/43"], ["url" => "https://shop.example/product/44"], ], "request" => [ "extract" => [ "price" => [ "selector" => "[itemprop=price]", "attr" => "content", "type" => "number", ], "title" => "h1", ], ], "webhook" => [ "url" => "https://example.com/hooks/virginproxy", "events" => ["done"], ], "tag" => "prices/nightly", ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["id"], " ", $data["status"], PHP_EOL;``` package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "requests": [ { "url": "https://shop.example/product/42" }, { "url": "https://shop.example/product/43" }, { "url": "https://shop.example/product/44" } ], "request": { "extract": { "price": { "selector": "[itemprop=price]", "attr": "content", "type": "number" }, "title": "h1" } }, "webhook": { "url": "https://example.com/hooks/virginproxy", "events": [ "done" ] }, "tag": "prices/nightly" }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/jobs", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") req.Header.Set("Idempotency-Key", "prices-2026-11-25") client := &http.Client{Timeout: 30 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["id"], data["status"]) } ```require "json" require "net/http" uri = URI("https://api.virginproxy.com/v1/jobs") req = Net::HTTP::Post.new(uri) req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY") req["Content-Type"] = "application/json" req["Idempotency-Key"] = "prices-2026-11-25" req.body = JSON.generate({ "requests" => [ { "url" => "https://shop.example/product/42" }, { "url" => "https://shop.example/product/43" }, { "url" => "https://shop.example/product/44" }, ], "request" => { "extract" => { "price" => { "selector" => "[itemprop=price]", "attr" => "content", "type" => "number", }, "title" => "h1", }, }, "webhook" => { "url" => "https://example.com/hooks/virginproxy", "events" => ["done"], }, "tag" => "prices/nightly", }) res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 30) { |http| http.request(req) } data = JSON.parse(res.body) abort(data["error"]["code"] + ": " + data["error"]["message"]) unless res.is_a?(Net::HTTPSuccess) puts [data["id"], data["status"]].join(" ")``import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class Main { public static void main(String[] args) throws Exception { String payload = """ { "requests": [ { "url": "https://shop.example/product/42" }, { "url": "https://shop.example/product/43" }, { "url": "https://shop.example/product/44" } ], "request": { "extract": { "price": { "selector": "[itemprop=price]", "attr": "content", "type": "number" }, "title": "h1" } }, "webhook": { "url": "https://example.com/hooks/virginproxy", "events": [ "done" ] }, "tag": "prices/nightly" } """; HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/jobs")) .header("Authorization", "Bearer " + System.getenv("VP_KEY")) .header("Content-Type", "application/json") .header("Idempotency-Key", "prices-2026-11-25") .timeout(Duration.ofSeconds(30)) .POST(HttpRequest.BodyPublishers.ofString(payload)) .build(); HttpResponse res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()); if (res.statusCode() >= 300) { System.err.println(res.statusCode() + " " + res.body()); // the error object: code, message System.exit(1); } System.out.println(res.body()); // JSON: read it with the JSON library of your choice } }``using System.Net.Http.Headers; using System.Text; using System.Text.Json; using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(30) }; http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY")); var payload = """ { "requests": [ { "url": "https://shop.example/product/42" }, { "url": "https://shop.example/product/43" }, { "url": "https://shop.example/product/44" } ], "request": { "extract": { "price": { "selector": "[itemprop=price]", "attr": "content", "type": "number" }, "title": "h1" } }, "webhook": { "url": "https://example.com/hooks/virginproxy", "events": [ "done" ] }, "tag": "prices/nightly" } """; var req = new HttpRequestMessage(HttpMethod.Post, "https://api.virginproxy.com/v1/jobs"); req.Headers.Add("Idempotency-Key", "prices-2026-11-25"); req.Content = new StringContent(payload, Encoding.UTF8, "application/json"); var res = await http.SendAsync(req); using var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); if (!res.IsSuccessStatusCode) { var e = data.RootElement.GetProperty("error"); Console.Error.WriteLine(e.GetProperty("code") + ": " + e.GetProperty("message")); Environment.Exit(1); } Console.WriteLine(data.RootElement.GetProperty("id") + " " + data.RootElement.GetProperty("status"));`POST`/v1/jobs`[≈ 3 credits](https://docs.virginproxy.com/billing/#cost) 2. Get told when it is doneThe `done` event arrives as a signed POST at your URL ([job.done](https://docs.virginproxy.com/webhooks/#event-done)). [Check the signature](https://docs.virginproxy.com/webhooks/#verify) – or paste a delivery into the [signature check](https://docs.virginproxy.com/webhooks/#check-signature) while you build it – and answer 200 at once. 3. Download the results as CSVOne row per product; `extracted` is a JSON column with `price` and `title`. Leave out the page bodies to keep the file small: Download as CSV`curl "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/export?format=csv&include_body=false" \ -H "Authorization: Bearer $VP_KEY" \ -o prices-2026-11-25.csv` Products that failed (a timeout, a refusal) can be sent once more with [`POST /v1/jobs/{id}/retry`](https://docs.virginproxy.com/jobs/#retry); only those are run again. More: [Jobs and batches](https://docs.virginproxy.com/jobs/) · [Webhooks](https://docs.virginproxy.com/webhooks/) · [Send again safely](https://docs.virginproxy.com/limits/#idempotency) ## Inventory of a website Find every address of a site, then read a handful of them right away – for an audit, a migration or to feed a search index. 1. List the addresses[Map](https://docs.virginproxy.com/map/) reads the start page and the sitemaps and returns each address once. `search` keeps only those containing a word: cURLPythonNode.jsPython SDKNode SDKPHPGoRubyJavaC#`curl https://api.virginproxy.com/v1/map \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/", "search": "blog", "limit": 500 }'``import os, requests r = requests.post( "https://api.virginproxy.com/v1/map", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={"url": "https://example.com/", "search": "blog", "limit": 500}, timeout=120, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["total"]) print(data["links"][0]["url"])``const res = await fetch("https://api.virginproxy.com/v1/map", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://example.com/", search: "blog", limit: 500 }), signal: AbortSignal.timeout(120_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.total); console.log(data.links[0].url);``from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.call("POST", "/v1/map", {"url": "https://example.com/", "search": "blog", "limit": 500}) print(data)``import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.map({ url: "https://example.com/", search: "blog", limit: 500 }); console.log(data);`` true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 120, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://example.com/", "search" => "blog", "limit" => 500, ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["total"], PHP_EOL; echo json_encode($data["links"][0]["url"], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), PHP_EOL;``` package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://example.com/", "search": "blog", "limit": 500 }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/map", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 120 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["total"]) fmt.Println(data["links"].([]any)[0].(map[string]any)["url"]) } ```require "json" require "net/http" uri = URI("https://api.virginproxy.com/v1/map") req = Net::HTTP::Post.new(uri) req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY") req["Content-Type"] = "application/json" req.body = JSON.generate({ "url" => "https://example.com/", "search" => "blog", "limit" => 500, }) res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 120) { |http| http.request(req) } data = JSON.parse(res.body) abort(data["error"]["code"] + ": " + data["error"]["message"]) unless res.is_a?(Net::HTTPSuccess) puts data["total"] puts JSON.pretty_generate(data["links"][0]["url"])``import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class Main { public static void main(String[] args) throws Exception { String payload = """ { "url": "https://example.com/", "search": "blog", "limit": 500 } """; HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/map")) .header("Authorization", "Bearer " + System.getenv("VP_KEY")) .header("Content-Type", "application/json") .timeout(Duration.ofSeconds(120)) .POST(HttpRequest.BodyPublishers.ofString(payload)) .build(); HttpResponse res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()); if (res.statusCode() >= 300) { System.err.println(res.statusCode() + " " + res.body()); // the error object: code, message System.exit(1); } System.out.println(res.body()); // JSON: read it with the JSON library of your choice } }``using System.Net.Http.Headers; using System.Text; using System.Text.Json; using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(120) }; http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY")); var payload = """ { "url": "https://example.com/", "search": "blog", "limit": 500 } """; var req = new HttpRequestMessage(HttpMethod.Post, "https://api.virginproxy.com/v1/map"); req.Content = new StringContent(payload, Encoding.UTF8, "application/json"); var res = await http.SendAsync(req); using var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); if (!res.IsSuccessStatusCode) { var e = data.RootElement.GetProperty("error"); Console.Error.WriteLine(e.GetProperty("code") + ": " + e.GetProperty("message")); Environment.Exit(1); } Console.WriteLine(data.RootElement.GetProperty("total")); Console.WriteLine(data.RootElement.GetProperty("links")[0].GetProperty("url"));`POST`/v1/map` 2. Read a few of them at oncePass the first addresses to a [batch](https://docs.virginproxy.com/jobs/#batch): they run at the same time and the answer comes when all are done. A batch takes up to your plan's batch limit (`requests_per_batch` in [GET /v1/account](https://docs.virginproxy.com/account/#account)); for more addresses, use a job as in the recipe above. cURLPythonNode.jsPython SDKNode SDKPHPGoRubyJavaC#`curl https://api.virginproxy.com/v1/batch \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "urls": [ "https://example.com/blog/first-post", "https://example.com/blog/second-post" ], "request": { "format": "markdown", "main_content": true } }'``import os, requests r = requests.post( "https://api.virginproxy.com/v1/batch", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "urls": [ "https://example.com/blog/first-post", "https://example.com/blog/second-post", ], "request": {"format": "markdown", "main_content": True}, }, timeout=120, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["succeeded"], data["failed"], data["cost"]["credits"])``const res = await fetch("https://api.virginproxy.com/v1/batch", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ urls: [ "https://example.com/blog/first-post", "https://example.com/blog/second-post", ], request: { format: "markdown", main_content: true }, }), signal: AbortSignal.timeout(120_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.succeeded, data.failed, data.cost.credits);``from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.call("POST", "/v1/batch", { "urls": [ "https://example.com/blog/first-post", "https://example.com/blog/second-post", ], "request": {"format": "markdown", "main_content": True}, }) print(data)``import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.batch({ urls: [ "https://example.com/blog/first-post", "https://example.com/blog/second-post", ], request: { format: "markdown", main_content: true }, }); console.log(data);`` true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 120, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "urls" => [ "https://example.com/blog/first-post", "https://example.com/blog/second-post", ], "request" => ["format" => "markdown", "main_content" => true], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["succeeded"], " ", $data["failed"], " ", $data["cost"]["credits"], PHP_EOL;``` package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "urls": [ "https://example.com/blog/first-post", "https://example.com/blog/second-post" ], "request": { "format": "markdown", "main_content": true } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/batch", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 120 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["succeeded"], data["failed"], data["cost"].(map[string]any)["credits"]) } ```require "json" require "net/http" uri = URI("https://api.virginproxy.com/v1/batch") req = Net::HTTP::Post.new(uri) req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY") req["Content-Type"] = "application/json" req.body = JSON.generate({ "urls" => [ "https://example.com/blog/first-post", "https://example.com/blog/second-post", ], "request" => { "format" => "markdown", "main_content" => true }, }) res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 120) { |http| http.request(req) } data = JSON.parse(res.body) abort(data["error"]["code"] + ": " + data["error"]["message"]) unless res.is_a?(Net::HTTPSuccess) puts [data["succeeded"], data["failed"], data["cost"]["credits"]].join(" ")``import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class Main { public static void main(String[] args) throws Exception { String payload = """ { "urls": [ "https://example.com/blog/first-post", "https://example.com/blog/second-post" ], "request": { "format": "markdown", "main_content": true } } """; HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/batch")) .header("Authorization", "Bearer " + System.getenv("VP_KEY")) .header("Content-Type", "application/json") .timeout(Duration.ofSeconds(120)) .POST(HttpRequest.BodyPublishers.ofString(payload)) .build(); HttpResponse res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()); if (res.statusCode() >= 300) { System.err.println(res.statusCode() + " " + res.body()); // the error object: code, message System.exit(1); } System.out.println(res.body()); // JSON: read it with the JSON library of your choice } }``using System.Net.Http.Headers; using System.Text; using System.Text.Json; using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(120) }; http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY")); var payload = """ { "urls": [ "https://example.com/blog/first-post", "https://example.com/blog/second-post" ], "request": { "format": "markdown", "main_content": true } } """; var req = new HttpRequestMessage(HttpMethod.Post, "https://api.virginproxy.com/v1/batch"); req.Content = new StringContent(payload, Encoding.UTF8, "application/json"); var res = await http.SendAsync(req); using var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); if (!res.IsSuccessStatusCode) { var e = data.RootElement.GetProperty("error"); Console.Error.WriteLine(e.GetProperty("code") + ": " + e.GetProperty("message")); Environment.Exit(1); } Console.WriteLine(data.RootElement.GetProperty("succeeded") + " " + data.RootElement.GetProperty("failed") + " " + data.RootElement.GetProperty("cost").GetProperty("credits"));`POST`/v1/batch`[≈ 2 credits](https://docs.virginproxy.com/billing/#cost) More: [Map a website](https://docs.virginproxy.com/map/) · [Batches](https://docs.virginproxy.com/jobs/#batch) · [Output formats](https://docs.virginproxy.com/formats/) ## Crawl a site and keep it as a file Follow the links of a site up to a depth you choose, as Markdown, and download everything as one file when it is done. 1. Start the crawlA [crawl](https://docs.virginproxy.com/crawl/) is a job: it runs in the background, its pages are ordinary requests, and `max_pages` and `max_credits` bound what it can cost. cURLPythonNode.jsPython SDKNode SDKPHPGoRubyJavaC#`curl https://api.virginproxy.com/v1/crawl \ -H "Authorization: Bearer $VP_KEY" \ -H "Idempotency-Key: docs-crawl-2026-11-25" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/", "max_pages": 50, "max_depth": 2, "include_paths": [ "/docs/**" ], "request": { "format": "markdown", "main_content": true }, "max_credits": 100 }'``import os, requests r = requests.post( "https://api.virginproxy.com/v1/crawl", headers={"Authorization": "Bearer " + os.environ["VP_KEY"], "Idempotency-Key": "docs-crawl-2026-11-25"}, json={ "url": "https://example.com/", "max_pages": 50, "max_depth": 2, "include_paths": ["/docs/**"], "request": {"format": "markdown", "main_content": True}, "max_credits": 100, }, timeout=30, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["id"], data["status"])``const res = await fetch("https://api.virginproxy.com/v1/crawl", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json", "Idempotency-Key": "docs-crawl-2026-11-25" }, body: JSON.stringify({ url: "https://example.com/", max_pages: 50, max_depth: 2, include_paths: ["/docs/**"], request: { format: "markdown", main_content: true }, max_credits: 100, }), signal: AbortSignal.timeout(30_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.id, data.status);``from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.call("POST", "/v1/crawl", { "url": "https://example.com/", "max_pages": 50, "max_depth": 2, "include_paths": ["/docs/**"], "request": {"format": "markdown", "main_content": True}, "max_credits": 100, }) print(data)``import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.crawl({ url: "https://example.com/", max_pages: 50, max_depth: 2, include_paths: ["/docs/**"], request: { format: "markdown", main_content: true }, max_credits: 100, }); console.log(data);`` true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", "Idempotency-Key: docs-crawl-2026-11-25", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://example.com/", "max_pages" => 50, "max_depth" => 2, "include_paths" => ["/docs/**"], "request" => ["format" => "markdown", "main_content" => true], "max_credits" => 100, ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["id"], " ", $data["status"], PHP_EOL;``` package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://example.com/", "max_pages": 50, "max_depth": 2, "include_paths": [ "/docs/**" ], "request": { "format": "markdown", "main_content": true }, "max_credits": 100 }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/crawl", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") req.Header.Set("Idempotency-Key", "docs-crawl-2026-11-25") client := &http.Client{Timeout: 30 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["id"], data["status"]) } ```require "json" require "net/http" uri = URI("https://api.virginproxy.com/v1/crawl") req = Net::HTTP::Post.new(uri) req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY") req["Content-Type"] = "application/json" req["Idempotency-Key"] = "docs-crawl-2026-11-25" req.body = JSON.generate({ "url" => "https://example.com/", "max_pages" => 50, "max_depth" => 2, "include_paths" => ["/docs/**"], "request" => { "format" => "markdown", "main_content" => true }, "max_credits" => 100, }) res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 30) { |http| http.request(req) } data = JSON.parse(res.body) abort(data["error"]["code"] + ": " + data["error"]["message"]) unless res.is_a?(Net::HTTPSuccess) puts [data["id"], data["status"]].join(" ")``import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class Main { public static void main(String[] args) throws Exception { String payload = """ { "url": "https://example.com/", "max_pages": 50, "max_depth": 2, "include_paths": [ "/docs/**" ], "request": { "format": "markdown", "main_content": true }, "max_credits": 100 } """; HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/crawl")) .header("Authorization", "Bearer " + System.getenv("VP_KEY")) .header("Content-Type", "application/json") .header("Idempotency-Key", "docs-crawl-2026-11-25") .timeout(Duration.ofSeconds(30)) .POST(HttpRequest.BodyPublishers.ofString(payload)) .build(); HttpResponse res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()); if (res.statusCode() >= 300) { System.err.println(res.statusCode() + " " + res.body()); // the error object: code, message System.exit(1); } System.out.println(res.body()); // JSON: read it with the JSON library of your choice } }``using System.Net.Http.Headers; using System.Text; using System.Text.Json; using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(30) }; http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY")); var payload = """ { "url": "https://example.com/", "max_pages": 50, "max_depth": 2, "include_paths": [ "/docs/**" ], "request": { "format": "markdown", "main_content": true }, "max_credits": 100 } """; var req = new HttpRequestMessage(HttpMethod.Post, "https://api.virginproxy.com/v1/crawl"); req.Headers.Add("Idempotency-Key", "docs-crawl-2026-11-25"); req.Content = new StringContent(payload, Encoding.UTF8, "application/json"); var res = await http.SendAsync(req); using var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); if (!res.IsSuccessStatusCode) { var e = data.RootElement.GetProperty("error"); Console.Error.WriteLine(e.GetProperty("code") + ": " + e.GetProperty("message")); Environment.Exit(1); } Console.WriteLine(data.RootElement.GetProperty("id") + " " + data.RootElement.GetProperty("status"));`POST`/v1/crawl` 2. Download the pagesAs NDJSON – one page per line with its URL, depth and Markdown – while it runs (what is done so far) or up to 24 hours after it ended: Download as NDJSON`curl "https://api.virginproxy.com/v1/jobs/job_RZ0SqikbW5KDPAbikfrL/export?format=ndjson" \ -H "Authorization: Bearer $VP_KEY" \ -o site.ndjson` More: [Crawl a website](https://docs.virginproxy.com/crawl/) · [Download all results](https://docs.virginproxy.com/jobs/#export) ## An AI agent with its own budget Let an agent browse through the MCP server with a key that can only send requests and stops at a sum you choose. 1. Make a key for the agentOnly `requests` (it cannot read your request log or manage keys), a credit limit for the period and a daily limit. Do it under [API keys](https://dash.virginproxy.com/keys), or with a key that has `manage`: cURLPythonNode.jsPython SDKNode SDKPHPGoRubyJavaC#`curl https://api.virginproxy.com/v1/keys \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "research-agent", "scopes": [ "requests" ], "credit_limit": 2000, "daily_limit": 200 }'``import os, requests r = requests.post( "https://api.virginproxy.com/v1/keys", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "name": "research-agent", "scopes": ["requests"], "credit_limit": 2000, "daily_limit": 200, }, timeout=30, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["key"])``const res = await fetch("https://api.virginproxy.com/v1/keys", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ name: "research-agent", scopes: ["requests"], credit_limit: 2000, daily_limit: 200, }), signal: AbortSignal.timeout(30_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.key);``from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.call("POST", "/v1/keys", { "name": "research-agent", "scopes": ["requests"], "credit_limit": 2000, "daily_limit": 200, }) print(data)``import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.call("POST", "/v1/keys", { body: { name: "research-agent", scopes: ["requests"], credit_limit: 2000, daily_limit: 200, } }); console.log(data);`` true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "name" => "research-agent", "scopes" => ["requests"], "credit_limit" => 2000, "daily_limit" => 200, ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["key"], PHP_EOL;``` package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "name": "research-agent", "scopes": [ "requests" ], "credit_limit": 2000, "daily_limit": 200 }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/keys", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 30 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["key"]) } ```require "json" require "net/http" uri = URI("https://api.virginproxy.com/v1/keys") req = Net::HTTP::Post.new(uri) req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY") req["Content-Type"] = "application/json" req.body = JSON.generate({ "name" => "research-agent", "scopes" => ["requests"], "credit_limit" => 2000, "daily_limit" => 200, }) res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 30) { |http| http.request(req) } data = JSON.parse(res.body) abort(data["error"]["code"] + ": " + data["error"]["message"]) unless res.is_a?(Net::HTTPSuccess) puts data["key"]``import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class Main { public static void main(String[] args) throws Exception { String payload = """ { "name": "research-agent", "scopes": [ "requests" ], "credit_limit": 2000, "daily_limit": 200 } """; HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/keys")) .header("Authorization", "Bearer " + System.getenv("VP_KEY")) .header("Content-Type", "application/json") .timeout(Duration.ofSeconds(30)) .POST(HttpRequest.BodyPublishers.ofString(payload)) .build(); HttpResponse res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()); if (res.statusCode() >= 300) { System.err.println(res.statusCode() + " " + res.body()); // the error object: code, message System.exit(1); } System.out.println(res.body()); // JSON: read it with the JSON library of your choice } }``using System.Net.Http.Headers; using System.Text; using System.Text.Json; using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(30) }; http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY")); var payload = """ { "name": "research-agent", "scopes": [ "requests" ], "credit_limit": 2000, "daily_limit": 200 } """; var req = new HttpRequestMessage(HttpMethod.Post, "https://api.virginproxy.com/v1/keys"); req.Content = new StringContent(payload, Encoding.UTF8, "application/json"); var res = await http.SendAsync(req); using var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); if (!res.IsSuccessStatusCode) { var e = data.RootElement.GetProperty("error"); Console.Error.WriteLine(e.GetProperty("code") + ": " + e.GetProperty("message")); Environment.Exit(1); } Console.WriteLine(data.RootElement.GetProperty("key"));`POST`/v1/keys` 2. Connect the agentPut the new key into your MCP client's configuration: MCP client configuration (JSON)`{ "mcpServers": { "virginproxy": { "url": "https://api.virginproxy.com/mcp", "headers": { "Authorization": "Bearer vp_live_…" } } } }` When the agent reaches a limit, its calls end with `key_limit_reached` or `daily_limit_reached` (402) and nothing more is charged; your other keys go on. Use a [test key](https://docs.virginproxy.com/test-mode/) while you build the agent: same tools, sample answers, never charged. More: [AI agents and LLM tools](https://docs.virginproxy.com/ai-agents/) · [Key permissions](https://docs.virginproxy.com/security/#scopes) · [Daily caps](https://docs.virginproxy.com/security/#daily-cap) ## Watch prices every hour, hear only about changes Save how to read a product page once, let a schedule read your product list every hour with a cost cap, and get a webhook only for pages whose price changed. 1. Save how to read the pageA [preset](https://docs.virginproxy.com/automation/#presets) holds the render and extraction options; requests and schedules use it by name. cURLPythonNode.jsPython SDKNode SDKPHPGoRubyJavaC#`curl https://api.virginproxy.com/v1/presets \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "shop-product", "request": { "render": { "wait_for": ".price" }, "extract": { "price": { "selector": ".price", "type": "number" } } } }'``import os, requests r = requests.post( "https://api.virginproxy.com/v1/presets", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "name": "shop-product", "request": { "render": {"wait_for": ".price"}, "extract": {"price": {"selector": ".price", "type": "number"}}, }, }, timeout=30, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["status"], data["cost"]["credits"])``const res = await fetch("https://api.virginproxy.com/v1/presets", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ name: "shop-product", request: { render: { wait_for: ".price" }, extract: { price: { selector: ".price", type: "number" } }, }, }), signal: AbortSignal.timeout(30_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.status, data.cost.credits);``from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.call("POST", "/v1/presets", { "name": "shop-product", "request": { "render": {"wait_for": ".price"}, "extract": {"price": {"selector": ".price", "type": "number"}}, }, }) print(data)``import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.call("POST", "/v1/presets", { body: { name: "shop-product", request: { render: { wait_for: ".price" }, extract: { price: { selector: ".price", type: "number" } }, }, } }); console.log(data);`` true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "name" => "shop-product", "request" => [ "render" => ["wait_for" => ".price"], "extract" => ["price" => ["selector" => ".price", "type" => "number"]], ], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["status"], " ", $data["cost"]["credits"], PHP_EOL;``` package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "name": "shop-product", "request": { "render": { "wait_for": ".price" }, "extract": { "price": { "selector": ".price", "type": "number" } } } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/presets", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 30 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["status"], data["cost"].(map[string]any)["credits"]) } ```require "json" require "net/http" uri = URI("https://api.virginproxy.com/v1/presets") req = Net::HTTP::Post.new(uri) req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY") req["Content-Type"] = "application/json" req.body = JSON.generate({ "name" => "shop-product", "request" => { "render" => { "wait_for" => ".price" }, "extract" => { "price" => { "selector" => ".price", "type" => "number" } }, }, }) res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 30) { |http| http.request(req) } data = JSON.parse(res.body) abort(data["error"]["code"] + ": " + data["error"]["message"]) unless res.is_a?(Net::HTTPSuccess) puts [data["status"], data["cost"]["credits"]].join(" ")``import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class Main { public static void main(String[] args) throws Exception { String payload = """ { "name": "shop-product", "request": { "render": { "wait_for": ".price" }, "extract": { "price": { "selector": ".price", "type": "number" } } } } """; HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/presets")) .header("Authorization", "Bearer " + System.getenv("VP_KEY")) .header("Content-Type", "application/json") .timeout(Duration.ofSeconds(30)) .POST(HttpRequest.BodyPublishers.ofString(payload)) .build(); HttpResponse res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()); if (res.statusCode() >= 300) { System.err.println(res.statusCode() + " " + res.body()); // the error object: code, message System.exit(1); } System.out.println(res.body()); // JSON: read it with the JSON library of your choice } }``using System.Net.Http.Headers; using System.Text; using System.Text.Json; using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(30) }; http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY")); var payload = """ { "name": "shop-product", "request": { "render": { "wait_for": ".price" }, "extract": { "price": { "selector": ".price", "type": "number" } } } } """; var req = new HttpRequestMessage(HttpMethod.Post, "https://api.virginproxy.com/v1/presets"); req.Content = new StringContent(payload, Encoding.UTF8, "application/json"); var res = await http.SendAsync(req); using var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); if (!res.IsSuccessStatusCode) { var e = data.RootElement.GetProperty("error"); Console.Error.WriteLine(e.GetProperty("code") + ": " + e.GetProperty("message")); Environment.Exit(1); } Console.WriteLine(data.RootElement.GetProperty("status") + " " + data.RootElement.GetProperty("cost").GetProperty("credits"));`POST`/v1/presets` 2. Schedule the listEvery hour, at most 200 credits per run. `track_changes` compares what was read with the last run; `item.changed` sends only the pages that changed. cURLPythonNode.jsPython SDKNode SDKPHPGoRubyJavaC#`curl https://api.virginproxy.com/v1/schedules \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Prices", "every": "1h", "max_credits": 200, "job": { "urls": [ "https://shop.example/p/1", "https://shop.example/p/2" ], "defaults": { "preset": "shop-product", "track_changes": { "on": "extracted" } }, "webhook": { "url": "https://your-server.example/hooks/virginproxy", "events": [ "item.changed" ] } } }'``import os, requests r = requests.post( "https://api.virginproxy.com/v1/schedules", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "name": "Prices", "every": "1h", "max_credits": 200, "job": { "urls": ["https://shop.example/p/1", "https://shop.example/p/2"], "defaults": {"preset": "shop-product", "track_changes": {"on": "extracted"}}, "webhook": { "url": "https://your-server.example/hooks/virginproxy", "events": ["item.changed"], }, }, }, timeout=30, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["status"], data["cost"]["credits"])``const res = await fetch("https://api.virginproxy.com/v1/schedules", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ name: "Prices", every: "1h", max_credits: 200, job: { urls: ["https://shop.example/p/1", "https://shop.example/p/2"], defaults: { preset: "shop-product", track_changes: { on: "extracted" } }, webhook: { url: "https://your-server.example/hooks/virginproxy", events: ["item.changed"], }, }, }), signal: AbortSignal.timeout(30_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.status, data.cost.credits);``from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.create_schedule({ "name": "Prices", "every": "1h", "max_credits": 200, "job": { "urls": ["https://shop.example/p/1", "https://shop.example/p/2"], "defaults": {"preset": "shop-product", "track_changes": {"on": "extracted"}}, "webhook": { "url": "https://your-server.example/hooks/virginproxy", "events": ["item.changed"], }, }, }) print(data)``import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.createSchedule({ name: "Prices", every: "1h", max_credits: 200, job: { urls: ["https://shop.example/p/1", "https://shop.example/p/2"], defaults: { preset: "shop-product", track_changes: { on: "extracted" } }, webhook: { url: "https://your-server.example/hooks/virginproxy", events: ["item.changed"], }, }, }); console.log(data);`` true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "name" => "Prices", "every" => "1h", "max_credits" => 200, "job" => [ "urls" => ["https://shop.example/p/1", "https://shop.example/p/2"], "defaults" => [ "preset" => "shop-product", "track_changes" => ["on" => "extracted"], ], "webhook" => [ "url" => "https://your-server.example/hooks/virginproxy", "events" => ["item.changed"], ], ], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["status"], " ", $data["cost"]["credits"], PHP_EOL;``` package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "name": "Prices", "every": "1h", "max_credits": 200, "job": { "urls": [ "https://shop.example/p/1", "https://shop.example/p/2" ], "defaults": { "preset": "shop-product", "track_changes": { "on": "extracted" } }, "webhook": { "url": "https://your-server.example/hooks/virginproxy", "events": [ "item.changed" ] } } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/schedules", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 30 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["status"], data["cost"].(map[string]any)["credits"]) } ```require "json" require "net/http" uri = URI("https://api.virginproxy.com/v1/schedules") req = Net::HTTP::Post.new(uri) req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY") req["Content-Type"] = "application/json" req.body = JSON.generate({ "name" => "Prices", "every" => "1h", "max_credits" => 200, "job" => { "urls" => ["https://shop.example/p/1", "https://shop.example/p/2"], "defaults" => { "preset" => "shop-product", "track_changes" => { "on" => "extracted" }, }, "webhook" => { "url" => "https://your-server.example/hooks/virginproxy", "events" => ["item.changed"], }, }, }) res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 30) { |http| http.request(req) } data = JSON.parse(res.body) abort(data["error"]["code"] + ": " + data["error"]["message"]) unless res.is_a?(Net::HTTPSuccess) puts [data["status"], data["cost"]["credits"]].join(" ")``import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class Main { public static void main(String[] args) throws Exception { String payload = """ { "name": "Prices", "every": "1h", "max_credits": 200, "job": { "urls": [ "https://shop.example/p/1", "https://shop.example/p/2" ], "defaults": { "preset": "shop-product", "track_changes": { "on": "extracted" } }, "webhook": { "url": "https://your-server.example/hooks/virginproxy", "events": [ "item.changed" ] } } } """; HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/schedules")) .header("Authorization", "Bearer " + System.getenv("VP_KEY")) .header("Content-Type", "application/json") .timeout(Duration.ofSeconds(30)) .POST(HttpRequest.BodyPublishers.ofString(payload)) .build(); HttpResponse res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()); if (res.statusCode() >= 300) { System.err.println(res.statusCode() + " " + res.body()); // the error object: code, message System.exit(1); } System.out.println(res.body()); // JSON: read it with the JSON library of your choice } }``using System.Net.Http.Headers; using System.Text; using System.Text.Json; using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(30) }; http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY")); var payload = """ { "name": "Prices", "every": "1h", "max_credits": 200, "job": { "urls": [ "https://shop.example/p/1", "https://shop.example/p/2" ], "defaults": { "preset": "shop-product", "track_changes": { "on": "extracted" } }, "webhook": { "url": "https://your-server.example/hooks/virginproxy", "events": [ "item.changed" ] } } } """; var req = new HttpRequestMessage(HttpMethod.Post, "https://api.virginproxy.com/v1/schedules"); req.Content = new StringContent(payload, Encoding.UTF8, "application/json"); var res = await http.SendAsync(req); using var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); if (!res.IsSuccessStatusCode) { var e = data.RootElement.GetProperty("error"); Console.Error.WriteLine(e.GetProperty("code") + ": " + e.GetProperty("message")); Environment.Exit(1); } Console.WriteLine(data.RootElement.GetProperty("status") + " " + data.RootElement.GetProperty("cost").GetProperty("credits"));`POST`/v1/schedules` 3. Read the changeEach webhook carries the answer with `change.status` `"changed"`, the new `extracted.price` and the request it was compared with. The schedule pauses itself (with a notice) when your credits run out. More: [Cache, change tracking, presets and schedules](https://docs.virginproxy.com/automation/) · [Webhooks](https://docs.virginproxy.com/webhooks/) --- # AI agents and LLM tools > Use VirginProxy from AI agents: MCP server for Claude, Cursor and other clients, tool definitions for OpenAI and Anthropic function calling, OpenAPI, llms.txt. Source: https://docs.virginproxy.com/ai-agents/ AI assistants and agents can browse the web through VirginProxy: connect an MCP client with one of your keys or by signing in, or give your model our tool definitions. For reading the documentation itself, every page is also available as Markdown, all of it in one file, and the API as an OpenAPI description. ## MCP server The API is a remote MCP server (Model Context Protocol, transport "Streamable HTTP", stateless). Apps with a sign-in for remote servers, such as Claude.ai and ChatGPT, connect [without a key](#oauth); any other client that supports remote servers connects with a header: | | | | --- | --- | | Address | `https://api.virginproxy.com/mcp` | | Authentication | `Authorization: Bearer vp_live_…` – one of your API keys, or [sign-in with OAuth](#oauth) | | Methods | `tools/list`, `tools/call`, `resources/list`, `resources/read`, `resources/templates/list`, `prompts/list`, `prompts/get`, `server/discover` (and `initialize`, `ping` for older clients) | | Server card | [`https://api.virginproxy.com/mcp/server-card`](https://api.virginproxy.com/mcp/server-card) – no key needed | *MCP client configuration (JSON):* ```json { "mcpServers": { "virginproxy": { "url": "https://api.virginproxy.com/mcp", "headers": { "Authorization": "Bearer vp_live_…" } } } } ``` *Claude Code:* ``` claude mcp add --transport http virginproxy https://api.virginproxy.com/mcp \ --header "Authorization: Bearer $VP_KEY" ``` Many clients (Cursor, VS Code, Windsurf and others) read a configuration in the form above; some name the field `serverUrl` instead of `url`. Put a key of yours where `vp_live_…` stands. ### Connect from Claude.ai, ChatGPT and other apps with sign-in Apps that add remote MCP servers as connectors with a sign-in need no key: 1. In the app, add a custom connector with the address `https://api.virginproxy.com/mcp`. Leave fields for a client ID or secret empty: the app registers itself. 2. The app opens VirginProxy in your browser. Sign in (with your second factor, if you use one). 3. Check which app asks and where it sends you back to, set a credit limit for it if you like, and choose **Allow**. | The app can | The app cannot | | --- | --- | | Read web pages, take screenshots, map and crawl websites with your account's credits (all ${TOOLS.length} tools below) | Change your plan, your payment details or your API keys | | Read your plan, credits, usage and request log | Use any endpoint other than `/mcp` | The connection then appears on the [API keys](https://dash.virginproxy.com/keys) page of the dashboard as a **connected app**. Its tool calls are charged, limited and logged like the calls of any key. Give it a credit limit there (or on the consent screen), or revoke it to end its access at once. There is no key to copy: the app holds short-lived tokens that work only on the MCP server. > **Note:** Allow only an app you are connecting right now. The consent screen warns when an app receives the answer on your own computer or through its own link type instead of a secure web address. ### Sign-in for client developers | | | | --- | --- | | Discovery | A 401 from `/mcp` carries `WWW-Authenticate: Bearer resource_metadata="https://api.virginproxy.com/.well-known/oauth-protected-resource/mcp", scope="mcp"`. Authorization server metadata: [`https://api.virginproxy.com/.well-known/oauth-authorization-server`](https://api.virginproxy.com/.well-known/oauth-authorization-server) | | Registration | `POST https://api.virginproxy.com/oauth/register` (RFC 7591), public clients (`token_endpoint_auth_method: "none"`) or with a secret; redirect URIs https, `http://localhost` / `127.0.0.1` / `[::1]` with any port, or an app's own scheme | | Authorization | Authorization code with PKCE (`S256` only), scope `mcp`, `resource` (RFC 8707) optional and if sent `https://api.virginproxy.com/mcp`; the answer carries `iss` (RFC 9207) | | Tokens | `POST https://api.virginproxy.com/oauth/token`: access tokens valid one hour, refresh tokens valid 30 days and replaced on every use (using a replaced one again ends the sign-in). `POST https://api.virginproxy.com/oauth/revoke` (RFC 7009) | | Use | Send the access token as `Authorization: Bearer …` to `/mcp` only; every other endpoint refuses it | ### Tools | Tool | What it does | REST call | | --- | --- | --- | | `scrape` | Fetch one web page through VirginProxy and return its content, by default as Markdown of the main content (navigation, header and footer removed). | `POST /v1/requests` | | `batch_scrape` | Fetch up to 10 pages in one call, in parallel, and get all answers together (Markdown of the main content by default). | `POST /v1/batch` | | `screenshot` | Load a page in a real browser and return a screenshot of the visible area, the full page or one element. | `GET /v1/screenshot` | | `pdf` | Load a page in a real browser and print it as a PDF (returned as an embedded document). | `GET /v1/pdf` | | `search` | Search DuckDuckGo and get the results as JSON (title, address, snippet, plus ads, related searches and questions where the engine shows them). | `POST /v1/search` | | `map` | Find the addresses of a website: the links on the given page plus the entries of its sitemaps (robots.txt, sitemap.xml). | `POST /v1/map` | | `crawl` | Start a crawl in the background: it reads the start page, follows the links of the same site up to max_depth, and stops at max_pages. | `POST /v1/crawl` | | `export_job` | The results of a job or crawl as NDJSON (one line per page) or CSV, without page bodies unless include_body is true. | `GET /v1/jobs/{id}/export` | | `retry_job` | Starts a new job with the requests of a finished job that failed, exactly as they were sent. | `POST /v1/jobs/{id}/retry` | | `get_job` | Status of a job or crawl and the pages it has finished, 20 at a time (use offset to page through).. | `GET /v1/jobs/{id}/results` | | `list_jobs` | Your recent jobs and crawls, newest first, with their status and counts.. | `GET /v1/jobs` | | `cancel_job` | Cancel a job or crawl: pages that have not started are dropped and not charged; pages already running finish. | `DELETE /v1/jobs/{id}` | | `estimate` | The least and the most credits a scrape with these arguments can cost with your plan, and whether it fits into the credits left. | `POST /v1/estimate` | | `account` | The account's plan, credits left in the current period and its limits.. | `GET /v1/account` | | `usage` | Requests, successful requests, credits and data per day (UTC) for the last days.. | `GET /v1/usage` | | `list_requests` | Your request log, newest first: target, status, error code, credits (not the content). | `GET /v1/requests` | | `limits` | Parallel requests and rate of the plan with their current use, the daily credit cap and the key's limits. | `GET /v1/limits` | | `get_answer` | The answer itself (body, extracted data …) of an earlier request, when it is kept: sent with an Idempotency-Key (24 hours) or cached. | `GET /v1/requests/{id}/answer` | | `list_presets` | The account's presets: named request options to use with the "preset" argument of scrape.. | `GET /v1/presets` | | `get_request` | The figures of one of your requests by its id (req_…): target, status, error, credits, timing.. | `GET /v1/requests/{id}` | Every tool call is an ordinary API call: the same limits, the same credits, the same request log. `scrape` returns Markdown of the main content by default and cuts very long pages after 100,000 characters (with a note). Errors come back as a tool result with `isError`, so the model can read `error.code` and decide. *The same call without a client:* ```bash curl https://api.virginproxy.com/mcp \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "scrape", "arguments": {"url": "https://example.com/"}}}' ``` > **Tip:** Give an agent its own key with a credit limit (dashboard → API keys → Edit). It then cannot spend more than you allow, and its requests are easy to find in the log. ### Resources and prompts Besides tools, the server offers read-only resources and ready-made prompts that clients can show to their users: | Resource | Content | | --- | --- | | `virginproxy://guide` | Which tool for which task, what things cost, how to handle errors – written for a model. | | `virginproxy://errors` | Every error code with its HTTP status and whether to retry. | | `virginproxy://openapi` | The OpenAPI description. | | `virginproxy://account` | Plan, credits left and limits, right now. | | `virginproxy://jobs/{id}` | A job or crawl with its first 20 results. | | `virginproxy://requests/{id}` | One request of your log. | Prompts: `summarize_page` (url, focus), `extract_data` (url, fields) and `research_site` (url, question, max_pages). ### Protocol versions and discovery The server speaks the current revision `2026-07-28` – no handshake; every request names its version in `params._meta` and in the `MCP-Protocol-Version`, `Mcp-Method` and `Mcp-Name` headers, and `server/discover` describes the server – and, for older clients, the revisions with `initialize`: `2025-11-25`, `2025-06-18`, `2025-03-26`, `2024-11-05`. Your client picks what it supports; nothing to configure. Every tool says what it does to your account in its annotations: only `cancel_job` changes something you cannot undo, only `crawl` and `cancel_job` are not read-only. Clients and catalogues can find the server without a key: the server card at [`https://api.virginproxy.com/mcp/server-card`](https://api.virginproxy.com/mcp/server-card), listed in [`/.well-known/ai-catalog.json`](https://api.virginproxy.com/.well-known/ai-catalog.json). > **Tip:** Try a workflow with a [test key](https://docs.virginproxy.com/test-mode/) first: the agent gets sample pages, nothing is fetched and nothing is charged. ## Function calling The same tools as JSON definitions, generated from the same source as the MCP server: | File | For | | --- | --- | | [`/ai/openai-tools.json`](https://docs.virginproxy.com/ai/openai-tools.json) | OpenAI Chat Completions (`tools`) | | [`/ai/openai-responses-tools.json`](https://docs.virginproxy.com/ai/openai-responses-tools.json) | OpenAI Responses API | | [`/ai/anthropic-tools.json`](https://docs.virginproxy.com/ai/anthropic-tools.json) | Anthropic Messages API | | [`/ai/tools.json`](https://docs.virginproxy.com/ai/tools.json) | Each tool with the REST call it stands for (`endpoint`) and its defaults | The arguments of a tool call are the body (or the query) of that REST call, so carrying out a call takes a few lines: *run_tool.py:* ```python import base64, os, requests API = "https://api.virginproxy.com" KEY = os.environ["VP_KEY"] # The tool definitions with the REST call each one stands for. SPEC = requests.get("https://docs.virginproxy.com/ai/tools.json", timeout=30).json() ENDPOINTS = {t["name"]: t["endpoint"] for t in SPEC["tools"]} def run_tool(name, args): """Carries out one tool call of the model and returns what to send back to it.""" ep = ENDPOINTS[name] args = {**ep.get("defaults", {}), **args} path = ep["path"] if "{id}" in path: path = path.replace("{id}", args.pop("id")) headers = {"Authorization": "Bearer " + KEY} if ep["method"] in ("GET", "DELETE"): # query strings: booleans as true/false params = {k: str(v).lower() if isinstance(v, bool) else v for k, v in args.items()} r = requests.request(ep["method"], API + path, params=params, headers=headers, timeout=180) else: r = requests.post(API + path, json=args, headers=headers, timeout=180) if r.headers.get("content-type", "").startswith("image/"): return {"image_base64": base64.b64encode(r.content).decode(), "credits": r.headers.get("X-VP-Credits")} return r.json() # errors too: the model can read error.code and error.message print(run_tool("virginproxy_scrape", {"url": "https://example.com/"})["body"][:200]) ``` **OpenAI (Python)** ```openai-python- from openai import OpenAI import json, requests tools = requests.get("https://docs.virginproxy.com/ai/openai-tools.json", timeout=30).json() client = OpenAI() messages = [{"role": "user", "content": "Summarise https://example.com/ in one sentence."}] reply = client.chat.completions.create( model="gpt-4.1", # any model with tool use messages=messages, tools=tools, ).choices[0].message messages.append(reply) for call in reply.tool_calls or []: result = run_tool(call.function.name, json.loads(call.function.arguments)) # see above messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)[:100000]}) # … then call the model again with messages ``` **Anthropic (Python)** ```anthropic-python- import anthropic, json, requests tools = requests.get("https://docs.virginproxy.com/ai/anthropic-tools.json", timeout=30).json() client = anthropic.Anthropic() messages = [{"role": "user", "content": "Summarise https://example.com/ in one sentence."}] reply = client.messages.create( model="claude-sonnet-4-5", # any model with tool use max_tokens=1024, messages=messages, tools=tools, ) results = [ {"type": "tool_result", "tool_use_id": b.id, "content": json.dumps(run_tool(b.name, b.input))[:100000]} # run_tool: see above for b in reply.content if b.type == "tool_use" ] messages += [{"role": "assistant", "content": reply.content}, {"role": "user", "content": results}] # … then call the model again with messages ``` ## OpenAPI The whole API as an OpenAPI 3.1 description, built from the same lists as this documentation: - [`https://api.virginproxy.com/openapi.json`](https://api.virginproxy.com/openapi.json) and [`/openapi.yaml`](https://api.virginproxy.com/openapi.yaml) – from the API itself, no key needed - [`https://docs.virginproxy.com/openapi.json`](https://docs.virginproxy.com/openapi.json) and [`/openapi.yaml`](https://docs.virginproxy.com/openapi.yaml) Every error code with its HTTP status and whether to retry: [`GET /v1/errors`](https://api.virginproxy.com/v1/errors) (also [`/errors.json`](https://docs.virginproxy.com/errors.json)). ## Documentation for language models | Address | Content | | --- | --- | | [`/llms.txt`](https://docs.virginproxy.com/llms.txt) | A short overview with links to every page as Markdown ([llms.txt](https://llmstxt.org/) format) | | [`/llms-full.txt`](https://docs.virginproxy.com/llms-full.txt) | The whole documentation as one Markdown text | | `//index.md` | Each page as Markdown, e.g. [`/webhooks/index.md`](https://docs.virginproxy.com/webhooks/index.md) or the short form `/webhooks.md` | | `Accept: text/markdown` | Any page address answers with Markdown when a client asks for it | Each page also has buttons to copy it as Markdown or to open it in ChatGPT or Claude. ### The complete documentation of your account After signing in, customers also read the member guides. Hand your AI everything at once, member guides included – with the key in the header, never in the address: | Way | How | | --- | --- | | MCP | Connected clients read the resource `virginproxy://docs` (the complete documentation) next to all tools of your account | | With your key | `GET https://api.virginproxy.com/v1/docs/llms-full.txt` with `Authorization: Bearer vp_live_…`; `GET https://api.virginproxy.com/v1/docs` lists the complete OpenAPI description, error list and tool definitions. Free, not in the request log. | | In the dashboard | [For your AI](https://dash.virginproxy.com/ai): download the files, set up Claude, ChatGPT or Cursor, copy a prompt template | ## Good practice for agents - Check the cost before large work: [POST /v1/estimate](https://docs.virginproxy.com/billing/#estimate-api) runs nothing and charges nothing. - Bound every call with `max_credits`; a crawl with `max_pages`. - Send `Idempotency-Key` when a call may be repeated after a broken connection: the repeat gets the first answer and is not charged again ([Send again safely](https://docs.virginproxy.com/limits/#idempotency)). - Decide by `error.code` and the `retry` advice in the [error list](https://docs.virginproxy.com/errors/); wait `retry_after_ms` (or the `Retry-After` header) when asked to. - Ask for `format: "markdown"` with `main_content: true`: far fewer tokens than HTML. --- # Test mode > Build and test your integration or your agent with test keys (vp_test_…): realistic sample answers with the real checks and limits, nothing fetched, nothing charged. Source: https://docs.virginproxy.com/test-mode/ A test key (`vp_test_…`) works like a live key, but every call gets a realistic sample answer instead of fetching the page. Your options are checked for real, the limits of your plan apply, errors look exactly as they will in production – and nothing is ever charged. ## Get a test key Create one in the [dashboard](https://dash.virginproxy.com/keys) under **API keys** (choose “Test key”), or through the API with a live key: **cURL** ```bash curl https://api.virginproxy.com/v1/keys \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "local development", "mode": "test" }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/keys", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={"name": "local development", "mode": "test"}, timeout=30, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["key"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/keys", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ name: "local development", mode: "test" }), signal: AbortSignal.timeout(30_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.key); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.call("POST", "/v1/keys", {"name": "local development", "mode": "test"}) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.call("POST", "/v1/keys", { body: { name: "local development", mode: "test" } }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode(["name" => "local development", "mode" => "test"], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["key"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "name": "local development", "mode": "test" }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/keys", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 30 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["key"]) } ``` POST`/v1/keys` Use it everywhere a live key goes: `Authorization: Bearer vp_test_…`. Switching to production is changing the key, nothing else. ## What you get *POST /v1/requests with a test key (shortened):* ```json { "id": "req_V3nQ8xLp2KdW7sTm0RcY", "status": 200, "final_url": "https://shop.example/products/1", "format": "markdown", "body": "# Trail Runner 2\n\nThis is a sample answer of the VirginProxy test mode. …", "extracted": { "price": 129 }, "exit": { "ip": "203.0.113.10", "country": "DE" }, "cost": { "credits": 0, "credits_used": 412, "credits_included": 25000 }, "test": true, "…": "…" } ``` - **Pages**: a sample shop page for the host you ask for, with a title, links, a price table, contact details and structured data. `format`, `main_content`, `parse` and the size limit work as usual; `extract` returns sample values of the type you asked for (`"Sample text"`, `129`, `42`, `true`, lists of two). - **Screenshots and PDFs**: a small placeholder picture and a one-page PDF. - **Map and crawl**: a sample site with a robots.txt, a sitemap and a handful of linked pages, so map finds addresses and a crawl grows and ends. - **Jobs, batches and webhooks**: jobs and crawls made with a test key run in the background with sample answers, and their webhooks are really delivered – signed – to your URL. - **MCP and the SDKs**: work with test keys unchanged. - Every answer carries `"test": true` (or the header `X-VP-Test: true` for images, PDFs and raw answers) and `cost.credits` `0`. ## Simulate errors Two query parameters in the target URL steer the sample answer. They are only read in test mode and never sent anywhere. | Parameter | Effect | | --- | --- | | `vp_test_status=404` | The target answers with this HTTP status (100–599). | | `vp_test_error=timeout` | The call fails with this error code, exactly as in production. Possible: `timeout`, `target_unreachable`, `connection_failed`, `tls_error`, `too_many_redirects`, `request_failed`, `busy`, `render_unavailable`, `rate_limited`, `concurrency_limited`, `credits_exhausted`, `maintenance`. | *Test your retry logic:* ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_TEST_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://shop.example/?vp_test_error=busy"}' # → 503 {"error": {"code": "busy", "retry_after_ms": 2000, …}} with Retry-After: 2 ``` ## What is the same, what is different | | Test key | | --- | --- | | Checks of your options | Real: an unknown option, a bad URL or a value out of range is refused as in production. | | Plan rules | Real: what your plan does not include (for example a response larger than its size limit) is refused. | | Rate and parallel limits | Your plan's, in a bucket of their own: testing never slows your live keys down. | | Credits | Never charged; works with an empty balance. | | Request log and usage | Not written: test calls do not appear in the request log or the statistics. The dashboard keeps them apart: its tab **Test calls** shows the last 200 of the past 24 hours (see [below](#test-calls)). | | Keys and webhook settings | Not available with a test key (`key_management_not_allowed`). | ## See your test calls In the [dashboard](https://dash.virginproxy.com/), the tab **Test calls** lists the last 200 calls made with your test keys within the past 24 hours, so you can check what your integration sent and what it got back. Older test calls are not kept, and none of them count towards your usage. > **Note:** Sample answers show the shape of real answers, not the real content of a site. Before going live, run a few calls with a live key against the pages you need. --- # Copy a request from your browser > Copy a request from your browser's developer tools as cURL and send it through VirginProxy: in the playground, by hand or with Python or Node.js. Source: https://docs.virginproxy.com/copy-from-browser/ The quickest way to get a difficult request right is to copy it from your own browser. The developer tools of every major browser can copy a request as a cURL command, with its headers, cookies and body. ## Copy the request | Browser | How | | --- | --- | | Chrome, Edge | Open the developer tools (F12, or Ctrl+Shift+I; on a Mac Cmd+Option+I), go to **Network** and reload the page. Right-click the request, then **Copy** › **Copy as cURL**. On Windows choose **Copy as cURL (bash)**. | | Firefox | Developer tools › **Network**, right-click the request › **Copy Value** › **Copy as cURL**. | | Safari | Turn on the developer features under Settings › Advanced. Then Web Inspector › **Network**, right-click the request › **Copy as cURL**. | For a page, copy the first request of type "document". For data that a page loads afterwards, filter by "Fetch/XHR" and pick the request whose response holds the data. ## Import it in the playground In the playground of the [dashboard](https://dash.virginproxy.com/), paste the command into the cURL import. Method, URL, query parameters, headers, cookies and body are filled in; you can send the request at once and copy it as code for your language. ## Translate it by hand | In the cURL command | In the API request | | --- | --- | | the URL | `url` (or `url` plus `params`) | | `-X POST` | `method` | | `-H 'name: value'` | `headers` | | `-b 'a=1; b=2'` or `-H 'cookie: …'` | `headers.Cookie` or `cookies` | | `--data-raw '…'` | `body` (or `json` when it is JSON); the method becomes POST | | `--compressed` | nothing: the browser profile takes care of it | ### Which headers to keep - Keep what belongs to the site: `Cookie`, `Authorization`, `Referer`, `Origin`, `Content-Type` and the site's own `X-…` headers, such as CSRF tokens. - Leave out what belongs to the browser: `User-Agent`, `sec-ch-ua…`, `Sec-Fetch-…`, `Accept-Encoding`, `Accept-Language` and `Priority`. Choose the matching `browser` and `locale` instead; they set all of these consistently. A request copied from Chrome on Windows, for example, becomes: **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://shop.example/api/cart", "method": "POST", "browser": "chrome", "locale": "en-GB", "headers": { "Cookie": "session-id=…; consent=yes", "Referer": "https://shop.example/product/42", "Origin": "https://shop.example", "X-CSRF-Token": "…" }, "json": { "product": 42, "quantity": 1 }, "session": "shop-visitor-1" }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://shop.example/api/cart", "method": "POST", "browser": "chrome", "locale": "en-GB", "headers": { "Cookie": "session-id=…; consent=yes", "Referer": "https://shop.example/product/42", "Origin": "https://shop.example", "X-CSRF-Token": "…", }, "json": {"product": 42, "quantity": 1}, "session": "shop-visitor-1", }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["status"], data["body"][:200]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://shop.example/api/cart", method: "POST", browser: "chrome", locale: "en-GB", headers: { Cookie: "session-id=…; consent=yes", Referer: "https://shop.example/product/42", Origin: "https://shop.example", "X-CSRF-Token": "…", }, json: { product: 42, quantity: 1 }, session: "shop-visitor-1", }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.status, data.body.slice(0, 200)); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://shop.example/api/cart", "method": "POST", "browser": "chrome", "locale": "en-GB", "headers": { "Cookie": "session-id=…; consent=yes", "Referer": "https://shop.example/product/42", "Origin": "https://shop.example", "X-CSRF-Token": "…", }, "json": {"product": 42, "quantity": 1}, "session": "shop-visitor-1", }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://shop.example/api/cart", method: "POST", browser: "chrome", locale: "en-GB", headers: { Cookie: "session-id=…; consent=yes", Referer: "https://shop.example/product/42", Origin: "https://shop.example", "X-CSRF-Token": "…", }, json: { product: 42, quantity: 1 }, session: "shop-visitor-1", }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://shop.example/api/cart", "method" => "POST", "browser" => "chrome", "locale" => "en-GB", "headers" => [ "Cookie" => "session-id=…; consent=yes", "Referer" => "https://shop.example/product/42", "Origin" => "https://shop.example", "X-CSRF-Token" => "…", ], "json" => ["product" => 42, "quantity" => 1], "session" => "shop-visitor-1", ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["status"], " ", $data["body"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://shop.example/api/cart", "method": "POST", "browser": "chrome", "locale": "en-GB", "headers": { "Cookie": "session-id=…; consent=yes", "Referer": "https://shop.example/product/42", "Origin": "https://shop.example", "X-CSRF-Token": "…" }, "json": { "product": 42, "quantity": 1 }, "session": "shop-visitor-1" }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["status"], data["body"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL3Nob3AuZXhhbXBsZS9hcGkvY2FydCIsIm1ldGhvZCI6IlBPU1QiLCJicm93c2VyIjoiY2hyb21lIiwibG9jYWxlIjoiZW4tR0IiLCJoZWFkZXJzIjp7IkNvb2tpZSI6InNlc3Npb24taWQ94oCmOyBjb25zZW50PXllcyIsIlJlZmVyZXIiOiJodHRwczovL3Nob3AuZXhhbXBsZS9wcm9kdWN0LzQyIiwiT3JpZ2luIjoiaHR0cHM6Ly9zaG9wLmV4YW1wbGUiLCJYLUNTUkYtVG9rZW4iOiLigKYifSwianNvbiI6eyJwcm9kdWN0Ijo0MiwicXVhbnRpdHkiOjF9LCJzZXNzaW9uIjoic2hvcC12aXNpdG9yLTEifQ) ## Convert it in code These small functions turn a copied cURL command into a request for the API. They cover what browsers produce for ordinary requests; for commands with `$'…'` quoting, copy the request again with the bash variant or translate it by hand. **Python** ```python import shlex BROWSER_HEADERS = {"user-agent", "accept-encoding", "accept-language", "priority", "connection"} def curl_to_request(command): args = shlex.split(command.replace("\\\n", " ")) req, headers, i = {"method": "GET"}, {}, 1 while i < len(args): a = args[i] value = args[i + 1] if i + 1 < len(args) else "" if a in ("-X", "--request"): req["method"], i = value.upper(), i + 1 elif a in ("-H", "--header"): name, _, v = value.partition(":") low = name.strip().lower() if low not in BROWSER_HEADERS and not low.startswith(("sec-ch-ua", "sec-fetch-")): headers[name.strip()] = v.strip() i += 1 elif a in ("-b", "--cookie"): headers["Cookie"], i = value, i + 1 elif a in ("-d", "--data", "--data-raw", "--data-binary"): req["body"], i = value, i + 1 if req["method"] == "GET": req["method"] = "POST" elif a.startswith("http"): req["url"] = a i += 1 if headers: req["headers"] = headers return req ``` **Node.js** ```javascript const BROWSER_HEADERS = new Set(["user-agent", "accept-encoding", "accept-language", "priority", "connection"]); function words(cmd) { const out = []; let cur = "", quote = null, started = false; cmd = cmd.replace(/\\\r?\n/g, " "); for (let i = 0; i < cmd.length; i++) { const ch = cmd[i]; if (quote) { if (ch === quote) quote = null; else if (ch === "\\" && quote === '"') cur += cmd[++i]; else cur += ch; } else if (ch === "'" || ch === '"') { quote = ch; started = true; } else if (/\s/.test(ch)) { if (cur || started) out.push(cur); cur = ""; started = false; } else if (ch === "\\") cur += cmd[++i]; else cur += ch; } if (cur || started) out.push(cur); return out; } export function curlToRequest(command) { const args = words(command); const req = { method: "GET" }, headers = {}; for (let i = 1; i < args.length; i++) { const a = args[i], value = args[i + 1] ?? ""; if (a === "-X" || a === "--request") { req.method = value.toUpperCase(); i++; } else if (a === "-H" || a === "--header") { const at = value.indexOf(":"); const name = value.slice(0, at).trim(), low = name.toLowerCase(); if (!BROWSER_HEADERS.has(low) && !low.startsWith("sec-ch-ua") && !low.startsWith("sec-fetch-")) headers[name] = value.slice(at + 1).trim(); i++; } else if (a === "-b" || a === "--cookie") { headers.Cookie = value; i++; } else if (["-d", "--data", "--data-raw", "--data-binary"].includes(a)) { req.body = value; i++; if (req.method === "GET") req.method = "POST"; } else if (a.startsWith("http")) req.url = a; } if (Object.keys(headers).length) req.headers = headers; return req; } ``` Add `browser`, `locale` and, for several requests in a row, `session` to the result before you send it. > **Note:** A copied request contains your cookies, and with them your login. Treat it like a password: do not paste it into public places or share it. Use only your own logins, and respect the terms of use of the site. --- # Changelog > What changed in the VirginProxy API: new endpoints, options and error codes, newest first. Also as JSON Feed and Atom. Source: https://docs.virginproxy.com/changelog/ New endpoints, options and error codes, newest first. Changes never break what you already use: new fields can appear in answers, so let your code ignore fields it does not know. Follow it in a feed reader or a script: [Atom](https://docs.virginproxy.com/changelog.xml) · [JSON Feed](https://docs.virginproxy.com/changelog.json). ## Search API, monitors, delivery to your storage, automatic extraction, documents, render "auto", CLI and integrations 28 November 2026 - [POST /v1/search](https://docs.virginproxy.com/search/): web search results as JSON, with `scrape` every result fetched too. MCP tool `search`. New error codes `invalid_query`, `search_failed`. - [Monitors](https://docs.virginproxy.com/monitors/): schedules with a rhythm in words (`"weekdays at 09:30"`), `track: "pages"`, e-mail or webhook (`alert.monitor_changed`) when pages appear, disappear or change, `GET /v1/schedules/{id}/reports`, `POST /v1/schedules/preview`. - [Delivery to your own storage](https://docs.virginproxy.com/delivery/): `/v1/destinations` for S3-compatible buckets (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO …), `delivery` on jobs, crawls and schedules. Error codes `invalid_destination`, `too_many_destinations`, `invalid_delivery`. - [`"render": "auto"`](https://docs.virginproxy.com/render/#auto): the browser only when a page needs it, the browser part charged only then; `strategy` and `strategy_attempts` in the answer. [`render.trace`](https://docs.virginproxy.com/render/#trace): a picture after every step. - [`auto_extract`](https://docs.virginproxy.com/auto-extract/): product, article, job, review list, recipe, event or organization without selectors. [Documents](https://docs.virginproxy.com/documents/): PDF, Word, Excel, PowerPoint, OpenDocument and CSV to Markdown or text. - [`format_options`](https://docs.virginproxy.com/formats/#options) (include and exclude selectors, images, links, pages), `tokens` in every converted answer, [`redact`](https://docs.virginproxy.com/formats/#redact) for e-mail addresses, phone numbers, IBANs, card numbers and IPs. - Jobs: up to 50,000 requests per job (by plan), [NDJSON upload](https://docs.virginproxy.com/jobs/#ndjson), [GET /v1/jobs/{id}/stream](https://docs.virginproxy.com/jobs/#stream). Crawls: [`only_changed`](https://docs.virginproxy.com/crawl/#only-changed). - [Command line tool `vp`](https://docs.virginproxy.com/cli/) with a skill file for coding agents, and [integrations](https://docs.virginproxy.com/integrations/) for n8n, LangChain and LlamaIndex. - The free plan now starts new accounts with 50 credits once (accounts made before keep their credits). ## Key permissions, key rotation and expiry, webhook secret rotation without downtime, delivery log 23 November 2026 - [Key permissions](https://docs.virginproxy.com/security/#scopes): `requests`, `read`, `manage` – for example read-only keys or keys that cannot manage keys. Existing keys keep full access. New error code `insufficient_scope` (403). - [Roll a key](https://docs.virginproxy.com/security/#rotate-keys) with `POST /v1/keys/{id}/roll`: a new key, the old one keeps working for 1 hour, 24 hours or 7 days. Optional `expires_at` per key. - [Webhook secret rotation with a grace period](https://docs.virginproxy.com/webhooks/#rotate): deliveries carry two signatures (`v1=…,v1=…`) until it ends. The SDKs accept either. - [Delivery log](https://docs.virginproxy.com/webhooks/#delivery-log): `GET /v1/webhooks/deliveries` with filters and pages, `GET /v1/webhooks/deliveries/{id}` with every attempt, its timing and the start of your server's answer. - Error codes: `insufficient_scope`, `invalid_scopes`, `invalid_expiry`, `invalid_grace`, `cannot_roll`. ## Connect Claude.ai, ChatGPT and other apps to the MCP server with sign-in 22 November 2026 - [Sign-in with OAuth](https://docs.virginproxy.com/ai-agents/#oauth) for the MCP server: add a custom connector with the address `https://api.virginproxy.com/mcp`, sign in and allow the app – no key to paste. The connection appears on the API keys page, where you can give it a credit limit or revoke it. - For client developers: `/.well-known/oauth-protected-resource/mcp` (RFC 9728), `/.well-known/oauth-authorization-server` (RFC 8414), `POST /oauth/register` (RFC 7591), `POST /oauth/token` (authorization code with PKCE S256, rotating refresh tokens), `POST /oauth/revoke` (RFC 7009). Access tokens work only on `/mcp`. - A 401 from `/mcp` now names the protected resource metadata in `WWW-Authenticate`. Key-based setups are unchanged; the server card lists the `Authorization` header as optional. ## Test mode, batches, PDFs, keys and webhooks through the API, MCP update 22 November 2026 - [Test mode](https://docs.virginproxy.com/test-mode/): keys starting with `vp_test_` get realistic sample answers with the real checks and limits; nothing is fetched or charged. `vp_test_status` and `vp_test_error` simulate answers and errors. - [`POST /v1/batch`](https://docs.virginproxy.com/jobs/#batch): a few requests in one call, answered together. - [`GET /v1/pdf`](https://docs.virginproxy.com/screenshot/#pdf): any page as a PDF document. - [`GET /v1/jobs/{id}/export`](https://docs.virginproxy.com/jobs/#export) (NDJSON, CSV, JSON) and [`POST /v1/jobs/{id}/retry`](https://docs.virginproxy.com/jobs/#retry). - [Keys through the API](https://docs.virginproxy.com/security/#keys-api) (`/v1/keys`) and [webhook secret, deliveries and test delivery](https://docs.virginproxy.com/webhooks/#api) (`/v1/webhooks`). - MCP: protocol 2026-07-28 next to the earlier revisions, 13 tools with annotations (new: batch_scrape, estimate, list_jobs, cancel_job, usage, list_requests, get_request), resources, prompts, a server card. - Discovery: `/.well-known/api-catalog` (RFC 9727), `/.well-known/ai-catalog.json`, `/.well-known/security.txt`. - [SDKs](https://docs.virginproxy.com/sdks/) for Python and Node.js, a Postman collection, and this changelog as [JSON Feed](https://docs.virginproxy.com/changelog.json) and [Atom](https://docs.virginproxy.com/changelog.xml). - Error codes: `invalid_batch`, `pdf_failed`, `nothing_to_retry`, `key_management_not_allowed`, `own_key`, `too_many_keys`, `invalid_name`, `invalid_ip_list`, `invalid_limit`, `nothing_to_change`. ## Screenshots, map, crawl, cost estimate, MCP server 22 November 2026 - [`GET /v1/screenshot`](https://docs.virginproxy.com/screenshot/), [`POST /v1/map`](https://docs.virginproxy.com/map/) and [`POST /v1/crawl`](https://docs.virginproxy.com/crawl/). - [`POST /v1/estimate`](https://docs.virginproxy.com/billing/#estimate-api): what a request may cost, without running it. - `Idempotency-Key` for `POST /v1/requests`; `RateLimit-*` headers on every answer; `GET /v1/status`; `GET /v1/errors`. - [MCP server](https://docs.virginproxy.com/ai-agents/) at `/mcp`, function-calling definitions, OpenAPI 3.1, `llms.txt` and every page as Markdown. > **Note:** Should a documented field, option or error code ever have to be removed, it will be announced here beforehand. --- # API status > What the status dot in the header means, what ok, maintenance and disturbed mean for your requests, and how to check the status from your own code. Source: https://docs.virginproxy.com/status/ The dot next to the search in the header shows the state of the API right now, read from `GET /v1/status` when a page opens. During maintenance a notice also appears at the top of every page. ## What the states mean | State | Dot | What it means for your requests | | --- | --- | --- | | `ok` | Green | Everything works as documented. | | `maintenance` | Amber | Requests are paused. Calls answer [`maintenance`](https://docs.virginproxy.com/errors/#e-maintenance) (503) with `retry_after_ms`, and **nothing is charged**. | | `disturbed` | Red | The API answers, but some requests may fail or take longer than usual. Retry the codes marked *Wait, then retry* on the [errors page](https://docs.virginproxy.com/errors/); requests the target never answered are not charged. | When the status cannot be read – you are offline, or a browser extension blocks the call – no dot is shown. That says nothing about the API. ## Check it from your code `GET /v1/status` needs no key and costs nothing: ```bash curl https://api.virginproxy.com/v1/status ``` *Response:* ```json { "status": "ok", "api_version": "v1", "time": "2026-11-25T09:12:44.512Z", "docs": "https://docs.virginproxy.com" } ``` For an uptime monitor, `GET /healthz` answers `{"ok": true}` with 200, or 503 when the API is down (see [Account and usage](https://docs.virginproxy.com/account/#health)). Your program does not need either: every error says what to do, and the [SDKs](https://docs.virginproxy.com/sdks/) wait and retry `maintenance` and `busy` by themselves. > **Tip:** Plan around maintenance like around any 503: wait `retry_after_ms`, then send again. Since nothing is charged during maintenance, retrying costs nothing. --- # Raw mode > GET /v1/raw returns the target's answer untouched, with exit IP, size, cost, final URL and cookies in X-VP-* response headers. Source: https://docs.virginproxy.com/raw/ `GET /v1/raw` returns the target's body and status exactly as they are. Our figures travel in response headers. Use it when you want to pipe a page or a file straight into another tool. ```bash curl -i "https://api.virginproxy.com/v1/raw?url=https%3A%2F%2Fhttpbin.org%2Fip" \ -H "Authorization: Bearer $VP_KEY" ``` ```http HTTP/2 200 content-type: application/json x-vp-request-id: req_4tyqEH939pSTwPEWg0ZH x-vp-exit-ip: 203.0.113.42 x-vp-exit-country: DE x-vp-bytes-down: 4212 x-vp-bytes-up: 1984 x-vp-duration-ms: 524 x-vp-credits: 1 { "origin": "203.0.113.42" } ``` ## Query parameters All values are URL-encoded. Flags take `true` or `1`; anything else counts as `false`. | Parameter | Meaning | | --- | --- | | `url` | The target URL. Required. | | `browser` | Which browser the request looks like, as in [Browsers](https://docs.virginproxy.com/browsers/). | | `locale` | Language of the visitor, for example `en-US`. | | `session` | Session name: same IP and shared cookies, as in [Cookies and sessions](https://docs.virginproxy.com/cookies/). | | `cookie_jar` | `false` stops a session from remembering cookies. | | `fresh_ip` | A new IP first (5 extra credits). | | `ip_version` | `4`, `6` or `auto`. | | `follow_redirects` | `false` returns a redirect instead of following it. | | `max_redirects` | 0 to 10, default 5. | | `timeout_ms` | Timeout in milliseconds. | | `render` | Load the page in a real browser (9 extra credits), as in [Pages with JavaScript](https://docs.virginproxy.com/render/). The detailed render options need `POST /v1/requests`. | | `format` | `markdown`, `text` or `clean_html`: the converted text with a matching `Content-Type`. See [Output formats](https://docs.virginproxy.com/formats/#raw-mode). | ## Your own headers and cookies Headers for the target travel as `X-VP-Header-`: the prefix is removed and the rest is sent to the target. That is also how cookies go along. ```bash curl -i "https://api.virginproxy.com/v1/raw?url=https%3A%2F%2Fhttpbin.org%2Fheaders&browser=firefox&locale=en-US" \ -H "Authorization: Bearer $VP_KEY" \ -H "X-VP-Header-Referer: https://www.example.com/" \ -H "X-VP-Header-Cookie: theme=dark; consent=yes" ``` Raw mode always sends a `GET`. For other methods, a body, `params`, `retry` or the detailed render options use `POST /v1/requests`. ## Response headers | Header | Meaning | | --- | --- | | `Content-Type` | The target's content type. | | `X-VP-Request-Id` | Our id for the request. Present only when the target answered. | | `X-VP-Exit-IP`, `X-VP-Exit-Country` | The IP the target saw, and its country. | | `X-VP-Bytes-Down`, `X-VP-Bytes-Up` | Bytes received and sent. | | `X-VP-Duration-Ms` | How long the request took. | | `X-VP-Credits` | Credits charged. | | `X-VP-Final-URL` | The URL that produced the answer, after redirects. | | `X-VP-Status` | The target's status code. It equals the reply status, except for a code HTTP cannot pass on (below 200 or above 599): that reply arrives as 502. | | `X-VP-Set-Cookie` | The cookies the target set, one header per cookie, exactly as the target sent them. | ## Status codes The HTTP status of the reply is the target's status, so a 404 from the target arrives as 404 (a code outside 200 to 599 arrives as 502, with the original in `X-VP-Status`). To tell the target's errors from ours, look for the `X-VP-Request-Id` header: it is present only when the target answered. Our own errors are JSON with an `error` object, as described in [Errors](https://docs.virginproxy.com/errors/). Of the target's own headers only `Content-Type` is passed on. If you need the others, use `POST /v1/requests`. --- # Headers, query and body > How to send headers, query parameters, JSON, forms and binary bodies with POST /v1/requests, with limits and examples. Source: https://docs.virginproxy.com/headers/ Everything a browser or a program can send, you can send through VirginProxy: headers, query parameters and a body as JSON, as a form or as raw bytes. ## Headers `headers` is an object of names and string values. They replace the headers of the chosen [browser](https://docs.virginproxy.com/browsers/) with the same name; case does not matter. An empty value leaves a header out. **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/headers", "headers": { "Authorization": "Bearer my-token", "X-Requested-With": "XMLHttpRequest", "Accept": "application/json" } }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://httpbin.org/headers", "headers": { "Authorization": "Bearer my-token", "X-Requested-With": "XMLHttpRequest", "Accept": "application/json", }, }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["body"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/headers", headers: { Authorization: "Bearer my-token", "X-Requested-With": "XMLHttpRequest", Accept: "application/json", }, }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.body); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://httpbin.org/headers", "headers": { "Authorization": "Bearer my-token", "X-Requested-With": "XMLHttpRequest", "Accept": "application/json", }, }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/headers", headers: { Authorization: "Bearer my-token", "X-Requested-With": "XMLHttpRequest", Accept: "application/json", }, }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://httpbin.org/headers", "headers" => [ "Authorization" => "Bearer my-token", "X-Requested-With" => "XMLHttpRequest", "Accept" => "application/json", ], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["body"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/headers", "headers": { "Authorization": "Bearer my-token", "X-Requested-With": "XMLHttpRequest", "Accept": "application/json" } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["body"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL2hlYWRlcnMiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiJCZWFyZXIgbXktdG9rZW4iLCJYLVJlcXVlc3RlZC1XaXRoIjoiWE1MSHR0cFJlcXVlc3QiLCJBY2NlcHQiOiJhcHBsaWNhdGlvbi9qc29uIn19) | Limit | Value | | --- | --- | | Number of headers | up to 100 | | Name | up to 64 characters: letters, digits and `` ! # $ % & ' * + . ^ _ ` \| ~ - `` | | Value | a string of up to 8,000 characters without line breaks | `Host`, `Content-Length`, `Connection`, `Transfer-Encoding`, `Upgrade`, `TE`, `Trailer`, `Keep-Alive`, `Proxy-Authorization`, `Proxy-Connection` are managed by the connection and dropped if you send them. Cookies can go in a `Cookie` header or in `cookies`; see [Cookies and sessions](https://docs.virginproxy.com/cookies/). ## Query parameters `params` adds parameters to the query string of `url`, after those it already has. Values are encoded for you. A list repeats the name. **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/get?page=1", "params": { "q": "blue shoes", "size": [ 42, 43 ], "in_stock": true } }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://httpbin.org/get?page=1", "params": {"q": "blue shoes", "size": [42, 43], "in_stock": True}, }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["final_url"]) # https://httpbin.org/get?page=1&q=blue+shoes&size=42&size=43&in_stock=true ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/get?page=1", params: { q: "blue shoes", size: [42, 43], in_stock: true }, }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.final_url); // https://httpbin.org/get?page=1&q=blue+shoes&size=42&size=43&in_stock=true ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://httpbin.org/get?page=1", "params": {"q": "blue shoes", "size": [42, 43], "in_stock": True}, }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/get?page=1", params: { q: "blue shoes", size: [42, 43], in_stock: true }, }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://httpbin.org/get?page=1", "params" => ["q" => "blue shoes", "size" => [42, 43], "in_stock" => true], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["final_url"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/get?page=1", "params": { "q": "blue shoes", "size": [ 42, 43 ], "in_stock": true } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["final_url"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL2dldD9wYWdlPTEiLCJwYXJhbXMiOnsicSI6ImJsdWUgc2hvZXMiLCJzaXplIjpbNDIsNDNdLCJpbl9zdG9jayI6dHJ1ZX19) Values are strings, numbers, booleans or lists of them, at most 500 values in all. The whole URL may not be longer than 8,000 characters. ## Three kinds of body | Field | Sent as | Content-Type set for you | | --- | --- | --- | | `json` | JSON text of any JSON value | `application/json` | | `form` | an HTML form: `a=1&b=2` | `application/x-www-form-urlencoded` | | `body` | exactly the string you give, or bytes with `"body_encoding": "base64"` | none: send your own | Send at most one of them; together they are refused with `invalid_options`. A `Content-Type` in `headers` always wins. The body may be up to 5 MB. ### JSON **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/post", "method": "POST", "json": { "query": "shoes", "filters": { "size": 42, "colors": [ "blue", "black" ] } } }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://httpbin.org/post", "method": "POST", "json": { "query": "shoes", "filters": {"size": 42, "colors": ["blue", "black"]}, }, }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["body"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/post", method: "POST", json: { query: "shoes", filters: { size: 42, colors: ["blue", "black"] }, }, }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.body); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://httpbin.org/post", "method": "POST", "json": { "query": "shoes", "filters": {"size": 42, "colors": ["blue", "black"]}, }, }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/post", method: "POST", json: { query: "shoes", filters: { size: 42, colors: ["blue", "black"] }, }, }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://httpbin.org/post", "method" => "POST", "json" => [ "query" => "shoes", "filters" => ["size" => 42, "colors" => ["blue", "black"]], ], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["body"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/post", "method": "POST", "json": { "query": "shoes", "filters": { "size": 42, "colors": [ "blue", "black" ] } } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["body"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL3Bvc3QiLCJtZXRob2QiOiJQT1NUIiwianNvbiI6eyJxdWVyeSI6InNob2VzIiwiZmlsdGVycyI6eyJzaXplIjo0MiwiY29sb3JzIjpbImJsdWUiLCJibGFjayJdfX19) ### Form Values as in `params`: strings, numbers, booleans or lists of them. **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/post", "method": "POST", "form": { "email": "ada@example.com", "topics": [ "news", "offers" ], "subscribe": true } }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://httpbin.org/post", "method": "POST", "form": { "email": "ada@example.com", "topics": ["news", "offers"], "subscribe": True, }, }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["body"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/post", method: "POST", form: { email: "ada@example.com", topics: ["news", "offers"], subscribe: true, }, }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.body); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://httpbin.org/post", "method": "POST", "form": { "email": "ada@example.com", "topics": ["news", "offers"], "subscribe": True, }, }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/post", method: "POST", form: { email: "ada@example.com", topics: ["news", "offers"], subscribe: true, }, }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://httpbin.org/post", "method" => "POST", "form" => [ "email" => "ada@example.com", "topics" => ["news", "offers"], "subscribe" => true, ], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["body"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/post", "method": "POST", "form": { "email": "ada@example.com", "topics": [ "news", "offers" ], "subscribe": true } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["body"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL3Bvc3QiLCJtZXRob2QiOiJQT1NUIiwiZm9ybSI6eyJlbWFpbCI6ImFkYUBleGFtcGxlLmNvbSIsInRvcGljcyI6WyJuZXdzIiwib2ZmZXJzIl0sInN1YnNjcmliZSI6dHJ1ZX19) ### Raw text and binary data `body` is sent unchanged. For binary data, encode it as base64 and add `"body_encoding": "base64"`. **Python** ```python import base64, os, requests with open("photo.jpg", "rb") as f: payload = base64.b64encode(f.read()).decode() r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://httpbin.org/post", "method": "POST", "headers": {"Content-Type": "image/jpeg"}, "body": payload, "body_encoding": "base64", }, timeout=180, ) print(r.json()["status"]) ``` **Node.js** ```javascript import { readFile } from "node:fs/promises"; const payload = (await readFile("photo.jpg")).toString("base64"); const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/post", method: "POST", headers: { "Content-Type": "image/jpeg" }, body: payload, body_encoding: "base64", }), }); console.log((await res.json()).status); ``` --- # Cookies and sessions > How to send cookies, read the cookies a site sets, and let a session remember them across requests like a browser tab. Source: https://docs.virginproxy.com/cookies/ Cookies are how websites remember a visitor: consent, language, cart, login. You can send them with a request, read the ones a site sets, and let a session keep them for you. ## Send cookies The simplest form is an object of names and values: **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/cookies", "cookies": { "theme": "dark", "consent": "yes" } }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://httpbin.org/cookies", "cookies": {"theme": "dark", "consent": "yes"}, }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["body"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/cookies", cookies: { theme: "dark", consent: "yes" }, }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.body); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://httpbin.org/cookies", "cookies": {"theme": "dark", "consent": "yes"}, }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/cookies", cookies: { theme: "dark", consent: "yes" }, }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://httpbin.org/cookies", "cookies" => ["theme" => "dark", "consent" => "yes"], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["body"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/cookies", "cookies": { "theme": "dark", "consent": "yes" } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["body"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL2Nvb2tpZXMiLCJjb29raWVzIjp7InRoZW1lIjoiZGFyayIsImNvbnNlbnQiOiJ5ZXMifX0) When a cookie should only go to certain hosts or paths, use a list: ```json { "url": "https://www.example.com/shop/", "cookies": [ { "name": "consent", "value": "yes", "domain": ".example.com" }, { "name": "cart", "value": "42", "path": "/shop" } ] } ``` | Field | Meaning | | --- | --- | | `name` | Required. Up to 256 characters, the characters a cookie name may contain. | | `value` | Required. A string of up to 8,000 characters without `;` or line breaks. | | `domain` | Optional. Without it the cookie goes to the target host only. With `example.com` or `.example.com` it also goes to its subdomains, for example after a redirect to `www.example.com`. | | `path` | Optional. Starts with `/`; the cookie goes only to paths below it. | At most 200 cookies per request. A `Cookie` header in `headers` works too, which is handy when you copy one from your browser (see [Copy a request from your browser](https://docs.virginproxy.com/copy-from-browser/)). Both can be combined: your `Cookie` header comes first, the other cookies follow. ## Read the cookies a site sets Every response lists the cookies the target set, parsed, including those set on the way through redirects: ```json "cookies": [ { "name": "session-id", "value": "262-4410173", "domain": ".shop.example", "path": "/", "expires": "2027-11-17T10:12:08Z", "secure": true, "http_only": true, "same_site": "Lax" } ] ``` `expires`, `max_age` and `same_site` appear only when the site set them. The raw headers are in `headers["set-cookie"]`, a list with one entry per cookie of the final response. **Python** ```python API = "https://api.virginproxy.com/v1/requests" AUTH = {"Authorization": "Bearer " + os.environ["VP_KEY"]} jar = {c["name"]: c["value"] for c in data["cookies"]} # send them along next time requests.post(API, headers=AUTH, json={"url": "https://shop.example/cart", "cookies": jar}, timeout=180) ``` **Node.js** ```javascript const jar = Object.fromEntries(data.cookies.map((c) => [c.name, c.value])); // send them along next time await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://shop.example/cart", cookies: jar }), }); ``` ## Let a session remember cookies With a `session`, you do not have to carry cookies yourself. Cookies the site sets are remembered and sent automatically with the next requests of the same session to that site, just like in a browser tab. Cookies you send in `cookies` are remembered too. **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/cookies/set?step=1", "session": "visitor-7" }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://httpbin.org/cookies/set?step=1", "session": "visitor-7", }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) # the second request carries the cookie of the first one r = requests.post(r.url, headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, timeout=180, json={"url": "https://httpbin.org/cookies", "session": "visitor-7"}) print(r.json()["body"]) # {"cookies": {"step": "1"}} ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/cookies/set?step=1", session: "visitor-7", }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); // the second request carries the cookie of the first one const again = await fetch(res.url, { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/cookies", session: "visitor-7" }), }); console.log((await again.json()).body); // {"cookies": {"step": "1"}} ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://httpbin.org/cookies/set?step=1", "session": "visitor-7", }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/cookies/set?step=1", session: "visitor-7", }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://httpbin.org/cookies/set?step=1", "session" => "visitor-7", ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["status"], " ", $data["body"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/cookies/set?step=1", "session": "visitor-7" }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["status"], data["body"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL2Nvb2tpZXMvc2V0P3N0ZXA9MSIsInNlc3Npb24iOiJ2aXNpdG9yLTcifQ) | | How long | | --- | --- | | Same IP | Up to 10 minutes from the first request of the session. See [IPs and sessions](https://docs.virginproxy.com/sessions/). | | Remembered cookies | Until 30 minutes after the last request of the session. Each request starts the 30 minutes again. | After 10 minutes the session continues on a new IP with the same cookies, like a person whose connection changed. Use a new session name when you want to start over as a new visitor. To keep the IP of a session but manage cookies yourself, send `"cookie_jar": false`. Without a session every request starts with no cookies except the ones you send; cookies set during its own redirects are still passed on to the next step. Pages loaded with `render` share the cookies of their session in both directions. You can load one page in the browser and continue with plain requests in the same session. > **Note:** Remembered cookies are kept in memory only, for your session alone, and are deleted 30 minutes after the session was last used. They never appear in our logs. --- # IPs and sessions > How to keep the same IP and its cookies with a sticky session, how to get a fresh IP for every request, automatic rotation and IPv6 addresses. Source: https://docs.virginproxy.com/sessions/ Every request leaves from one of our clean, high-reputation IP addresses. By default each request gets whichever address is free, so consecutive requests usually come from different IPs. ## Keep one IP: sessions Send the same `session` name and your requests leave through the same IP for up to 10 minutes from the first request. ```json { "url": "https://shop.example/cart", "session": "cart-42" } ``` - The name is yours to choose. Use one per logical visitor, for example a cart or a login. - Requests of a session also share their cookies, like the tabs of one browser. See [Cookies and sessions](https://docs.virginproxy.com/cookies/). - Sessions belong to your account. Another customer using the same name gets a different session. - After 10 minutes the name starts a new session on whichever IP is free. - If that IP becomes unavailable or is fully busy, the session moves to another one and the IP changes. Compare `exit.ip` between responses if your flow depends on it. ## A new IP: fresh_ip `"fresh_ip": true` gets a new IP address before your request is sent. ```json { "url": "https://example.com/", "fresh_ip": true } ``` - Getting the new address takes up to about 20 seconds. Set your client's timeout accordingly. - It costs 5 credits on top of the request. - When no capacity is free for it at that moment, you get `busy` (503, not charged). - `fresh_ip` and `session` cannot be combined, and neither can `retry.fresh_ip` and `session`: a session keeps its IP. - To get a new IP only when the target refuses, use [automatic retries](https://docs.virginproxy.com/retries/) with `"fresh_ip": true` instead. > **Note:** A fresh IP is new for your request, but it is not guaranteed never to have been used before. ## Automatic rotation You do not have to rotate anything. IP addresses change on their own after a number of requests or a few minutes of use, as long as no session is pinned to them. ## IPv4 and IPv6 | ip_version | Behaviour | | --- | --- | | `"4"` | Default. The request uses an IPv4 address. | | `"6"` | The request uses an IPv6 address. The target must be reachable over IPv6. | | `"auto"` | IPv6 where the target supports it, otherwise IPv4. | ## Targets that are not reachable Addresses in private or local networks (`10.0.0.0/8`, `192.168.0.0/16`, `127.0.0.1`, `localhost`, link-local and similar) are refused with `target_not_allowed`. This also applies when a public name resolves to such an address. --- # Automatic retries > Let VirginProxy try a request again when the target answers with a temporary error or the connection fails. Only the answer you receive is charged. Source: https://docs.virginproxy.com/retries/ Websites sometimes answer with a temporary error: a 429 or 503, a timeout, or a connection that breaks off. With `retry` we try again before we answer you and you get the first good answer. ## Example **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://www.example.com/", "retry": { "times": 2, "on": [ 403, 429, 503, "timeout" ], "fresh_ip": true } }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://www.example.com/", "retry": {"times": 2, "on": [403, 429, 503, "timeout"], "fresh_ip": True}, }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["status"], data["attempts"], data["cost"]["credits"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://www.example.com/", retry: { times: 2, on: [403, 429, 503, "timeout"], fresh_ip: true }, }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.status, data.attempts, data.cost.credits); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://www.example.com/", "retry": {"times": 2, "on": [403, 429, 503, "timeout"], "fresh_ip": True}, }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://www.example.com/", retry: { times: 2, on: [403, 429, 503, "timeout"], fresh_ip: true }, }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://www.example.com/", "retry" => [ "times" => 2, "on" => [403, 429, 503, "timeout"], "fresh_ip" => true, ], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["status"], " ", $data["attempts"], " ", $data["cost"]["credits"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://www.example.com/", "retry": { "times": 2, "on": [ 403, 429, 503, "timeout" ], "fresh_ip": true } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["status"], data["attempts"], data["cost"].(map[string]any)["credits"]) } ``` POST`/v1/requests`[≈ 1+ credits](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL3d3dy5leGFtcGxlLmNvbS8iLCJyZXRyeSI6eyJ0aW1lcyI6Miwib24iOls0MDMsNDI5LDUwMywidGltZW91dCJdLCJmcmVzaF9pcCI6dHJ1ZX19) `attempts` in the response tells you how many tries it took. ## Fields | Field | Type | Meaning | | --- | --- | --- | | `times` | integer | How many more attempts at most: 0 to 3. Default 1. | | `on` | list | When to try again: target statuses from 300 to 599 (as numbers or strings), the errors `timeout`, `connection_failed`, `target_unreachable` and `tls_error`, and `text_match` and `selector_missing` (see [Retry by content](#content)). At most 20 entries. Default `[403, 429, 503, "timeout", "connection_failed"]`. | | `fresh_ip` | boolean | `true` gets a new IP before each further attempt. Default `false`: the next attempt uses the same IP. | `"retry": {}` uses all defaults: one more attempt on the same IP. ## Retry by content Some temporary errors arrive as a normal 200: an empty result list or a "please try again" text. Two more fields catch them: | Field | Type | Meaning | | --- | --- | --- | | `if_text` | list | Up to 10 texts of up to 200 characters. If the body contains one of them (case does not matter), the attempt counts as refused. | | `if_missing` | string | A CSS selector. If an HTML answer contains no matching element, the attempt counts as refused – for example when the product price is missing. | **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://shop.example/product/42", "retry": { "times": 3, "fresh_ip": true, "if_text": [ "please try again", "temporarily unavailable" ], "if_missing": ".price" } }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://shop.example/product/42", "retry": { "times": 3, "fresh_ip": True, "if_text": ["please try again", "temporarily unavailable"], "if_missing": ".price", }, }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["status"], data["attempts"], data["cost"]["credits"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://shop.example/product/42", retry: { times: 3, fresh_ip: true, if_text: ["please try again", "temporarily unavailable"], if_missing: ".price", }, }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.status, data.attempts, data.cost.credits); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://shop.example/product/42", "retry": { "times": 3, "fresh_ip": True, "if_text": ["please try again", "temporarily unavailable"], "if_missing": ".price", }, }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://shop.example/product/42", retry: { times: 3, fresh_ip: true, if_text: ["please try again", "temporarily unavailable"], if_missing: ".price", }, }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://shop.example/product/42", "retry" => [ "times" => 3, "fresh_ip" => true, "if_text" => ["please try again", "temporarily unavailable"], "if_missing" => ".price", ], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["status"], " ", $data["attempts"], " ", $data["cost"]["credits"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://shop.example/product/42", "retry": { "times": 3, "fresh_ip": true, "if_text": [ "please try again", "temporarily unavailable" ], "if_missing": ".price" } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["status"], data["attempts"], data["cost"].(map[string]any)["credits"]) } ``` POST`/v1/requests`[≈ 1+ credits](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL3Nob3AuZXhhbXBsZS9wcm9kdWN0LzQyIiwicmV0cnkiOnsidGltZXMiOjMsImZyZXNoX2lwIjp0cnVlLCJpZl90ZXh0IjpbInBsZWFzZSB0cnkgYWdhaW4iLCJ0ZW1wb3JhcmlseSB1bmF2YWlsYWJsZSJdLCJpZl9taXNzaW5nIjoiLnByaWNlIn19) Internally these count as the codes `text_match` and `selector_missing`: they are added to `on` automatically, and you may also list them there yourself. If the last attempt still matches, that answer comes back normally and is charged like any answered request – check it before you use it. ## What it costs - Only the answer you receive is charged, by its size, as usual. Earlier attempts are on us. - Each new IP adds 5 credits, as with `fresh_ip`. - If every attempt fails with an error (timeout, broken connection), nothing is charged. - If the last attempt still gets a refusal, for example a 403, that answer is charged like any answer. Example: the first attempt gets a 429, the second, from a new IP, gets a 200 with 300 kB. You pay 1 + 5 = 6 credits. ## Same IP or a new one? - For `timeout` and `connection_failed` the same IP is usually fine: the path to the target had a hiccup. - For 429 and 503, wait or slow down: these are the target's own limits. Respect them and the site's terms. - A `session` keeps its IP, so `retry.fresh_ip` cannot be combined with `session`. Retries on the same IP can. ## Time Each attempt may take the full `timeout_ms`, and a new IP takes up to about 20 seconds more. Set your client's timeout to cover all attempts: timeout × (1 + `times`), plus the wait for a free slot (see [Load and priority](https://docs.virginproxy.com/priority/)), plus 30 seconds per new IP. ## What retry does not cover `retry` is about the target. Our own answers, such as `rate_limited`, `concurrency_limited` or `busy`, come back to you at once and are not charged; handle them in your client as described in [Limits and retries](https://docs.virginproxy.com/limits/). > **Warning:** Think twice before retrying a `POST`. A request that timed out may still have been carried out by the target. --- # Limits and retries > Rate limit, concurrency limit, waiting for capacity, timeouts and size limits per plan, and how to retry correctly. Source: https://docs.virginproxy.com/limits/ Each plan sets how many requests may run at the same time and how many may start per second. When you go over, the API answers at once with a 429 and charges nothing. ## The two limits | Limit | Error code | What it means | | --- | --- | --- | | Per second | `rate_limited` | More requests started this second than your plan allows. Short bursts of up to twice the rate are let through. | | At the same time | `concurrency_limited` | As many of your requests are still running as your plan allows. Wait for one to finish. | Both errors carry `retry_after_ms` in the error object: ```http HTTP/2 429 { "error": { "code": "rate_limited", "message": "Your plan allows 1 requests per second.", "retry_after_ms": 1000 }, "request_id": "call_hT6yN1vB0dMq9ZsF3Ukx" } ``` ## When capacity is fully used If all capacity is in use, your request waits for a free slot: up to 30 seconds on Scale, 25 on Growth, 20 on Starter and 10 on Free. Higher plans are served first. If none becomes free you get `busy` (503) with `retry_after_ms`; nothing is charged. See [Load and priority](https://docs.virginproxy.com/priority/). ## Timeouts The target has your plan's timeout (30 to 120 seconds) to answer; `timeout_ms` can shorten it. With [render](https://docs.virginproxy.com/render/) the same time covers loading the page and all waiting in the browser. Set your own HTTP client's timeout higher than that: add your plan's wait for a free slot (10 to 30 seconds), and another 30 seconds for each new IP. With [retry](https://docs.virginproxy.com/retries/), every further attempt may take the full timeout again. Without retries, 180 seconds is safe on every plan. **A call you wait for ends after 90 seconds at the latest** – waiting for capacity, retries and the browser included. What is not done by then ends with `timeout` (charged only if the target had already answered). Longer work goes in a [job](https://docs.virginproxy.com/jobs/): there the full times apply. ## Sizes - Request body to the target: up to 5 MB. - Response from the target: up to your plan's limit (2 to 25 MB). Longer responses are cut and marked `"truncated": true`; you are charged for what was transferred. ## Retrying | You got | Do this | | --- | --- | | `rate_limited`, `concurrency_limited`, `busy`, `maintenance`, `executor_unavailable`, `rotation_failed` | Wait `retry_after_ms` (or a second or two) and send again. Not charged. | | `timeout`, `target_unreachable`, `connection_failed`, `tls_error` | The target or the path to it failed. One or two retries are reasonable; a different IP may succeed. Not charged. | | HTTP 200 from us with a target status of 403, 429 or 5xx | The target answered, so the request is charged. Let us retry for you with [`retry`](https://docs.virginproxy.com/retries/) and `"fresh_ip": true`: only the answer you receive is charged. Or send again with `fresh_ip` or a new session. | | Any other 4xx from us | Fix the request. Retrying unchanged gives the same answer. | > **Note:** A request is not idempotent just because it failed. If a `POST` timed out, the target may still have processed it. ## Send again safely: Idempotency-Key Your connection broke while a request was running, or your client gave up waiting – did it run, was it charged? Send `POST /v1/requests` with an `Idempotency-Key` header (1 to 128 visible ASCII characters, for example a UUID or your own order id). Sent again with the same key and the same body within 24 hours, it gets the **first answer again**, marked with `Idempotent-Replayed: true`, instead of running and being charged a second time. **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Idempotency-Key: order-4711-page-1" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/uuid" }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"], "Idempotency-Key": "order-4711-page-1"}, json={"url": "https://httpbin.org/uuid"}, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["id"], data["cost"]["credits"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json", "Idempotency-Key": "order-4711-page-1" }, body: JSON.stringify({ url: "https://httpbin.org/uuid" }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.id, data.cost.credits); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({"url": "https://httpbin.org/uuid"}) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/uuid" }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", "Idempotency-Key: order-4711-page-1", ], CURLOPT_POSTFIELDS => json_encode(["url" => "https://httpbin.org/uuid"], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["id"], " ", $data["cost"]["credits"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/uuid" }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") req.Header.Set("Idempotency-Key", "order-4711-page-1") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["id"], data["cost"].(map[string]any)["credits"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL3V1aWQifQ) | Situation | Answer | | --- | --- | | First call | Runs as usual. | | Same key, same body, first call finished | The first answer again (status and body), header `Idempotent-Replayed: true`. Not charged again. The kept answer can be viewed in the dashboard for 24 hours. | | Same key while the first call still runs | 409 `idempotency_in_progress` with `retry_after_ms`: wait, then send again. | | Same key, different body | 422 `idempotency_key_reused`. Use a new key for a new request. | | The first call failed without being charged | Nothing is kept: sending it again runs it again. | The same header works for [jobs](https://docs.virginproxy.com/jobs/#idempotency) and [crawls](https://docs.virginproxy.com/crawl/), where it returns the job created first. ## Rate-limit headers Every answer to a call with a valid key tells you where you stand, so your client can slow down before it gets a 429: | Header | Meaning | | --- | --- | | `RateLimit-Limit` | Requests you may send in a burst: twice your plan's rate per second. | | `RateLimit-Remaining` | Requests you may send right now. | | `RateLimit-Reset` | Seconds until the bucket is full again. | | `RateLimit-Policy` | The same as a policy, e.g. `10;w=2`: 10 requests per 2 seconds. | | `Retry-After` | On every error that has `retry_after_ms`: the same wait in whole seconds. | | `X-Request-Id` | Our id of this call (`call_…`), also `request_id` in errors. Quote it when you contact support. | The rate counts requests that run (`POST /v1/requests`, `/v1/raw`, screenshots, map). Reading your account, usage, jobs or estimates does not use it up. --- # Load and priority > What happens when many requests run at once: higher plans are served first, how long a request waits for a free slot per plan, and what busy means. Source: https://docs.virginproxy.com/priority/ Our capacity is shared by all customers. Most of the time your request starts at once. When very many requests run at the same moment, new ones wait briefly for a free slot, and higher plans go first. ## Who goes first Waiting requests are served by plan: **Scale** first, then **Growth**, then **Starter**, then **Free**. Within one plan, in the order they arrived. In addition, lower plans can never fill all of the capacity: part of it always stays free for the plans above them. So a request on a higher plan finds room quickly even when many requests on lower plans are waiting. ## How long a request waits | Plan | Waits for a free slot up to | | --- | --- | | Scale | 30 seconds | | Growth | 25 seconds | | Starter | 20 seconds | | Free | 10 seconds | The same applies to the browsers used by [render](https://docs.virginproxy.com/render/). Waiting costs nothing. ## When no slot becomes free in time You get `busy` with HTTP 503 and a hint how long to wait. Nothing is charged. ```http HTTP/2 503 { "error": { "code": "busy", "message": "All capacity is in use right now. This request was not charged; retry in a moment.", "retry_after_ms": 2000 }, "request_id": "call_Lw8eR2cJ7nQ4xHa1Vg5T" } ``` ## What you can do - Wait `retry_after_ms` and send the request again, waiting a little longer after each further `busy`. The [language guides](https://docs.virginproxy.com/python/) do this for you. - Spread large jobs over time instead of starting everything at once. - Run fewer requests in parallel while you get `busy`. - A higher plan waits longer and is served earlier. Plans are compared in [Credits and billing](https://docs.virginproxy.com/billing/#plans). ## Your own limits are separate How many requests you may start per second and run at the same time is set by your plan and answered at once with 429, see [Limits and retries](https://docs.virginproxy.com/limits/). `limits.priority` in [GET /v1/account](https://docs.virginproxy.com/account/) shows your place in the order: 1 for Scale up to 4 for Free. --- # Errors > The error format of the VirginProxy API and every error code, with HTTP status and whether to retry. Errors before the target answered are not charged. Source: https://docs.virginproxy.com/errors/ Errors are JSON with a stable `code` for your program and a `message` for you. An error before the target answered is never charged. *Error response:* ```json { "error": { "code": "target_unreachable", "message": "The target could not be reached. This request was not charged.", "charged": false, "doc_url": "https://docs.virginproxy.com/errors/#e-target_unreachable" }, "request_id": "call_Xr4mT0qLa8VcN2eKp7Wd" } ``` `request_id` is also sent as the `X-Request-Id` response header. Some errors add `retry_after_ms`, `invalid_job` adds `index`. When the target had already answered and something failed after that, the error says `"charged": true` with the credits it cost, see [Credits and billing](https://docs.virginproxy.com/billing/#cost). Every error also carries `error.doc_url`: a link straight to its row on this page, such as `https://docs.virginproxy.com/errors/#e-rate_limited`. Log it next to the code, or show it to whoever reads your logs – the row opens highlighted. Every row has such an anchor: `#e-` followed by the code. The last column says what to do: Wait, then retry after `retry_after_ms` or a moment, Retry once or twice as it is, Fix first: the same call gives the same answer until the request, the key or the account changes. ## Your request was not accepted | HTTP | Code | Meaning | Retry | | --- | --- | --- | --- | | 400 | `invalid_body` | The call is not a valid JSON object, `body` is not a string, or `form` is not an object of strings, numbers, booleans or lists of them. | Fix first | | 400 | `invalid_url` | `url` is missing, not http(s), longer than 8,000 characters (also after adding `params`), or contains credentials. | Fix first | | 400 | `invalid_method` | The method is not supported. | Fix first | | 400 | `invalid_headers` | `headers` is not an object, has more than 100 entries, or a name or value is not valid. | Fix first | | 400 | `invalid_params` | `params` is not an object of strings, numbers, booleans or lists of them, or has more than 500 values. | Fix first | | 400 | `invalid_browser` | `browser` is not one of `chrome`, `chrome_mac`, `chrome_android`, `edge`, `firefox`, `safari`, `safari_ios`, `none`. | Fix first | | 400 | `invalid_locale` | `locale` does not look like `de-DE` or `en`. | Fix first | | 400 | `invalid_cookies` | `cookies` is neither an object nor a list, has more than 200 entries, or one cookie is not valid (name, value without `;`, domain, path starting with `/`). | Fix first | | 400 | `body_too_large` | The body for the target is larger than 5 MB. | Fix first | | 400 | `invalid_session` | The session name has other characters than letters, digits and `_ . : -`, or is longer than 64. | Fix first | | 400 | `invalid_retry` | `retry` is not valid: `times` outside 0–3, an unknown entry in `on`, more than 10 `if_text` entries or one longer than 200 characters, or an `if_missing` selector longer than 500 characters. | Fix first | | 400 | `invalid_render` | `render` is not `true` or a valid options object: `wait_ms` above 15,000, `scroll` above 20, an unknown `block` value, more than 30 or malformed `actions`. | Fix first | | 400 | `invalid_format` | `format` is not one of `raw`, `markdown`, `text`, `clean_html`, or `main_content` is not a boolean. | Fix first | | 400 | `invalid_parse` | `parse` is not `true` or a list of `metadata`, `links`, `images`, `headings`, `emails`, `phones`, `tables`, `json_ld`, `product`, `article`, `organization`, `breadcrumbs`, `serp`. | Fix first | | 400 | `invalid_format_options` | `format_options` has an unknown key, a selector that is empty or longer than 500 characters, `images`/`links` not `true` or `false`, `max_pages` outside 1–500, or there is no `format` to apply it to. | Fix first | | 400 | `invalid_redact` | `redact` is not `true` or a non-empty list of `email`, `phone`, `iban`, `card`, `ip`. | Fix first | | 400 | `invalid_auto_extract` | `auto_extract` is not one of `product`, `article`, `job`, `review_list`, `recipe`, `event`, `organization`. | Fix first | | 400 | `invalid_render_auto` | `"render": "auto"` with a method other than GET, `render_options` that are not valid or ask for a screenshot, PDF, steps, capture (those need the browser every time), or `render_options` without `"render": "auto"`. | Fix first | | 400 | `invalid_query` | `POST /v1/search`: `query` is missing, empty or longer than 400 characters. | Fix first | | 400 | `invalid_extract` | A field in `extract` is not valid. The message names the field path, for example `extract.products.fields.price`: not exactly one of `selector`, `xpath`, `json`; more than 50 fields at the top or 200 in total; nesting deeper than 3; a selector, path or regex longer than 500 characters. | Fix first | | 400 | `invalid_tag` | `tag` is empty, longer than 64 characters, or has characters other than `A–Z a–z 0–9 _ . : / -`. | Fix first | | 400 | `invalid_options` | An unknown option name (a misspelling is refused, not ignored), options that do not fit together or a wrong value: `session` with `fresh_ip` or with `retry.fresh_ip`; more than one of `body`, `json`, `form`; `render` with a method other than GET; `max_redirects` outside 0 to 10; `cookie_jar` not `true` or `false`; `max_credits` outside 1 to 1,000 or lower than the fixed costs of the request; `echo` larger than 2 KB. | Fix first | | 400 | `invalid_timeout` | `timeout_ms` is not a whole number of at least 1000. | Fix first | | 401 | `invalid_api_key` | The key is missing, mistyped or revoked. | Fix first | | 402 | `credits_exhausted` | No credits left in this period. In a job, the items that had not run yet end with this code. | Fix first | | 402 | `key_limit_reached` | This key has used the credit limit you set for it in the dashboard, for the running period. The account's other keys keep working. See [Limit what a key may spend](https://docs.virginproxy.com/security/#key-limit). | Fix first | | 402 | `daily_limit_reached` | The daily cap you set in the dashboard is used up for today (UTC): the account's cap, or the daily limit of this key. Nothing was charged. It opens again at midnight UTC (`retry_after_ms` says when); raise or remove the cap in the dashboard. See [Daily caps](https://docs.virginproxy.com/security/#daily-cap). | Fix firstwith `retry_after_ms` | | 403 | `account_suspended` | The account is suspended. | Fix first | | 403 | `email_not_verified` | The account's e-mail address is not confirmed yet. Open the link we sent, or have it sent again in the dashboard. | Fix first | | 403 | `ip_not_allowed` | The key is restricted to other IP addresses than the one you are calling from. | Fix first | | 403 | `target_not_allowed` | The target is in a private network or is not available on this service. | Fix first | | 404 | `not_found` | Unknown endpoint, unknown request id or unknown job id. | Fix first | | 413 | `body_too_large` | The whole call is larger than 8 MB. | Fix first | | 429 | `rate_limited` | Too many requests per second for your plan. | Wait, then retrywith `retry_after_ms` | | 429 | `concurrency_limited` | Too many requests at the same time for your plan. | Wait, then retrywith `retry_after_ms` | | 400 | `invalid_idempotency_key` | The `Idempotency-Key` header is empty, longer than 128 characters, or has characters other than visible ASCII. See [Send again safely](https://docs.virginproxy.com/limits/#idempotency). | Fix first | | 409 | `idempotency_in_progress` | A request with the same `Idempotency-Key` is still running. Wait `retry_after_ms`, then send again to get its answer. | Wait, then retrywith `retry_after_ms` | | 422 | `idempotency_key_reused` | This `Idempotency-Key` was used in the last 24 hours with a different body. Use a new key for a new request. | Fix first | ## Search, screenshots, map and crawl | HTTP | Code | Meaning | Retry | | --- | --- | --- | --- | | 400 | `invalid_map` | A call to `POST /v1/map` is not valid: `sitemap` not `include`, `skip` or `only`; `limit` outside 1 to 5,000; `search` empty or longer than 200 characters; `render` with `"sitemap": "only"`. See [Map a website](https://docs.virginproxy.com/map/). | Fix first | | 400 | `invalid_crawl` | A call to `POST /v1/crawl` is not valid: `max_pages` above your plan's job limit, `max_depth` outside 0 to 10, a path pattern not starting with `/`, `url` or `method` inside `request`, or an invalid page option (the message names it). See [Crawl a website](https://docs.virginproxy.com/crawl/). | Fix first | | 422 | `pdf_failed` | `GET /v1/pdf`: the page loaded, but no PDF could be made of it. Charged like any loaded page (`error.credits`). See [PDF documents](https://docs.virginproxy.com/screenshot/#pdf). | Fix first | | 424 | `search_failed` | `POST /v1/search`: the search engine sent no result page that could be read. The page it sent is charged like any request (`error.credits`); retry, or try another `engine`. See [Search](https://docs.virginproxy.com/search/). | Fix first | | 422 | `screenshot_failed` | `GET /v1/screenshot`: the page loaded, but no picture could be taken, for example because `selector` matched nothing visible. Charged like any loaded page (`error.credits`). See [Screenshots](https://docs.virginproxy.com/screenshot/). | Fix first | ## Jobs, batches and webhooks | HTTP | Code | Meaning | Retry | | --- | --- | --- | --- | | 400 | `invalid_job` | The job body is not valid: neither `requests` nor `request`, an empty list, or more requests than your plan allows. When one request is invalid, `error.index` names it and the message carries its own error code. | Fix first | | 400 | `invalid_delivery` | `delivery` is not valid, or `delivery.destination` is not one of your storage destinations. See [Delivery to your storage](https://docs.virginproxy.com/delivery/). | Fix first | | 400 | `invalid_webhook` | `webhook.url` is not a public `https://` address, or `webhook.events` contains something other than `item` and `done`. | Fix first | | 404 | `job_expired` | The job finished more than 24 hours ago; its results have been deleted. | Fix first | | 409 | `nothing_to_retry` | `POST /v1/jobs/{id}/retry`: the job has no failed requests to send again. | Fix first | | 400 | `invalid_batch` | The batch body is not valid: neither `requests` nor `urls` (or both), an empty list, more requests than your plan's batch limit, `request` without `urls`, or an `Idempotency-Key` header (a batch keeps no answer; use a job). When one request is invalid, `error.index` names it. See [Batches](https://docs.virginproxy.com/jobs/#batch). | Fix first | | 429 | `too_many_jobs` | Your account already has 20 jobs that are queued or running. Wait until one is done, or cancel one. | Wait, then retry | | 400 | `job_budget_reached` | Not an answer of a call but the code of job items: the job (or crawl) used its `max_credits`, so this request was not started and not charged. | Fix first | | 400 | `invalid_schedule` | The schedule body is not valid: no `max_credits`, an interval your plan does not allow, both or neither of `job` and `crawl`, or `max_credits` inside the job itself. The message names the field. | Fix first | | 409 | `too_many_schedules` | Your plan's number of schedules is reached (Free 1, Starter 5, Growth 20, Scale 50). Delete one first. | Fix first | ## Keys and webhooks through the API | HTTP | Code | Meaning | Retry | | --- | --- | --- | --- | | 400 | `invalid_destination` | A storage destination is not valid: the message names the field (bucket name, region, an endpoint that is not a public https address, a prefix starting with `/` or containing `..`, keys of the wrong length). | Fix first | | 409 | `too_many_destinations` | You have 10 storage destinations already. Delete one first. | Fix first | | 403 | `key_management_not_allowed` | Keys and webhook settings can only be changed with a live key that has no credit limit of its own. Test keys and limited keys (for example an agent's key) cannot, so they can never give themselves more. See [Manage keys through the API](https://docs.virginproxy.com/security/#keys-api). | Fix first | | 403 | `insufficient_scope` | The API key lacks the permission this call needs: `requests` (send requests, batches, screenshots, PDFs, maps, jobs and crawls), `read` (account, usage, request log) or `manage` (keys and webhook settings). `error.required_scope` names it, `error.key_scopes` lists the key's own. A key can also never give another key – or itself – permissions it does not have. See [Key permissions](https://docs.virginproxy.com/security/#scopes). | Fix first | | 409 | `own_key` | The call would revoke the key you are using, lock it out with an IP list that does not include the address you are calling from, or take `manage` from it. To do it on purpose, add `?confirm=revoke_current_key` (revoke) or `?confirm=drop_own_manage` (permissions). | Fix first | | 400 | `invalid_scopes` | `scopes` is not a non-empty list of `requests`, `read`, `manage` (or `null` for all). | Fix first | | 400 | `invalid_expiry` | `expires_at` is not an ISO date and time at least 5 minutes and at most 366 days ahead (or `null` for none). | Fix first | | 400 | `invalid_grace` | `grace` of a key roll is not `1h`, `24h` or `7d`; of a webhook secret rotation not `now`, `1h`, `24h` or `7d`. | Fix first | | 409 | `cannot_roll` | The key cannot be rolled or have its expiry changed: it was rolled already and ends with its grace period, or it belongs to a connected app (revoke it instead). | Fix first | | 409 | `too_many_keys` | The account already has 20 keys. Revoke one first. | Fix first | | 400 | `invalid_value` | A value of `PATCH /v1/account/settings` is not valid, for example `alert_thresholds` outside 1 to 100. The message names it. | Fix first | | 404 | `answer_not_kept` | `GET /v1/requests/{id}/answer`: no answer is kept for this request. Answers are kept 24 hours for requests sent with an `Idempotency-Key`, and as long as asked for cached requests. | Fix first | | 400 | `invalid_preset` | A preset is not valid: its name (lowercase letters, digits, `_ . -`), its `request` (checked like a request, without `url`), or a `preset` name in the wrong form. | Fix first | | 404 | `preset_not_found` | No preset with this name. List yours with `GET /v1/presets`. | Fix first | | 409 | `preset_exists` | A preset with this name exists already. Change it with `PATCH /v1/presets/{name}`. | Fix first | | 409 | `too_many_presets` | An account can have 100 presets. Delete one first. | Fix first | | 400 | `invalid_name` | The key name is missing or longer than 80 characters. | Fix first | | 400 | `invalid_ip_list` | `ip_allowlist` is not a list of up to 20 IP addresses (or `null`). | Fix first | | 400 | `invalid_limit` | `credit_limit` or `daily_limit` is not a whole number from 1 (or `null` for none). | Fix first | | 400 | `nothing_to_change` | A change of a key names none of `name`, `credit_limit`, `daily_limit`, `ip_allowlist`, `scopes`, `expires_at`. | Fix first | | 409 | `delivery_pending` | `POST /v1/webhooks/deliveries/{id}/redeliver`: the delivery is still being sent (retries are scheduled). Wait until it is delivered or given up. | Fix first | | 410 | `delivery_expired` | `POST /v1/webhooks/deliveries/{id}/redeliver`: the content of a delivery is kept 72 hours after its last attempt; this one is older. See [Send a delivery again](https://docs.virginproxy.com/webhooks/#redeliver). | Fix first | ## The target did not answer These use HTTP 424: your call was fine, but the request to the target failed. | HTTP | Code | Meaning | Retry | | --- | --- | --- | --- | | 424 | `timeout` | The target did not answer within the timeout. | Retry | | 424 | `target_unreachable` | The name does not resolve or no connection could be opened. | Retry | | 424 | `connection_failed` | The connection broke before a complete answer arrived. | Retry | | 424 | `tls_error` | The TLS handshake with the target failed, for example an invalid certificate. | Retry | | 424 | `too_many_redirects` | More redirects than `max_redirects` (default 5). | Fix first | | 424 | `request_failed` | Any other failure on the way to the target. | Retry | ## Something on our side | HTTP | Code | Meaning | Retry | | --- | --- | --- | --- | | 503 | `busy` | All capacity, or all browsers for `render`, stayed in use for as long as your plan waits. Retry after `retry_after_ms` when given, otherwise after a second or two. See [Load and priority](https://docs.virginproxy.com/priority/). | Wait, then retrywith `retry_after_ms` | | 503 | `render_unavailable` | Rendering is not available right now. Retry later or send the request without `render`. | Wait, then retry | | 503 | `rotation_failed` | A fresh IP could not be obtained in time. | Wait, then retry | | 503 | `executor_unavailable` | The service is temporarily not reachable. | Wait, then retry | | 503 | `maintenance` | The service is paused for maintenance. | Wait, then retrywith `retry_after_ms` | | 500 | `internal_error` | An unexpected error. Send us the `request_id`. | Fix first | ## Example: one invalid request in a job ```http HTTP/2 400 { "error": { "code": "invalid_job", "message": "requests[3]: invalid_url: url must start with http:// or https://.", "index": 3 }, "request_id": "call_bQ9sZk3HfJ1uYt6RmV0e" } ``` > **Tip:** Retry only what can succeed later: the codes marked *Wait, then retry* or *Retry* above. Inside a [job](https://docs.virginproxy.com/jobs/), temporary limits never fail an item: it simply waits. > **Note:** We never answer 502 or 504. If you see one, it came from the network between you and us, and the body will not be JSON. --- # Browser profiles > Every VirginProxy request is sent with a complete, current browser profile: headers, their order and the connection settings. How to choose the browser and the language. Source: https://docs.virginproxy.com/browsers/ A browser sends more than a User-Agent: a set of headers in a fixed order and its own connection settings. Every request through VirginProxy is sent with such a complete, current browser profile, so pages are delivered the way a browser receives them. By default that is Chrome on a Windows computer; `browser` chooses another one. ## Choose a browser | browser | Looks like | | --- | --- | | `chrome` | Chrome on Windows. The default. | | `chrome_mac` | Chrome on a Mac. | | `chrome_android` | Chrome on an Android phone. The default when you use [render](https://docs.virginproxy.com/render/). | | `edge` | Microsoft Edge on Windows. | | `firefox` | Firefox on Windows. | | `safari` | Safari on a Mac. | | `safari_ios` | Safari on an iPhone. | | `none` | No browser headers: only the headers you send, plus a User-Agent, `Accept: */*` and `Accept-Encoding`. Meant for APIs that expect a program, not a person. | **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://httpbin.org/headers", "browser": "safari_ios", "locale": "en-US" }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://httpbin.org/headers", "browser": "safari_ios", "locale": "en-US", }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["browser"], data["http_version"]) print(data["body"]) # the headers as the target received them ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://httpbin.org/headers", browser: "safari_ios", locale: "en-US", }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.browser, data.http_version); console.log(data.body); // the headers as the target received them ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://httpbin.org/headers", "browser": "safari_ios", "locale": "en-US", }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://httpbin.org/headers", browser: "safari_ios", locale: "en-US", }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://httpbin.org/headers", "browser" => "safari_ios", "locale" => "en-US", ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo $data["browser"], " ", $data["http_version"], PHP_EOL; echo $data["body"], PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://httpbin.org/headers", "browser": "safari_ios", "locale": "en-US" }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["browser"], data["http_version"]) fmt.Println(data["body"]) } ``` POST`/v1/requests`[≈ 1 credit](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL2h0dHBiaW4ub3JnL2hlYWRlcnMiLCJicm93c2VyIjoic2FmYXJpX2lvcyIsImxvY2FsZSI6ImVuLVVTIn0) ## What "looks like a browser" means - **The connection.** The encrypted connection is negotiated the way that browser does it, and HTTP/2 is used wherever the site supports it, as browsers do. `http_version` in the response tells you which version was used. - **The headers.** The request carries the headers that browser sends when you open a page (User-Agent, Accept, Accept-Language, the client hints of Chrome and Edge, the Sec-Fetch headers and so on), with matching values and in the browser's order. - **Redirects.** Each step of a redirect is sent as the browser would send it, with the cookies collected so far. ## Language: locale `locale` is the language of the visitor and fills `Accept-Language`. The default is `de-DE`. Use a language code, optionally with a region: `en`, `en-US`, `fr-FR`, `pt-BR`. | locale | Accept-Language sent | | --- | --- | | `de-DE` | `de-DE,de;q=0.9,en;q=0.8` | | `en-US` | `en-US,en;q=0.9` | | `fr` | `fr,en;q=0.8` | | `en` | `en` | When rendering, `locale` is also the language the browser reports to the page's scripts. ## Your own headers win Headers you send in `headers` replace the browser's headers of the same name, whatever their case. Headers the browser does not send are added after its own. An empty value leaves a header out completely. ```json { "url": "https://www.example.com/page", "headers": { "Referer": "https://www.example.org/", "Sec-Fetch-Site": "cross-site", "Priority": "" } } ``` > **Note:** A User-Agent of your own that does not match the rest of the browser profile gives an inconsistent request. To use another browser profile, choose it with `browser`. ## Which browser to pick - Start with the default. It works for most sites. - To see the mobile version of a page, choose `chrome_android` or `safari_ios`. - For JSON APIs, `none` sends only what you specify. With `render`, `chrome_android` and `safari_ios` load the page as a phone (small screen, touch), every other value as a desktop computer. --- # Pages with JavaScript > Load JavaScript pages in a real browser: wait conditions, steps (click, type, select, scripts), screenshots, PDF and captured background requests. Source: https://docs.virginproxy.com/render/ Some pages are empty until their scripts have run: search results, shops built as web apps, dashboards and single-page apps. `render` loads the page in a real browser, lets its scripts run and returns the finished page as HTML – plus screenshots, a PDF, the page's own background requests and the results of your steps if you ask for them. ## Render a page This demo page builds its quotes with JavaScript. A plain request gets an empty frame; rendered, the quotes are there. **cURL** ```bash curl https://api.virginproxy.com/v1/requests \ -H "Authorization: Bearer $VP_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://quotes.toscrape.com/js/", "render": { "wait_for": ".quote" } }' ``` **Python** ```python import os, requests r = requests.post( "https://api.virginproxy.com/v1/requests", headers={"Authorization": "Bearer " + os.environ["VP_KEY"]}, json={ "url": "https://quotes.toscrape.com/js/", "render": {"wait_for": ".quote"}, }, timeout=180, ) data = r.json() if not r.ok: raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"]) print(data["rendered"], data["status"], data["body"].count('class="quote"'), data["cost"]["credits"]) ``` **Node.js** ```javascript const res = await fetch("https://api.virginproxy.com/v1/requests", { method: "POST", headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://quotes.toscrape.com/js/", render: { wait_for: ".quote" }, }), signal: AbortSignal.timeout(180_000), }); const data = await res.json(); if (!res.ok) throw new Error(data.error.code + ": " + data.error.message); console.log(data.rendered, data.status, data.body.split('class="quote"').length - 1, data.cost.credits); ``` **Python SDK** ```pysdk from virginproxy import VirginProxy # docs.virginproxy.com/sdk/virginproxy.py vp = VirginProxy() # reads VP_KEY data = vp.request({ "url": "https://quotes.toscrape.com/js/", "render": {"wait_for": ".quote"}, }) print(data) ``` **Node SDK** ```nodesdk import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs const vp = new VirginProxy(); // reads VP_KEY const data = await vp.request({ url: "https://quotes.toscrape.com/js/", render: { wait_for: ".quote" }, }); console.log(data); ``` **PHP** ```php true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("VP_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "url" => "https://quotes.toscrape.com/js/", "render" => ["wait_for" => ".quote"], ], JSON_UNESCAPED_SLASHES), ]); $data = json_decode(curl_exec($ch), true); if (isset($data["error"])) { exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL); } echo json_encode([$data["rendered"], $data["status"], $data["cost"]["credits"]], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), PHP_EOL; ``` **Go** ```go package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os" "time" ) func main() { payload := []byte(`{ "url": "https://quotes.toscrape.com/js/", "render": { "wait_for": ".quote" } }`) req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/requests", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY")) req.Header.Set("Content-Type", "application/json") client := &http.Client{Timeout: 180 * time.Second} res, err := client.Do(req) if err != nil { log.Fatal(err) } defer res.Body.Close() var data map[string]any if err := json.NewDecoder(res.Body).Decode(&data); err != nil { log.Fatal(err) } if res.StatusCode >= 300 { e := data["error"].(map[string]any) log.Fatalf("%v: %v", e["code"], e["message"]) } fmt.Println(data["rendered"], data["status"], data["cost"].(map[string]any)["credits"]) } ``` POST`/v1/requests`[≈ 10 credits](https://docs.virginproxy.com/billing/#cost)[Open in Playground](https://dash.virginproxy.com/playground#request=eyJ1cmwiOiJodHRwczovL3F1b3Rlcy50b3NjcmFwZS5jb20vanMvIiwicmVuZGVyIjp7IndhaXRfZm9yIjoiLnF1b3RlIn19) `"render": true` is enough for many pages. The object form adds everything below. The device the page sees (time zone, location, screen, colour scheme, device properties, stored values) is described on [Device and environment](https://docs.virginproxy.com/device/). ## What you get back | Field | Meaning | | --- | --- | | `body` | The page as HTML after its scripts and your steps ran, always UTF-8 text. | | `status`, `headers`, `final_url`, `redirects` | Of the page itself. | | `cookies` | Every cookie the browser holds at the end. | | `rendered` | `true`. | | `screenshot`, `screenshot_type` | The screenshot as base64 and its type (`image/png`, `image/jpeg` or `image/webp`) when you asked for one, otherwise `null`. | | `pdf` | The page as a base64 PDF, only with `"pdf": true`. | | `steps` | One entry per action: `{"action", "ok", "skipped"?, "error"?, "value"?}`. `value` is the result of an `evaluate` step. | | `captured` | The background requests you asked for with `capture`: `{"url", "method", "status", "content_type", "body", "body_encoding", "truncated"}`. | | `extracted` | With `extract`, see [Extract data](https://docs.virginproxy.com/extract/). | ## Options | Field | Type | Meaning | | --- | --- | --- | | `wait_until` | string | When the page counts as loaded: `load` (default, everything loaded), `domcontentloaded` (the HTML is there, faster) or `networkidle` (no request ran for half a second, at most 15 seconds – for pages that keep fetching data after loading). | | `wait_for` | string | A CSS selector, up to 500 characters. Waits until such an element is visible. | | `wait_ms` | integer | 0 to 15,000. Waits this long at the end, for content that arrives late. | | `scroll` | integer | 0 to 20. Scrolls to the bottom this many times, with a short pause each time, so that content which loads while you scroll appears. | | `screenshot` | boolean or object | `true`: the visible area as PNG. Object: `{"full_page": true}` for the whole page (up to 16,000 pixels high), `{"selector": "#chart"}` for one element, `"format": "png" \| "jpeg" \| "webp"`, `"quality": 1–100` for JPEG and WebP. | | `pdf` | boolean | `true` also returns the page as a PDF (with backgrounds). | | `block` | list | What the browser does not load: any of `image`, `media`, `font`, `stylesheet`. Default `["image", "media", "font"]`, which saves time and credits. `[]` loads everything, for example for a screenshot with pictures. | | `block_urls` | list | Up to 50 address patterns the browser does not load, for example trackers or ads. Without `*` a pattern matches anywhere in the address; with `*` it is a wildcard: `*analytics.example*`, `https://cdn.example/*.js`. | | `capture` | list | Up to 10 address patterns (same rules). Matching background requests of the page (XHR, fetch, scripts …) come back in `captured`, at most 20, each body up to 1 MB. Many web apps load their data as JSON – this is often the cleanest way to get it. | | `actions` | list | Up to 30 steps that are carried out in order, see below. | ## Steps: click, type, keys, select, scripts Each step is an object with exactly one of these forms, plus optionally `"optional": true` and `"timeout_ms": 100–30000`: | Step | What it does | | --- | --- | | `{"click": "selector"}` | Clicks the first visible element that matches. | | `{"type": "selector", "text": "…"}` | Types the text (up to 2,000 characters) into the element. | | `{"press": "Enter"}` | Presses a key: `Enter`, `Tab`, `Escape`, `Backspace`, `Delete`, `ArrowDown`, `ArrowUp`, `ArrowLeft`, `ArrowRight`, `PageDown`, `PageUp`, `Home`, `End`, `Space` or a single character. | | `{"hover": "selector"}` | Moves the mouse over the element, for menus that open on hover. | | `{"select": "selector", "value": "…"}` | Chooses the option with this value in a `