Get an API key Your API keys

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.

LanguageFileNeeds
Pythonvirginproxy.pyPython 3.8+, standard library only
Node.jsvirginproxy.mjs + virginproxy.d.ts (types)Node.js 18+, no packages
Download
curl -O https://docs.virginproxy.com/sdk/virginproxy.py
curl -O https://docs.virginproxy.com/sdk/virginproxy.mjs

Use

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

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.

EndpointNode.jsPython
POST /v1/requestsrequest(), scrape()request(), scrape()
GET /v1/rawraw()raw()
GET /v1/screenshotscreenshot()screenshot()
POST /v1/estimateestimate()estimate()
GET /v1/pdfpdf()pdf()
POST /v1/batchbatch(), batchUrls()batch()
POST /v1/mapmap()map()
POST /v1/searchsearch()search()
POST /v1/crawlcrawl()crawl()
GET /v1/jobslistJobs()list_jobs()
POST /v1/jobscreateJob(), 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}/resultsjobResults(), iterJobResults()job_results(), iter_job_results()
GET /v1/jobs/{id}/streamstreamJob()not in the client – use call()
GET /v1/jobs/{id}/exportexportJob()export_job()
POST /v1/jobs/{id}/retryretryJob()retry_job()
GET /v1/requestslistRequests()list_requests()
GET /v1/requests/{id}getRequest()get_request()
GET /v1/requests/{id}/answergetAnswer()get_answer()
GET /v1/limitslimits()limits()
PATCH /v1/account/settingsupdateSettings()update_settings()
GET /v1/accountaccount()account()
GET /v1/usageusage()usage()
GET /v1/usage/breakdownusageBreakdown()usage_breakdown()
GET /v1/destinationslistDestinations()list_destinations()
POST /v1/destinationscreateDestination()create_destination()
DELETE /v1/destinations/{id}deleteDestination()delete_destination()
POST /v1/destinations/{id}/testtestDestination()test_destination()
GET /v1/keyslistKeys()list_keys()
POST /v1/keyscreateKey()create_key()
PATCH /v1/keys/{id}updateKey()update_key()
DELETE /v1/keys/{id}revokeKey()revoke_key()
POST /v1/keys/{id}/rollrollKey()roll_key()
GET /v1/webhooksgetWebhooks()get_webhooks()
POST /v1/webhooks/secretrotateWebhookSecret()rotate_webhook_secret()
GET /v1/webhooks/deliverieslistDeliveries()list_deliveries()
GET /v1/webhooks/deliveries/{id}getDelivery()get_delivery()
POST /v1/webhooks/testtestWebhook()test_webhook()
POST /v1/webhooks/deliveries/{id}/redeliverredeliver()redeliver()
GET /v1/presetslistPresets()list_presets()
POST /v1/presetscreatePreset()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/scheduleslistSchedules()list_schedules()
POST /v1/schedulescreateSchedule()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/previewpreviewSchedule()preview_schedule()
GET /v1/schedules/{id}/reportsscheduleReports()schedule_reports()
POST /v1/schedules/{id}/runrunSchedule()run_schedule()
GET /v1/docsnot 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/statusstatus()status()
GET /v1/errorserrors()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