curl --max-time 180 "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto"# pip install requests
import requests
url = 'https://httpbin.io/get'
apikey = 'YOUR_ZENROWS_API_KEY'
params = {
'url': url,
'apikey': apikey,
'mode': 'auto',
}
response = requests.get('https://api.zenrows.com/v1/', params=params)
print(response.text)// npm install axios
const axios = require('axios');
const url = 'https://httpbin.io/get';
const apikey = 'YOUR_ZENROWS_API_KEY';
axios({
url: 'https://api.zenrows.com/v1/',
method: 'GET',
params: {
'url': url,
'apikey': apikey,
'mode': 'auto',
},
})
.then(response => console.log(response.data))
.catch(error => console.log(error));const url = 'https://api.zenrows.com/v1/?apikey=';
const options = {method: 'GET'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"io"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto", nil)
if err != nil {
log.Fatalln(err)
}
resp, err := client.Do(req)
if err != nil {
log.Fatalln(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}
log.Println(string(body))
}<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);
$response = curl_exec($ch);
echo $response . PHP_EOL;
curl_close($ch);
?># gem install faraday
require 'faraday'
url = URI.parse('https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto')
conn = Faraday.new()
conn.options.timeout = 180
res = conn.get(url, nil, nil)
print(res.body)import org.apache.hc.client5.http.fluent.Request;
public class APIRequest {
public static void main(final String... args) throws Exception {
String apiUrl = "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto";
String response = Request.get(apiUrl)
.execute().returnContent().asString();
System.out.println(response);
}
}<!doctype html>
<html lang="en-US">
<head>
<title>Ecommerce Test Site to Learn Web Scraping</title>
</head>
<body>
<h1>Shop</h1>
...
</body>
</html>{
"code": "REQS004",
"instance": "/v1",
"status": 400,
"title": "Invalid value provided for 'js_render' parameter; invalid boolean value 'maybe' (REQS004)",
"type": "https://docs.zenrows.com/api-error-codes#REQS004"
}{
"code": "AUTH002",
"detail": "Invalid API key.",
"instance": "/v1",
"status": 401,
"title": "Invalid apikey provided (AUTH002)",
"type": "https://docs.zenrows.com/api-error-codes#AUTH002"
}{
"code": "AUTH004",
"detail": "This account has used all its credits for the period. Upgrade or add credits to continue.",
"instance": "/v1",
"status": 402,
"title": "Usage exceeded (AUTH004)",
"type": "https://docs.zenrows.com/api-error-codes#AUTH004"
}{
"code": "REQS007",
"detail": "Extract has not been prepared for example.org yet. Ask for it with POST /v1/extract/prepared-domains, then retry once it reports ready. GET /v1/extract/domains lists what Extract serves today.",
"instance": "/v1",
"status": 403,
"title": "Extract is not prepared for the requested domain (example.org) (REQS007)",
"type": "https://docs.zenrows.com/api-error-codes#REQS007"
}{
"code": "RESP001",
"detail": "The target could not be returned under this configuration. Try js_render=true and premium_proxy=true, or mode=auto.",
"instance": "/v1",
"status": 422,
"title": "Could not get content (RESP001)",
"type": "https://docs.zenrows.com/api-error-codes#RESP001"
}{
"code": "AUTH008",
"detail": "Every concurrency slot on the plan is in use. Retry when a request in flight finishes.",
"instance": "/v1",
"status": 429,
"title": "Concurrency limit reached (AUTH008)",
"type": "https://docs.zenrows.com/api-error-codes#AUTH008"
}Fetch a page
Retrieve a URL through Zenrows and return its content. The same operation covers Extract (extract=auto or css_extractor), format conversion (response_type), screenshots and structured output, because they are configurations of one request rather than separate endpoints.
curl --max-time 180 "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto"# pip install requests
import requests
url = 'https://httpbin.io/get'
apikey = 'YOUR_ZENROWS_API_KEY'
params = {
'url': url,
'apikey': apikey,
'mode': 'auto',
}
response = requests.get('https://api.zenrows.com/v1/', params=params)
print(response.text)// npm install axios
const axios = require('axios');
const url = 'https://httpbin.io/get';
const apikey = 'YOUR_ZENROWS_API_KEY';
axios({
url: 'https://api.zenrows.com/v1/',
method: 'GET',
params: {
'url': url,
'apikey': apikey,
'mode': 'auto',
},
})
.then(response => console.log(response.data))
.catch(error => console.log(error));const url = 'https://api.zenrows.com/v1/?apikey=';
const options = {method: 'GET'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"io"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto", nil)
if err != nil {
log.Fatalln(err)
}
resp, err := client.Do(req)
if err != nil {
log.Fatalln(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}
log.Println(string(body))
}<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);
$response = curl_exec($ch);
echo $response . PHP_EOL;
curl_close($ch);
?># gem install faraday
require 'faraday'
url = URI.parse('https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto')
conn = Faraday.new()
conn.options.timeout = 180
res = conn.get(url, nil, nil)
print(res.body)import org.apache.hc.client5.http.fluent.Request;
public class APIRequest {
public static void main(final String... args) throws Exception {
String apiUrl = "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fhttpbin.io%2Fget&mode=auto";
String response = Request.get(apiUrl)
.execute().returnContent().asString();
System.out.println(response);
}
}<!doctype html>
<html lang="en-US">
<head>
<title>Ecommerce Test Site to Learn Web Scraping</title>
</head>
<body>
<h1>Shop</h1>
...
</body>
</html>{
"code": "REQS004",
"instance": "/v1",
"status": 400,
"title": "Invalid value provided for 'js_render' parameter; invalid boolean value 'maybe' (REQS004)",
"type": "https://docs.zenrows.com/api-error-codes#REQS004"
}{
"code": "AUTH002",
"detail": "Invalid API key.",
"instance": "/v1",
"status": 401,
"title": "Invalid apikey provided (AUTH002)",
"type": "https://docs.zenrows.com/api-error-codes#AUTH002"
}{
"code": "AUTH004",
"detail": "This account has used all its credits for the period. Upgrade or add credits to continue.",
"instance": "/v1",
"status": 402,
"title": "Usage exceeded (AUTH004)",
"type": "https://docs.zenrows.com/api-error-codes#AUTH004"
}{
"code": "REQS007",
"detail": "Extract has not been prepared for example.org yet. Ask for it with POST /v1/extract/prepared-domains, then retry once it reports ready. GET /v1/extract/domains lists what Extract serves today.",
"instance": "/v1",
"status": 403,
"title": "Extract is not prepared for the requested domain (example.org) (REQS007)",
"type": "https://docs.zenrows.com/api-error-codes#REQS007"
}{
"code": "RESP001",
"detail": "The target could not be returned under this configuration. Try js_render=true and premium_proxy=true, or mode=auto.",
"instance": "/v1",
"status": 422,
"title": "Could not get content (RESP001)",
"type": "https://docs.zenrows.com/api-error-codes#RESP001"
}{
"code": "AUTH008",
"detail": "Every concurrency slot on the plan is in use. Retry when a request in flight finishes.",
"instance": "/v1",
"status": 429,
"title": "Concurrency limit reached (AUTH008)",
"type": "https://docs.zenrows.com/api-error-codes#AUTH008"
}Authorizations
Query Parameters
Adaptive Stealth Mode. auto starts from the cheapest viable configuration and escalates to JavaScript rendering or premium proxies only when the target requires it. You are billed for the configuration that succeeds. It manages js_render and premium_proxy itself, so setting either alongside it answers 400 REQS004; proxy_country is allowed.
auto Return structured JSON extracted from the page with no selectors to write (Extract). Omit it and Extract is off. auto and native return the website's own field names; standard returns a canonical schema shared by every website in a vertical (real estate only for now). Extract works on any prepared domain, with any active API key (prepare a new one with POST /extract/prepared-domains), and is currently free on top of the Fetch cost. A domain, or a kind of page on it, that is not prepared yet answers 403 REQS007: see requestExtractDomain.
auto, native, standard Response
The target's content, in the shape the request asked for: HTML by default, Markdown or plaintext with response_type, a PDF or PNG/JPEG binary for response_type=pdf and the screenshot parameters, and JSON for extract, css_extractor, autoparse or json_response.
The page as returned by the target.
Was this page helpful?