curl --request GET \
--url https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}';
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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/jobs/{job_id}/runs/{run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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/jobs/{job_id}/runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.get("https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}")
.header("X-API-Key", "<api-key>")
.asString();{
"run_id": "<string>",
"job_id": "<string>",
"run_sequence": 2,
"status": "running",
"stats": {
"total": 123,
"completed": 123,
"successful": 123,
"failed": 123,
"failure_reasons": {
"blocked": 9,
"gateway_error": 4
},
"spend": {
"credits": 1,
"cost": 1
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"trigger": "manual",
"last_batch_received": true,
"pause_state": "active",
"ingest_status": "pending",
"failure_reason": "insufficient_credits",
"failure_detail": "Subscription has no credit available."
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"instance": "<string>",
"invalid_tasks": [
{
"index": 123,
"reason": "malformed_url",
"value": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"instance": "<string>",
"invalid_tasks": [
{
"index": 123,
"reason": "malformed_url",
"value": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"instance": "<string>",
"invalid_tasks": [
{
"index": 123,
"reason": "malformed_url",
"value": "<string>"
}
]
}Get one run by id
curl --request GET \
--url https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}';
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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/jobs/{job_id}/runs/{run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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/jobs/{job_id}/runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.get("https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}")
.header("X-API-Key", "<api-key>")
.asString();{
"run_id": "<string>",
"job_id": "<string>",
"run_sequence": 2,
"status": "running",
"stats": {
"total": 123,
"completed": 123,
"successful": 123,
"failed": 123,
"failure_reasons": {
"blocked": 9,
"gateway_error": 4
},
"spend": {
"credits": 1,
"cost": 1
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"trigger": "manual",
"last_batch_received": true,
"pause_state": "active",
"ingest_status": "pending",
"failure_reason": "insufficient_credits",
"failure_detail": "Subscription has no credit available."
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"instance": "<string>",
"invalid_tasks": [
{
"index": 123,
"reason": "malformed_url",
"value": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"instance": "<string>",
"invalid_tasks": [
{
"index": 123,
"reason": "malformed_url",
"value": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"instance": "<string>",
"invalid_tasks": [
{
"index": 123,
"reason": "malformed_url",
"value": "<string>"
}
]
}Authorizations
Path Parameters
Response
OK
In-flight:
running: work queued / in flight.pending: initial run of an open job, idle between batches.
Terminal:
completed: natural finish.stopped: caller calledPOST /jobs/{id}/stop. No new tasks are picked up; in-flight tasks may still finish. Result bodies are kept.stats.completed < stats.totalsignals "stopped early".failed: the run was auto-failed on an account-level error (insufficient credits / inactive subscription / the API key's credit cap reached). No new tasks are picked up;failure_reasonandfailure_detailcarry the cause. Re-runnable once the account or cap is resolved. Result bodies already produced are kept.deleted: caller calledDELETE /v1/jobs/{id}/runs/{run_id}. The run's result bodies and data are being deleted; once complete the run disappears.
Clients must accept values not listed here.
running, pending, completed, stopped, failed, deleted What set this run in motion. Always set.
manual: caller-initiated:POST /jobs,POST /jobs/{id}/rerun(any job type, full or?status=-filtered, manual fire of a scheduled job).scheduled: automatic, fired by the configured schedule (recurring or one-shot).
Clients must accept values not listed here.
manual, scheduled Present only on runs created by a large (202) submission
or a large (202) rerun. pending: task rows are still
streaming into storage; reads may return partial pages
and addBatchTasks returns 409. done: every accepted
task row is visible. Omitted on runs whose tasks were
written on the request path (201 submissions and
reruns, addBatchTasks batches).
Clients must accept values not listed here.
pending, done Present only when status == failed: the account-level
cause of the auto-fail. Omitted otherwise. Distinct from
stats.failure_reasons (the per-task rollup).
insufficient_credits: the account is out of credits, or the plan doesn't include a feature the task needs.subscription_inactive: the subscription is not active or has expired, the plan doesn't include the API, or the job's API key is no longer valid.api_key_cap_reached: the job's API key reached one of its credit caps (day, week, month or billing period). Resolves on its own when that cap's window resets, or when the cap is raised.
Clients must accept values not listed here.
insufficient_credits, subscription_inactive, api_key_cap_reached Human-readable explanation of failure_reason, e.g. which
cap was reached and when it resets. Present only when
failure_reason is. At most 500 characters (Unicode code
points); longer upstream text is cut. Free text for display:
branch on failure_reason, never on this string.
"Subscription has no credit available."
Was this page helpful?