Parameter 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 https://api.virginproxy.com/v1/requests \
-H "Authorization: Bearer $VP_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://httpbin.org/ip"
}'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"])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);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)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
$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;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"])
}require "json"
require "net/http"
uri = URI("https://api.virginproxy.com/v1/requests")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY")
req["Content-Type"] = "application/json"
req.body = JSON.generate({ "url" => "https://httpbin.org/ip" })
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 180) { |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 = """
{
"url": "https://httpbin.org/ip"
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/requests"))
.header("Authorization", "Bearer " + System.getenv("VP_KEY"))
.header("Content-Type", "application/json")
.timeout(Duration.ofSeconds(180))
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> 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(180) };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY"));
var payload = """
{
"url": "https://httpbin.org/ip"
}
""";
var req = new HttpRequestMessage(HttpMethod.Post, "https://api.virginproxy.com/v1/requests");
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/requests≈ 1 creditOpen in PlaygroundAll parameters
83 parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Target and method | |||
url | string | required | Absolute http or https URL, up to 8,000 characters. Credentials inside the URL are rejected. |
method | string | "GET" | GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS. With render only GET. |
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 | 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 | string | "de-DE" | Language of the visitor. Sets Accept-Language, and the browser language when rendering. |
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 | object | list | – | {"name": "value"} or a list of {"name", "value", "domain"?, "path"?}. At most 200. |
cookie_jar | boolean | true | Only with session: remember cookies the site sets for the next requests of the session. |
json | any JSON | – | Body sent as JSON. Sets Content-Type: application/json unless you send your own. |
form | object | – | Body sent as an HTML form (application/x-www-form-urlencoded). |
body | string | – | Body sent exactly as given, up to 5 MB. Set your own Content-Type. |
body_encoding | string | "utf8" | "base64" when body is base64-encoded binary data. |
| IP and session | |||
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 | boolean | false | Get a new IP address before the request. 5 extra credits. Not with session. |
ip_version | string | "4" | "4", "6" or "auto". |
| Redirects, time and retries | |||
follow_redirects | boolean | true | Follow redirects. false returns the redirect response itself. |
max_redirects | integer | 5 | 0 to 10. More redirects end with too_many_redirects. |
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 | object | – | Try again before answering when the target refuses or fails. {} uses all defaults. |
retry. | integer | 1 | How many more attempts at most: 0 to 3. |
retry. | 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. | boolean | false | A new IP before each further attempt (5 credits each). |
retry. | list | – | Up to 10 texts (each up to 200 characters, case ignored). An answer whose body contains one of them is tried again. |
retry. | string | – | A CSS selector. An HTML answer in which it finds nothing is tried again. |
| Rendering | |||
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 | object | – | Only with "render": "auto": the browser settings for the second try (the options of render, without screenshot, PDF, steps, capture). |
render. | string | "load" | load, domcontentloaded or networkidle. |
render. | string | – | CSS selector to wait for until it is visible. |
render. | integer | 0 | 0 to 15,000 milliseconds to wait at the end. |
render. | integer | 0 | Scroll to the bottom 0 to 20 times. |
render. | boolean | object | false | Screenshot of the visible area, the full page or one element; PNG, JPEG or WebP. |
render. | boolean | false | Also return the page as a PDF. |
render. | list | ["image", "media", "font"] | Resource types the browser does not load: image, media, font, stylesheet. |
render. | list | [] | Up to 50 address patterns the browser does not load. |
render. | list | [] | Up to 10 address patterns; matching background requests come back in captured. |
render. | list | [] | Up to 30 steps: click, type, press, hover, select, scroll, wait, evaluate, goto. |
render. | string | "Europe/Berlin" | IANA time zone the page sees. |
render. | object | – | {"latitude", "longitude", "accuracy"} reported by navigator.geolocation. |
render. | object | by browser | {"width", "height", "scale"}: screen size and pixel density. |
render. | string | "light" | "light" or "dark" for prefers-color-scheme. |
render. | boolean | false | Report prefers-reduced-motion: reduce. |
render. | integer | by browser | 1 to 64: navigator.hardwareConcurrency. |
render. | number | by browser | 0.25 to 8: navigator.deviceMemory. |
render. | boolean | true | false loads the page without running its scripts. |
render. | object | – | Up to 100 entries put into localStorage before the page's scripts run. |
render. | object | – | The same for sessionStorage. |
render. | 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 | string | "raw" | raw, markdown, text or clean_html. Converts an HTML answer before it is returned. |
main_content | boolean | false | Keep only the main content of the page (without navigation, header, footer, sidebars and forms) before converting. |
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 | list | true | – | Black out personal data in the text you get: email, phone, iban, card, ip; true for all. Counted in redacted. |
auto_extract | string | – | Read a standard record without selectors: product, article, job, review_list, recipe, event, organization. Result in auto_extracted. |
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 | object | – | Up to 50 named fields read from the answer with CSS, XPath or JSON paths. Result in extracted. |
extract. | string | – | CSS selector, up to 500 characters. Exactly one of selector, xpath, json. |
extract. | string | – | XPath expression, up to 500 characters. |
extract. | string | – | Path into a JSON answer such as data.items[*].name. |
extract. | string | "text" | text, html, outer_html or an attribute name such as href. |
extract. | boolean | false | A list of all matches (up to 1,000) instead of the first. |
extract. | string | "string" | string, number, integer or boolean. |
extract. | string | – | Regular expression applied to the value; the first group, otherwise the whole match. |
extract. | any | null | Returned when nothing matched. |
extract. | object | – | Sub-fields read relative to each match: objects, or a list of objects with all. Up to 3 levels. |
| Connection | |||
http_version | string | "auto" | "auto" or "1.1". Only without render. |
insecure | boolean | false | Accept invalid TLS certificates of the target. |
| Cost and tracking | |||
max_credits | integer | – | 1 to 1,000. The request never costs more; the answer is cut to fit. |
tag | string | – | 1 to 64 characters A–Z a–z 0–9 _ . : / -. Stored with the request, returned in the answer, filterable. |
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 | 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 | 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 | string | – | Use the options saved under this name (POST /v1/presets); options you send win. |
| Jobs (POST /v1/jobs) | |||
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 | object | – | A single request instead of requests. |
urls | list | – | Addresses instead of requests; each is sent with the options in defaults. |
defaults | object | – | With urls: the options for every address (as for POST /v1/requests, without url). |
max_credits | integer | – | Cost 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. |
webhook. | string | – | A public https:// address. |
webhook. | 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. | boolean | true | false: item events carry the figures and id, not the page – fetch it from the results. |
webhook. | object | – | Up to 1 KB of your own data, sent back in every webhook call of the job. |
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 | header | – | The same key within 24 hours returns the same job instead of creating a second one. |
No parameter matches. Try a shorter word, or .
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.
Was this page helpful?
Last updated