Render a page in a real browser, tell it what to wait for or do, and get the page plus any captured network response back as JSON.
Endpoint
POST https://scrape.proxyrack.net/api/v1-beta/?api_key=YOUR_KEY Content-Type: application/json
The API key goes in the query string, everything else in the JSON body. The existing GET /api/v1/ endpoint is unchanged.
Request
{ "url": "https://example.com/page", "country_code": "us", "device_type": "desktop", "premium": true, "referer": "https://www.google.com/", "render": { "instructions": [ ... ] } }Send render to load the page in a browser, or http for a plain request. One or the other, not both.
Field | Meaning |
| Optional exit country, ISO 3166-1 alpha-2, lowercase. |
|
|
| Default |
| Sent as the navigation referrer. |
| Steps the browser runs after the page has loaded, in order. |
| Plain mode only: request method and body, for form or JSON posts. |
Instructions
Every step is {"type": ..., ...}. Times are seconds, fractions allowed. Each wait needs a timeout; the whole plan must fit in 60 seconds.
Type | Fields | Does |
|
| Pause. |
|
| Wait until an element matching |
|
| Wait for an XHR or fetch whose URL contains the text. With |
|
| Wait for the page to navigate to a new document, e.g. after a click. |
|
| Wait until the current document reaches |
|
| Scroll the element into view and click it. |
|
| Focus the element and type the value. |
|
| Run JavaScript in the page; the value you |
Selectors are one of {"css": "#id"}, {"xpath": "//div[@id='id']"}, or {"text": "Track shipment"} (substring of the rendered text).
may_fail: true on any step lets the plan continue if that step fails; the error is still reported on the step.
Response
{ "status_code": 200, "resolved_url": "https://example.com/page", "headers": [{"name": "content-type", "value": "text/html"}, ...], "body": "<html>...", "render": { "steps": [ {"type": "wait_for_response", "duration": 4.7, "result": {"url": "...", "status_code": 200, "headers": [...], "body": "{...}"}} ], "xhr": [{"url": "...", "method": "POST", "status_code": 200, "size": 4381}, ...] } }status_code,resolved_url,headersandbodydescribe the final document, after redirects and navigations.bodyis the rendered DOM.stepshas one entry per instruction that ran, in order, with its duration and, forwait_for_responsewith capture and forevaluate, aresult.xhrlists every XHR and fetch the page made, so you can find the data call to capture.
Example: MSC container tracking
The page loads its result through a TrackingInfo request after load. Capture that instead of parsing the DOM:
curl -s 'https://scrape.proxyrack.net/api/v1-beta/?api_key=YOUR_KEY' \ -H 'Content-Type: application/json' \ -d '{ "url": "https://www.msc.com/en/track-a-shipment?params=dHJhY2tpbmdOdW1iZXI9RUJLRzE4MDM5MjgyJnRyYWNraW5nTW9kZT0x", "premium": true, "render": { "instructions": [ {"type": "wait_for_response", "url_contains": "TrackingInfo", "timeout": 40, "capture": true} ] } }'The carrier’s JSON is in render.steps[0].result.body. Typical time: about 10 seconds. params is base64 of trackingNumber=EBKG18039282&trackingMode=1; both keys must be present or the page does not search.
Notes
One render is one browser on one exit IP; the page and its XHRs share both.
Custom request headers and cookies are not accepted in this beta;
refereris the one request header you can set.Unknown fields, unknown instruction types and legacy instruction shapes are rejected with 400 naming the field.
