Get an API key Your API keys

Jobs and batches

A job is a list of requests that runs in the background. You send it in one call and get an id back at once; we work through it within your plan's limits and keep the results for you for 24 hours. Ideal for nightly price checks, large crawls and anything you do not want to wait for.

Create a job

POST /v1/jobs takes a list of requests, each exactly what you would send to POST /v1/requests. Use request instead for a single one.

curl https://api.virginproxy.com/v1/jobs \
  -H "Authorization: Bearer $VP_KEY" \
  -H "Idempotency-Key: nightly-2026-11-18" \
  -H "Content-Type: application/json" \
  -d '{
    "requests": [
      {
        "url": "https://shop.example/product/1",
        "extract": {
          "price": {
            "selector": ".price",
            "type": "number"
          }
        },
        "echo": {
          "sku": "TR-1"
        }
      },
      {
        "url": "https://shop.example/product/2",
        "extract": {
          "price": {
            "selector": ".price",
            "type": "number"
          }
        },
        "echo": {
          "sku": "TR-2"
        }
      },
      {
        "url": "https://shop.example/product/3",
        "extract": {
          "price": {
            "selector": ".price",
            "type": "number"
          }
        },
        "echo": {
          "sku": "TR-3"
        }
      }
    ],
    "webhook": {
      "url": "https://example.com/hooks/virginproxy",
      "events": [
        "item",
        "done"
      ]
    },
    "tag": "nightly-prices"
  }'
import os, requests

r = requests.post(
    "https://api.virginproxy.com/v1/jobs",
    headers={"Authorization": "Bearer " + os.environ["VP_KEY"], "Idempotency-Key": "nightly-2026-11-18"},
    json={
        "requests": [
            {
                "url": "https://shop.example/product/1",
                "extract": {"price": {"selector": ".price", "type": "number"}},
                "echo": {"sku": "TR-1"},
            },
            {
                "url": "https://shop.example/product/2",
                "extract": {"price": {"selector": ".price", "type": "number"}},
                "echo": {"sku": "TR-2"},
            },
            {
                "url": "https://shop.example/product/3",
                "extract": {"price": {"selector": ".price", "type": "number"}},
                "echo": {"sku": "TR-3"},
            },
        ],
        "webhook": {
            "url": "https://example.com/hooks/virginproxy",
            "events": ["item", "done"],
        },
        "tag": "nightly-prices",
    },
    timeout=30,
)
data = r.json()
if not r.ok:
    raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"])
print(data["id"], data["status"], data["total"])
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": "nightly-2026-11-18" },
  body: JSON.stringify({
    requests: [
      {
        url: "https://shop.example/product/1",
        extract: { price: { selector: ".price", type: "number" } },
        echo: { sku: "TR-1" },
      },
      {
        url: "https://shop.example/product/2",
        extract: { price: { selector: ".price", type: "number" } },
        echo: { sku: "TR-2" },
      },
      {
        url: "https://shop.example/product/3",
        extract: { price: { selector: ".price", type: "number" } },
        echo: { sku: "TR-3" },
      },
    ],
    webhook: {
      url: "https://example.com/hooks/virginproxy",
      events: ["item", "done"],
    },
    tag: "nightly-prices",
  }),
  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, data.total);
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/1",
            "extract": {"price": {"selector": ".price", "type": "number"}},
            "echo": {"sku": "TR-1"},
        },
        {
            "url": "https://shop.example/product/2",
            "extract": {"price": {"selector": ".price", "type": "number"}},
            "echo": {"sku": "TR-2"},
        },
        {
            "url": "https://shop.example/product/3",
            "extract": {"price": {"selector": ".price", "type": "number"}},
            "echo": {"sku": "TR-3"},
        },
    ],
    "webhook": {
        "url": "https://example.com/hooks/virginproxy",
        "events": ["item", "done"],
    },
    "tag": "nightly-prices",
})
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/1",
      extract: { price: { selector: ".price", type: "number" } },
      echo: { sku: "TR-1" },
    },
    {
      url: "https://shop.example/product/2",
      extract: { price: { selector: ".price", type: "number" } },
      echo: { sku: "TR-2" },
    },
    {
      url: "https://shop.example/product/3",
      extract: { price: { selector: ".price", type: "number" } },
      echo: { sku: "TR-3" },
    },
  ],
  webhook: {
    url: "https://example.com/hooks/virginproxy",
    events: ["item", "done"],
  },
  tag: "nightly-prices",
});
console.log(data);
<?php
$ch = curl_init("https://api.virginproxy.com/v1/jobs");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("VP_KEY"),
        "Content-Type: application/json",
        "Idempotency-Key: nightly-2026-11-18",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "requests" => [
            [
                "url" => "https://shop.example/product/1",
                "extract" => ["price" => ["selector" => ".price", "type" => "number"]],
                "echo" => ["sku" => "TR-1"],
            ],
            [
                "url" => "https://shop.example/product/2",
                "extract" => ["price" => ["selector" => ".price", "type" => "number"]],
                "echo" => ["sku" => "TR-2"],
            ],
            [
                "url" => "https://shop.example/product/3",
                "extract" => ["price" => ["selector" => ".price", "type" => "number"]],
                "echo" => ["sku" => "TR-3"],
            ],
        ],
        "webhook" => [
            "url" => "https://example.com/hooks/virginproxy",
            "events" => ["item", "done"],
        ],
        "tag" => "nightly-prices",
    ], 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"], " ", $data["total"], PHP_EOL;
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"os"
	"time"
)

