# 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
<?php
$ch = curl_init("https://api.virginproxy.com/v1/requests");
curl_setopt_array($ch, [
    CURLOPT_POST => 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.
