Poll async content extraction job status
curl --request GET \
--url https://api.valyu.ai/v1/contents/jobs/{job_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.valyu.ai/v1/contents/jobs/{job_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://api.valyu.ai/v1/contents/jobs/{job_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyu.ai/v1/contents/jobs/{job_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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.valyu.ai/v1/contents/jobs/{job_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))
}HttpResponse<String> response = Unirest.get("https://api.valyu.ai/v1/contents/jobs/{job_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/contents/jobs/{job_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_body{
"success": true,
"job_id": "cj_a1b2c3d4e5f6g7h8",
"status": "completed",
"urls_total": 25,
"urls_processed": 23,
"urls_failed": 2,
"created_at": 1707000000000,
"updated_at": 1707000060000,
"current_batch": 3,
"total_batches": 5,
"results": [
{
"url": "https://example.com/research/source-1",
"status": "success",
"title": "Illustrative source document",
"content": "Placeholder content representing the text returned from a source.",
"description": "Illustrative metadata, not a factual research finding.",
"source": "web",
"price": 0.00125,
"length": 65,
"data_type": "unstructured",
"source_type": "website",
"publication_date": "2024-03-15",
"cache_state": "miss",
"crawled_at": "2026-10-28T10:15:00+00:00",
"final_url": "https://example.com/careers",
"http_status": 404,
"id": "https://example.com/research/source-1",
"image_url": {
"0": "https://example.com/images/source-image.png"
},
"screenshot_url": "https://example.com/screenshots/source-1.png",
"summary": "<string>",
"summary_success": true,
"structured_metadata": {},
"error": "Could not extract content from this URL. The page may be unavailable, require sign-in, or block automated access.",
"doi": "<string>",
"authors": [
"<string>"
],
"citation_count": 123
}
],
"actual_cost_dollars": 0.02875,
"error": "<string>"
}Contents Job Status
Reference for polling async content extraction job status via GET /v1/contents/jobs/.
GET
/
v1
/
contents
/
jobs
/
{job_id}
Poll async content extraction job status
curl --request GET \
--url https://api.valyu.ai/v1/contents/jobs/{job_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.valyu.ai/v1/contents/jobs/{job_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://api.valyu.ai/v1/contents/jobs/{job_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyu.ai/v1/contents/jobs/{job_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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.valyu.ai/v1/contents/jobs/{job_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))
}HttpResponse<String> response = Unirest.get("https://api.valyu.ai/v1/contents/jobs/{job_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/contents/jobs/{job_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_body{
"success": true,
"job_id": "cj_a1b2c3d4e5f6g7h8",
"status": "completed",
"urls_total": 25,
"urls_processed": 23,
"urls_failed": 2,
"created_at": 1707000000000,
"updated_at": 1707000060000,
"current_batch": 3,
"total_batches": 5,
"results": [
{
"url": "https://example.com/research/source-1",
"status": "success",
"title": "Illustrative source document",
"content": "Placeholder content representing the text returned from a source.",
"description": "Illustrative metadata, not a factual research finding.",
"source": "web",
"price": 0.00125,
"length": 65,
"data_type": "unstructured",
"source_type": "website",
"publication_date": "2024-03-15",
"cache_state": "miss",
"crawled_at": "2026-10-28T10:15:00+00:00",
"final_url": "https://example.com/careers",
"http_status": 404,
"id": "https://example.com/research/source-1",
"image_url": {
"0": "https://example.com/images/source-image.png"
},
"screenshot_url": "https://example.com/screenshots/source-1.png",
"summary": "<string>",
"summary_success": true,
"structured_metadata": {},
"error": "Could not extract content from this URL. The page may be unavailable, require sign-in, or block automated access.",
"doi": "<string>",
"authors": [
"<string>"
],
"citation_count": 123
}
],
"actual_cost_dollars": 0.02875,
"error": "<string>"
}Retrieve the status and results for the
job_id returned by an asynchronous Contents request. Store this ID when creating the job so your application can resume polling after a restart.
Poll with a delay rather than continuously, stop at a terminal state, and inspect each URL’s extraction result. A completed job does not imply that every requested page was accessible.
A failed job returns results and actual_cost_dollars like the other finished states. Every URL has a result with its status and error. A not-found page (a 404 with no real content) has status: "not_found" and error: "Page not found (404)". The job-level error can be empty, so read the error of each result.
If the webhook for a job is not confirmed, Valyu sends it again, up to 3 times. Use job_id to ignore a copy that you already processed.
A URL that fails with a retryable error gets one automatic retry, and you are billed once.
Start an extraction with Contents.Authorizations
API key for authentication. Get yours at platform.valyu.ai.
Response
Job status and results (when complete).
Async job status and results.
Current job status.
pending- Job created, not yet startedprocessing- URLs are being processedcompleted- All URLs processed successfullypartial- Processing finished with some failuresfailed- All URLs failed. The response still lists every URL inresults, each with itsstatusanderror.
Available options:
pending, processing, completed, partial, failed Example:
"completed"
Was this page helpful?