func main() {
	payload := []byte(`{
  "requests": [
    {
      "url": "https://shop.example/product/1",
      "extract": {
        "price": {
          "selector": ".price",
          "type": "number"
        }
      },
      "echo": {
        "sku": "TR-1"
      }
    },
    {
      "url": "https://shop.example/product/2",
      "extract": {
        "price": {
          "selector": ".price",
          "type": "number"
        }
      },
      "echo": {
        "sku": "TR-2"
      }
    },
    {
      "url": "https://shop.example/product/3",
      "extract": {
        "price": {
          "selector": ".price",
          "type": "number"
        }
      },
      "echo": {
        "sku": "TR-3"
      }
    }
  ],
  "webhook": {
    "url": "https://example.com/hooks/virginproxy",
    "events": [
      "item",
      "done"
    ]
  },
  "tag": "nightly-prices"
}`)
	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", "nightly-2026-11-18")

	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"], data["total"])
}
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"] = "nightly-2026-11-18"
req.body = JSON.generate({
  "requests" => [
    {
      "url" => "https://shop.example/product/1",
      "extract" => { "price" => { "selector" => ".price", "type" => "number" } },
      "echo" => { "sku" => "TR-1" },
    },
    {
      "url" => "https://shop.example/product/2",
      "extract" => { "price" => { "selector" => ".price", "type" => "number" } },
      "echo" => { "sku" => "TR-2" },
    },
    {
      "url" => "https://shop.example/product/3",
      "extract" => { "price" => { "selector" => ".price", "type" => "number" } },
      "echo" => { "sku" => "TR-3" },
    },
  ],
  "webhook" => {
    "url" => "https://example.com/hooks/virginproxy",
    "events" => ["item", "done"],
  },
  "tag" => "nightly-prices",
})

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"], data["total"]].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/1",
                  "extract": {
                    "price": {
                      "selector": ".price",
                      "type": "number"
                    }
                  },
                  "echo": {
                    "sku": "TR-1"
                  }
                },
                {
                  "url": "https://shop.example/product/2",
                  "extract": {
                    "price": {
                      "selector": ".price",
                      "type": "number"
                    }
                  },
                  "echo": {
                    "sku": "TR-2"
                  }
                },
                {
                  "url": "https://shop.example/product/3",
                  "extract": {
                    "price": {
                      "selector": ".price",
                      "type": "number"
                    }
                  },
                  "echo": {
                    "sku": "TR-3"
                  }
                }
              ],
              "webhook": {
                "url": "https://example.com/hooks/virginproxy",
                "events": [
                  "item",
                  "done"
                ]
              },
              "tag": "nightly-prices"
            }
            """;
        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", "nightly-2026-11-18")
            .timeout(Duration.ofSeconds(30))
            .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(30) };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY"));
var payload = """
    {
      "requests": [
        {
          "url": "https://shop.example/product/1",
          "extract": {
            "price": {
              "selector": ".price",
              "type": "number"
            }
          },
          "echo": {
            "sku": "TR-1"
          }
        },
        {
          "url": "https://shop.example/product/2",
          "extract": {
            "price": {
              "selector": ".price",
              "type": "number"
            }
          },
          "echo": {
            "sku": "TR-2"
          }
        },
        {
          "url": "https://shop.example/product/3",
          "extract": {
            "price": {
              "selector": ".price",
              "type": "number"
            }
          },
          "echo": {
            "sku": "TR-3"
          }
        }
      ],
      "webhook": {
        "url": "https://example.com/hooks/virginproxy",
        "events": [
          "item",
          "done"
        ]
      },
      "tag": "nightly-prices"
    }
    """;
var req = new HttpRequestMessage(HttpMethod.Post, "https://api.virginproxy.com/v1/jobs");
req.Headers.Add("Idempotency-Key", "nightly-2026-11-18");
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") + " " + data.RootElement.GetProperty("total"));
POST/v1/jobs≈ 3 credits

The answer is 202 Accepted with the job's state:

Response · 202 Accepted
{
  "id": "job_8fK2pQ7wLz3nVd0sXa4T",
  "status": "queued",
  "total": 3,
  "succeeded": 0,
  "failed": 0,
  "canceled": 0,
  "pending": 3,
  "credits": 0,
  "tag": "nightly-prices",
  "webhook": { "url": "https://example.com/hooks/virginproxy", "events": ["item", "done"] },
  "created_at": "2026-11-18T09:00:00.000Z",
  "started_at": null,
  "finished_at": null,
  "expires_at": null,
  "last_progress_at": null
}
FieldTypeMeaning
requestslist1 up to your plan's limit, see Limits. Every request is checked when the job is created: if one is invalid, nothing is created and you get invalid_job with its index.
requestobjectA single request instead of requests.
webhookobjectOptional. Where we send results as they arrive, see Webhooks.
tagstringOptional. Marks the job (same rules as a request's tag) and comes back in its state.

Tip

Put your own reference into each request's echo – an id, a SKU, a row number. It comes back unchanged in the result, so you never have to match results by URL.

Safe to retry: Idempotency-Key

Send an Idempotency-Key header of your choice with POST /v1/jobs. If the same key arrives again within 24 hours – because your network dropped the first answer, for example – you get the same job back instead of a second one: HTTP 200 instead of 202 and the header Idempotent-Replayed: true.

Follow its progress

curl https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T \
  -H "Authorization: Bearer $VP_KEY"
import os, requests

r = requests.get(
    "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T",
    headers={"Authorization": "Bearer " + os.environ["VP_KEY"]},
    timeout=30,
)
data = r.json()
if not r.ok:
    raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"])
print(data["status"], data["succeeded"], data["failed"], data["pending"])
const res = await fetch("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T", {
  headers: { Authorization: "Bearer " + process.env.VP_KEY },
  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.succeeded, data.failed, data.pending);
from virginproxy import VirginProxy  # docs.virginproxy.com/sdk/virginproxy.py

vp = VirginProxy()  # reads VP_KEY
data = vp.call("GET", "/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T")
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("GET", "/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T");
console.log(data);
<?php
$ch = curl_init("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("VP_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (isset($data["error"])) {
    exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL);
}
echo $data["status"], " ", $data["succeeded"], " ", $data["failed"], " ", $data["pending"], PHP_EOL;
package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"os"
	"time"
)

func main() {
	req, err := http.NewRequest("GET", "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T", nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY"))

	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["succeeded"], data["failed"], data["pending"])
}
require "json"
require "net/http"

uri = URI("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY")

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["succeeded"], data["failed"], data["pending"]].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 {
        HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T"))
            .header("Authorization", "Bearer " + System.getenv("VP_KEY"))
            .timeout(Duration.ofSeconds(30))
            .GET()
            .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(30) };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T");
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("succeeded") + " " + data.RootElement.GetProperty("failed") + " " + data.RootElement.GetProperty("pending"));
GET/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T
Response · 200 OK
{
  "id": "job_8fK2pQ7wLz3nVd0sXa4T",
  "status": "done",
  "total": 3,
  "succeeded": 2,
  "failed": 1,
  "canceled": 0,
  "pending": 0,
  "credits": 2,
  "tag": "nightly-prices",
  "webhook": { "url": "https://example.com/hooks/virginproxy", "events": ["item", "done"] },
  "created_at": "2026-11-18T09:00:00.000Z",
  "started_at": "2026-11-18T09:00:00.214Z",
  "finished_at": "2026-11-18T09:00:04.512Z",
  "expires_at": "2026-11-19T09:00:04.512Z",
  "last_progress_at": "2026-11-18T09:00:04.512Z"
}
FieldMeaning
statusqueued → running → done, or canceled. done means every item has finished, whether or not some failed. After 24 hours: expired.
succeeded, failed, canceled, pendingHow many items ended which way, and how many are still waiting or running. Together they add up to total.
creditsCredits charged for the job so far.
webhookThe webhook as you set it, or null.
created_at, started_at, finished_at, expires_atWhen the job was created, when its first item started, when its last item finished, and when its results will be deleted (24 hours after finished_at). null until then.
last_progress_atWhen an item of the job last finished – while it runs, this shows whether it is still moving. null until the first item finishes.

Fetch the results

GET /v1/jobs/{id}/results returns the items in pages of up to 100, in the order of your list. Results are available while the job is still running.

curl "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded" \
  -H "Authorization: Bearer $VP_KEY"
import os, requests

r = requests.get(
    "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded",
    headers={"Authorization": "Bearer " + os.environ["VP_KEY"]},
    timeout=30,
)
data = r.json()
if not r.ok:
    raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"])
print(data["next_offset"])
print(data["items"])
const res = await fetch("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded", {
  headers: { Authorization: "Bearer " + process.env.VP_KEY },
  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.next_offset);
console.log(data.items);
from virginproxy import VirginProxy  # docs.virginproxy.com/sdk/virginproxy.py

vp = VirginProxy()  # reads VP_KEY
data = vp.call("GET", "/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded")
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("GET", "/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded");
console.log(data);
<?php
$ch = curl_init("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("VP_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (isset($data["error"])) {
    exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL);
}
echo $data["next_offset"], PHP_EOL;
echo json_encode($data["items"], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), PHP_EOL;
package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"os"
	"time"
)

func main() {
	req, err := http.NewRequest("GET", "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded", nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY"))

	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["next_offset"])
	fmt.Println(data["items"])
}
require "json"
require "net/http"

uri = URI("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY")

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["next_offset"]
puts JSON.pretty_generate(data["items"])
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 {
        HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded"))
            .header("Authorization", "Bearer " + System.getenv("VP_KEY"))
            .timeout(Duration.ofSeconds(30))
            .GET()
            .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(30) };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded");
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("next_offset"));
Console.WriteLine(data.RootElement.GetProperty("items"));
GET/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/results?offset=0&limit=100&status=succeeded
Response · 200 OK (shortened)
{
  "job": { "id": "job_8fK2pQ7wLz3nVd0sXa4T", "status": "done", "total": 3, "succeeded": 2, "failed": 1, "canceled": 0, "pending": 0, "credits": 2, "…": "…" },
  "items": [
    {
      "index": 0,
      "status": "succeeded",
      "request_id": "req_Qm4tY8bN2xLs0Pd7Wk3e",
      "credits": 1,
      "finished_at": "2026-11-18T09:00:02.088Z",
      "response": {
        "id": "req_Qm4tY8bN2xLs0Pd7Wk3e",
        "status": 200,
        "final_url": "https://shop.example/product/1",
        "extracted": { "price": 129 },
        "echo": { "sku": "TR-1" },
        "cost": { "credits": 1 },
        "…": "…"
      }
    },
    {
      "index": 2,
      "status": "failed",
      "request_id": "req_Lx9cV2nB5mQ8sT1wR6yA",
      "credits": 0,
      "finished_at": "2026-11-18T09:00:04.512Z",
      "error": { "code": "timeout", "message": "The target did not answer within 30000 ms." }
    }
  ],
  "next_offset": null
}
ParameterMeaning
offsetWhere to start, default 0. Use next_offset from the previous page; it is null on the last page.
limit1 to 100, default 100.
statusOnly items with this status: queued, running, succeeded, failed or canceled.

Each item has its index in your list, its status, the url you sent, the request_id, the credits it cost, when it finished_at (null while it waits or runs), and either response – exactly the answer POST /v1/requests would have given, echo included – or error with code and message.

Item statuses

StatusMeaning
queuedWaiting for a free slot.
runningBeing fetched right now.
succeededThe target answered, whatever its HTTP status. response is set.
failedThe request ended with an error such as timeout or credits_exhausted. error is set.
canceledThe job was canceled before this item started.

Download all results

GET /v1/jobs/{id}/export sends every result of a job as one file, read page by page while it streams – also for a job that is still running (what has finished so far).

formatFile
ndjsonDefault. One item per line, exactly as in GET /v1/jobs/{id}/results.
json{"job": {…}, "items": [ … ]}.
csvOne row per item: index, status, URL, final URL, HTTP status, credits, request id, error, and extracted / parsed as JSON text. Page bodies only with include_body=true. Values that a spreadsheet would run as a formula are prefixed with '.
Download as CSV
curl "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/export?format=csv" \
  -H "Authorization: Bearer $VP_KEY" \
  -o results.csv

status=failed (or any item status) exports only those items; include_body=false leaves out page bodies, screenshots and PDFs. The export is free and works as long as the results are kept (24 hours after the job ended).

Send the failed requests again

POST /v1/jobs/{id}/retry creates a new job from the requests of this job that failed – exactly as they were sent, with the same webhook and tag – and answers 202 with the new job. Requests that succeeded are not sent again. A job without failed requests answers nothing_to_retry (409).

Results as they come: the stream

GET /v1/jobs/{id}/stream keeps the connection open and sends one line of JSON for every finished item while the job runs (NDJSON): first {"type": "start", "job"}, then {"type": "item", "index", "status", "response" | "error", …}, at the end {"type": "end", "job"}. Without news a {"type": "ping"} line comes every 25 seconds. After 15 minutes a {"type": "reconnect", "after"} line ends the call: call again with ?after= that value and nothing is lost or repeated. ?include_body=false leaves out page bodies, screenshots and PDFs. Up to 5 streams can be open at once per account.

Follow a job
curl -N https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T/stream \
  -H "Authorization: Bearer $VP_KEY"

Long lists as a file (NDJSON)

Send up to 32 MB as Content-Type: application/x-ndjson: one request per line. An optional first line {"job": {…}} carries the job's own options – webhook, tag, max_credits, delivery.

urls.ndjson
{"job": {"tag": "nightly", "delivery": {"destination": "dst_9Lk2Vb7Qx0Pm3Rn5Tz8W"}}}
{"url": "https://shop.example/p/1", "auto_extract": "product"}
{"url": "https://shop.example/p/2", "auto_extract": "product"}
Send it
curl https://api.virginproxy.com/v1/jobs \
  -H "Authorization: Bearer $VP_KEY" \
  -H "Content-Type: application/x-ndjson" \
  --data-binary @urls.ndjson

Results can go straight into your own bucket when the job ends: see Delivery to your storage.

List your jobs

GET /v1/jobs returns your jobs, newest first: ?limit=1..100&before=<job id>. The answer is {"items": [job, …], "next": "<job id>" | null}; pass next as before for the next page.

Cancel a job

curl -X DELETE https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T \
  -H "Authorization: Bearer $VP_KEY"
import os, requests

r = requests.delete(
    "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T",
    headers={"Authorization": "Bearer " + os.environ["VP_KEY"]},
    timeout=30,
)
data = r.json()
if not r.ok:
    raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"])
print(data["status"], data["canceled"])
const res = await fetch("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T", {
  method: "DELETE",
  headers: { Authorization: "Bearer " + process.env.VP_KEY },
  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.canceled);
from virginproxy import VirginProxy  # docs.virginproxy.com/sdk/virginproxy.py

vp = VirginProxy()  # reads VP_KEY
data = vp.call("DELETE", "/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T")
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("DELETE", "/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T");
console.log(data);
<?php
$ch = curl_init("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("VP_KEY"),
    ],
]);
$data = json_decode(curl_exec($ch), true);
if (isset($data["error"])) {
    exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL);
}
echo $data["status"], " ", $data["canceled"], PHP_EOL;
package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"os"
	"time"
)

func main() {
	req, err := http.NewRequest("DELETE", "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T", nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY"))

	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["canceled"])
}
require "json"
require "net/http"

uri = URI("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T")
req = Net::HTTP::Delete.new(uri)
req["Authorization"] = "Bearer " + ENV.fetch("VP_KEY")

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["canceled"]].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 {
        HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T"))
            .header("Authorization", "Bearer " + System.getenv("VP_KEY"))
            .timeout(Duration.ofSeconds(30))
            .DELETE()
            .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(30) };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY"));
var req = new HttpRequestMessage(HttpMethod.Delete, "https://api.virginproxy.com/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T");
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("canceled"));
DELETE/v1/jobs/job_8fK2pQ7wLz3nVd0sXa4T

Items that have not started are marked canceled and cost nothing; items already running finish normally. The job's status becomes canceled.

Batches: a few requests, answered at once

When you need a handful of pages now and do not want to poll a job, send them to POST /v1/batch. They run at the same time, up to your plan's parallel limit, and the answer comes when all are done – within about 85 seconds. Send full request bodies in requests, or a list of urls with the options for every URL in request:

curl https://api.virginproxy.com/v1/batch \
  -H "Authorization: Bearer $VP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example.com/",
      "https://example.org/"
    ],
    "request": {
      "format": "markdown",
      "main_content": true
    },
    "max_credits": 50
  }'
import os, requests

r = requests.post(
    "https://api.virginproxy.com/v1/batch",
    headers={"Authorization": "Bearer " + os.environ["VP_KEY"]},
    json={
        "urls": ["https://example.com/", "https://example.org/"],
        "request": {"format": "markdown", "main_content": True},
        "max_credits": 50,
    },
    timeout=120,
)
data = r.json()
if not r.ok:
    raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"])
print(data["succeeded"], 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/", "https://example.org/"],
    request: { format: "markdown", main_content: true },
    max_credits: 50,
  }),
  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.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/", "https://example.org/"],
    "request": {"format": "markdown", "main_content": True},
    "max_credits": 50,
})
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/", "https://example.org/"],
  request: { format: "markdown", main_content: true },
  max_credits: 50,
});
console.log(data);
<?php
$ch = curl_init("https://api.virginproxy.com/v1/batch");
curl_setopt_array($ch, [
    CURLOPT_POST => 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/", "https://example.org/"],
        "request" => ["format" => "markdown", "main_content" => true],
        "max_credits" => 50,
    ], 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["cost"]["credits"], PHP_EOL;
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"os"
	"time"
)

func main() {
	payload := []byte(`{
  "urls": [
    "https://example.com/",
    "https://example.org/"
  ],
  "request": {
    "format": "markdown",
    "main_content": true
  },
  "max_credits": 50
}`)
	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["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/", "https://example.org/"],
  "request" => { "format" => "markdown", "main_content" => true },
  "max_credits" => 50,
})

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["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/",
                "https://example.org/"
              ],
              "request": {
                "format": "markdown",
                "main_content": true
              },
              "max_credits": 50
            }
            """;
        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<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(120) };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("VP_KEY"));
