Upload a CSV of URLs
curl --request POST \
--url https://async.api.zenrows.com/v1/job_inputs \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "csv",
"csv": {
"header": true,
"fields": {
"url": "URL",
"external_id": "Customer Ref"
}
}
}
'import requests
url = "https://async.api.zenrows.com/v1/job_inputs"
payload = {
"type": "csv",
"csv": {
"header": True,
"fields": {
"url": "URL",
"external_id": "Customer Ref"
}
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'csv',
csv: {header: true, fields: {url: 'URL', external_id: 'Customer Ref'}}
})
};
fetch('https://async.api.zenrows.com/v1/job_inputs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://async.api.zenrows.com/v1/job_inputs';
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'csv',
csv: {header: true, fields: {url: 'URL', external_id: 'Customer Ref'}}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://async.api.zenrows.com/v1/job_inputs"
payload := strings.NewReader("{\n \"type\": \"csv\",\n \"csv\": {\n \"header\": true,\n \"fields\": {\n \"url\": \"URL\",\n \"external_id\": \"Customer Ref\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://async.api.zenrows.com/v1/job_inputs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'csv',
'csv' => [
'header' => true,
'fields' => [
'url' => 'URL',
'external_id' => 'Customer Ref'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://async.api.zenrows.com/v1/job_inputs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"csv\",\n \"csv\": {\n \"header\": true,\n \"fields\": {\n \"url\": \"URL\",\n \"external_id\": \"Customer Ref\"\n }\n }\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://async.api.zenrows.com/v1/job_inputs")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"csv\",\n \"csv\": {\n \"header\": true,\n \"fields\": {\n \"url\": \"URL\",\n \"external_id\": \"Customer Ref\"\n }\n }\n}")
.asString();{
"file_input_id": "fi_01M4F4B8D3E2C1A9",
"expires_at": "2026-10-09T15:10:00Z",
"upload": {
"url": "https://inputs.example-bucket.s3.amazonaws.com/fi_01M4F4B8D3E2C1A9.csv?X-Amz-Expires=3600",
"method": "PUT",
"headers": {
"Content-Type": "text/csv"
},
"expires_at": "2026-10-08T16:10:00Z"
}
}{
"code": "invalid_argument",
"detail": "Validation failed.",
"instance": "/v1",
"status": 400,
"title": "Validation failed (invalid_argument)",
"type": "https://docs.zenrows.com/api-error-codes#invalid_argument"
}{
"code": "unauthenticated",
"detail": "Invalid API key.",
"instance": "/v1",
"status": 401,
"title": "Unauthenticated (unauthenticated)",
"type": "https://docs.zenrows.com/api-error-codes#unauthenticated"
}{
"code": "payment_required",
"detail": "No credits available.",
"instance": "/v1",
"status": 402,
"title": "No credits available (payment_required)",
"type": "https://docs.zenrows.com/api-error-codes#payment_required"
}{
"code": "quota_exceeded",
"detail": "Too many active jobs.",
"instance": "/v1",
"status": 429,
"title": "Too many active jobs (quota_exceeded)",
"type": "https://docs.zenrows.com/api-error-codes#quota_exceeded"
}{
"code": "internal",
"detail": "Temporary failure, retry with backoff.",
"instance": "/v1",
"status": 503,
"title": "Temporary failure, retry with backoff (internal)",
"type": "https://docs.zenrows.com/api-error-codes#internal"
}Batch
Upload a CSV of URLs
Reserve an upload for a CSV too large to send inline (up to 50 MB and 100,000 rows; the slot lives 24 hours). Then PUT the raw file to upload.url with upload.headers, and pass file_input_id to createBatchJob.
POST
/
job_inputs
Upload a CSV of URLs
curl --request POST \
--url https://async.api.zenrows.com/v1/job_inputs \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "csv",
"csv": {
"header": true,
"fields": {
"url": "URL",
"external_id": "Customer Ref"
}
}
}
'import requests
url = "https://async.api.zenrows.com/v1/job_inputs"
payload = {
"type": "csv",
"csv": {
"header": True,
"fields": {
"url": "URL",
"external_id": "Customer Ref"
}
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'csv',
csv: {header: true, fields: {url: 'URL', external_id: 'Customer Ref'}}
})
};
fetch('https://async.api.zenrows.com/v1/job_inputs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://async.api.zenrows.com/v1/job_inputs';
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'csv',
csv: {header: true, fields: {url: 'URL', external_id: 'Customer Ref'}}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://async.api.zenrows.com/v1/job_inputs"
payload := strings.NewReader("{\n \"type\": \"csv\",\n \"csv\": {\n \"header\": true,\n \"fields\": {\n \"url\": \"URL\",\n \"external_id\": \"Customer Ref\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://async.api.zenrows.com/v1/job_inputs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'csv',
'csv' => [
'header' => true,
'fields' => [
'url' => 'URL',
'external_id' => 'Customer Ref'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://async.api.zenrows.com/v1/job_inputs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"csv\",\n \"csv\": {\n \"header\": true,\n \"fields\": {\n \"url\": \"URL\",\n \"external_id\": \"Customer Ref\"\n }\n }\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://async.api.zenrows.com/v1/job_inputs")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"csv\",\n \"csv\": {\n \"header\": true,\n \"fields\": {\n \"url\": \"URL\",\n \"external_id\": \"Customer Ref\"\n }\n }\n}")
.asString();{
"file_input_id": "fi_01M4F4B8D3E2C1A9",
"expires_at": "2026-10-09T15:10:00Z",
"upload": {
"url": "https://inputs.example-bucket.s3.amazonaws.com/fi_01M4F4B8D3E2C1A9.csv?X-Amz-Expires=3600",
"method": "PUT",
"headers": {
"Content-Type": "text/csv"
},
"expires_at": "2026-10-08T16:10:00Z"
}
}{
"code": "invalid_argument",
"detail": "Validation failed.",
"instance": "/v1",
"status": 400,
"title": "Validation failed (invalid_argument)",
"type": "https://docs.zenrows.com/api-error-codes#invalid_argument"
}{
"code": "unauthenticated",
"detail": "Invalid API key.",
"instance": "/v1",
"status": 401,
"title": "Unauthenticated (unauthenticated)",
"type": "https://docs.zenrows.com/api-error-codes#unauthenticated"
}{
"code": "payment_required",
"detail": "No credits available.",
"instance": "/v1",
"status": 402,
"title": "No credits available (payment_required)",
"type": "https://docs.zenrows.com/api-error-codes#payment_required"
}{
"code": "quota_exceeded",
"detail": "Too many active jobs.",
"instance": "/v1",
"status": 429,
"title": "Too many active jobs (quota_exceeded)",
"type": "https://docs.zenrows.com/api-error-codes#quota_exceeded"
}{
"code": "internal",
"detail": "Temporary failure, retry with backoff.",
"instance": "/v1",
"status": 503,
"title": "Temporary failure, retry with backoff (internal)",
"type": "https://docs.zenrows.com/api-error-codes#internal"
}Authorizations
Batch, Crawl, the Extract endpoints and the account endpoint read the same key from the X-API-Key header.
Body
application/json
Was this page helpful?