SDKs and tools
Two small official clients – one file each, no dependencies – cover every endpoint, retry short-lived limits on their own and verify webhook signatures. Download the file into your project and import it.
| Language | File | Needs |
|---|---|---|
| Python | virginproxy.py | Python 3.8+, standard library only |
| Node.js | virginproxy.mjs + virginproxy.d.ts (types) | Node.js 18+, no packages |
curl -O https://docs.virginproxy.com/sdk/virginproxy.py
curl -O https://docs.virginproxy.com/sdk/virginproxy.mjsUse
from virginproxy import VirginProxy, VirginProxyError
vp = VirginProxy() # reads VP_KEY
page = vp.scrape("https://example.com/") # Markdown of the main content
print(page["body"][:200], page["cost"]["credits"])
shot = vp.screenshot("https://example.com/", full_page=True)
open("page.png", "wb").write(shot.body)
batch = vp.batch(urls=["https://example.com/", "https://example.org/"])
job = vp.crawl("https://example.com/", max_pages=50)
vp.wait_for_job(job["id"])
for item in vp.iter_job_results(job["id"]):
print(item["url"], item["status"])
try:
vp.request({"url": "https://example.com/", "max_credits": 5})
except VirginProxyError as e:
print(e.code, e.message, e.request_id)import { VirginProxy, VirginProxyError } from './virginproxy.mjs';
const vp = new VirginProxy(); // reads VP_KEY
const page = await vp.scrape('https://example.com/'); // Markdown of the main content
console.log(page.body.slice(0, 200), page.cost.credits);
const shot = await vp.screenshot('https://example.com/', { full_page: true });
await import('node:fs/promises').then((fs) => fs.writeFile('page.png', shot.image));
const batch = await vp.batchUrls(['https://example.com/', 'https://example.org/']);
const job = await vp.crawl({ url: 'https://example.com/', max_pages: 50 });
await vp.waitForJob(job.id);
for await (const item of vp.iterJobResults(job.id)) console.log(item.url, item.status);
try {
await vp.request({ url: 'https://example.com/', max_credits: 5 });
} catch (err) {
if (err instanceof VirginProxyError) console.log(err.code, err.message, err.requestId);
}What the clients do for you
- One method per endpoint: requests, raw, screenshot, PDF, batch, map, estimate, jobs and crawls (with waiting, paging through results and export), account, usage, request log, keys and webhooks.
- Errors become an exception with the API's
code,status,request_id,retry_after_ms,chargedandcredits. rate_limited,concurrency_limited,busyand the other wait-and-retry codes are retried after the time the API asks for (2 times by default,max_retries/maxRetries). Nothing else is retried, so nothing is charged twice.idempotency_key/idempotencyKeyon requests, jobs and crawls (Send again safely).- Webhook signatures:
verify_webhook(secret, raw_body, header)in Python,VirginProxy.verifyWebhook(secret, rawBody, header)in Node.js – constant time, with a 5-minute window. - Test keys (
vp_test_…) work unchanged: see Test mode.
Which method calls which endpoint
Read from the two client files, so this table always matches the version you download. Helpers that build on another method (for example scrape on request) are listed with its endpoint.
| Endpoint | Node.js | Python |
|---|---|---|
POST /v1/requests | request(), scrape() | request(), scrape() |
GET /v1/raw | raw() | raw() |
GET /v1/screenshot | screenshot() | screenshot() |
POST /v1/estimate | estimate() | estimate() |
GET /v1/pdf | pdf() | pdf() |
POST /v1/batch | batch(), batchUrls() | batch() |
POST /v1/map | map() | map() |
POST /v1/search | search() | search() |
POST /v1/crawl | crawl() | crawl() |
GET /v1/jobs | listJobs() | list_jobs() |
POST /v1/jobs | createJob(), createJobNdjson() | create_job() |
GET /v1/jobs/{id} | getJob(), waitForJob() | get_job(), wait_for_job() |
DELETE /v1/jobs/{id} | cancelJob() | cancel_job() |
GET /v1/jobs/{id}/results | jobResults(), iterJobResults() | job_results(), iter_job_results() |
GET /v1/jobs/{id}/stream | streamJob() | not in the client – use call() |
GET /v1/jobs/{id}/export | exportJob() | export_job() |
POST /v1/jobs/{id}/retry | retryJob() | retry_job() |
GET /v1/requests | listRequests() | list_requests() |
GET /v1/requests/{id} | getRequest() | get_request() |
GET /v1/requests/{id}/answer | getAnswer() | get_answer() |
GET /v1/limits | limits() | limits() |
PATCH /v1/account/settings | updateSettings() | update_settings() |
GET /v1/account | account() | account() |
GET /v1/usage | usage() | usage() |
GET /v1/usage/breakdown | usageBreakdown() | usage_breakdown() |
GET /v1/destinations | listDestinations() | list_destinations() |
POST /v1/destinations | createDestination() | create_destination() |
DELETE /v1/destinations/{id} | deleteDestination() | delete_destination() |
POST /v1/destinations/{id}/test | testDestination() | test_destination() |
GET /v1/keys | listKeys() | list_keys() |
POST /v1/keys | createKey() | create_key() |
PATCH /v1/keys/{id} | updateKey() | update_key() |
DELETE /v1/keys/{id} | revokeKey() | revoke_key() |
POST /v1/keys/{id}/roll | rollKey() | roll_key() |
GET /v1/webhooks | getWebhooks() | get_webhooks() |
POST /v1/webhooks/secret | rotateWebhookSecret() | rotate_webhook_secret() |
GET /v1/webhooks/deliveries | listDeliveries() | list_deliveries() |
GET /v1/webhooks/deliveries/{id} | getDelivery() | get_delivery() |
POST /v1/webhooks/test | testWebhook() | test_webhook() |
POST /v1/webhooks/deliveries/{id}/redeliver | redeliver() | redeliver() |
GET /v1/presets | listPresets() | list_presets() |
POST /v1/presets | createPreset() | create_preset() |
GET /v1/presets/{name} | getPreset() | get_preset() |
PATCH /v1/presets/{name} | updatePreset() | update_preset() |
DELETE /v1/presets/{name} | deletePreset() | delete_preset() |
GET /v1/schedules | listSchedules() | list_schedules() |
POST /v1/schedules | createSchedule() | create_schedule() |
GET /v1/schedules/{id} | getSchedule() | get_schedule() |
PATCH /v1/schedules/{id} | updateSchedule(), pauseSchedule(), resumeSchedule() | update_schedule(), pause_schedule(), resume_schedule() |
DELETE /v1/schedules/{id} | deleteSchedule() | delete_schedule() |
POST /v1/schedules/preview | previewSchedule() | preview_schedule() |
GET /v1/schedules/{id}/reports | scheduleReports() | schedule_reports() |
POST /v1/schedules/{id}/run | runSchedule() | run_schedule() |
GET /v1/docs | not in the client – use call() | not in the client – use call() |
GET /v1/docs/{name} | not in the client – use call() | not in the client – use call() |
GET /v1/status | status() | status() |
GET /v1/errors | errors() | errors() |
3 endpoints have no method of their own yet. Every endpoint can still be reached with the generic vp.call(method, path, …) of both clients, which adds the key, retries and error handling.
Postman and Insomnia
The Postman collection has every endpoint with its parameters and example bodies, grouped like this documentation. Import it, then set the collection variable VP_KEY to your key. Insomnia, Bruno and most other API tools import the same file – or the OpenAPI description directly.
Generate your own client
For other languages, generate a client from the OpenAPI 3.1 description with the generator you like; it is built from the same lists as this documentation and the API's own checks. Or call the API with any HTTP library, as in the language guides.
Note
The clients are offered as files on this site; there is no package on a package registry yet.
Was this page helpful?
Last updated