var payload = """
    {
      "urls": [
        "https://example.com/",
        "https://example.org/"
      ],
      "request": {
        "format": "markdown",
        "main_content": true
      },
      "max_credits": 50
    }
    """;
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("cost").GetProperty("credits"));
POST/v1/batch≈ 2 credits
Response · 200 OK (shortened)
{
  "requests": 2,
  "succeeded": 1,
  "failed": 1,
  "skipped": 0,
  "items": [
    {
      "index": 0,
      "status": "succeeded",
      "response": { "id": "req_Rk2VwP8sLm4nQx7TbZ1c", "status": 200, "final_url": "https://example.com/", "format": "markdown", "body": "# Example Domain\n…", "cost": { "credits": 1 }, "…": "…" }
    },
    {
      "index": 1,
      "status": "failed",
      "request_id": "req_Hd5YtM0qWn3cLs9KpA7e",
      "error": { "code": "timeout", "message": "The target did not answer in time. This request was not charged.", "charged": false }
    }
  ],
  "cost": { "credits": 1, "credits_used": 413, "credits_included": 25000 },
  "duration_ms": 31877
}
PlanRequests per batch
Free3
Starter10
Growth20
Scale25

Limits

PlanRequests per jobPages per crawl
Free1010
Starter1,000100
Growth10,000500
Scale50,0001,000

Cost

Each item costs exactly what the same single request would cost; the job itself is free. Canceled items and items the target never answered cost nothing. When your credits run out during a job, the items that have not run yet fail with credits_exhausted. To cap single items, give them max_credits, see Credits and billing.

Retention

The results of a job are kept for 24 hours after it finished, then deleted for good; GET then answers job_expired (404). The request itself – its headers, cookies and body – is deleted as soon as its item has run. See What we store.

Note

In the dashboard, the Jobs page shows every job with its progress, lets you cancel it, download its results as JSON Lines or as a CSV overview (one line per URL with status, final URL, HTTP status, credits and error code, without the page bodies), copy the URLs that failed and see each webhook delivery.

Was this page helpful?

Last updated