Skip to main content
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>'
{
  "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://en.wikipedia.org/wiki/Quantum_computing",
      "status": "success",
      "title": "Quantum computing - Wikipedia",
      "content": "# Quantum computing\n\nQuantum computing is a type of computation...",
      "description": "Quantum computing is a type of computation that harnesses quantum mechanical phenomena.",
      "source": "web",
      "price": 0.001,
      "length": 24500,
      "data_type": "unstructured",
      "source_type": "website",
      "publication_date": "2024-03-15",
      "id": "https://en.wikipedia.org/wiki/Quantum_computing",
      "image_url": {
        "0": "https://upload.wikimedia.org/wikipedia/commons/quantum.png"
      },
      "screenshot_url": null,
      "summary": "<string>",
      "summary_success": true,
      "structured_metadata": {},
      "error": "Failed to fetch URL: connection timeout"
    }
  ],
  "actual_cost_dollars": 0.023,
  "error": "<string>"
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get yours at platform.valyu.ai.

Path Parameters

job_id
string
required

The job ID returned by the async contents request.

Response

Job status and results (when complete).

Async job status and results.

success
boolean
required

Whether the request succeeded.

Example:

true

job_id
string
required

Unique identifier for the async job.

Example:

"cj_a1b2c3d4e5f6g7h8"

status
enum<string>
required

Current job status.

  • pending - Job created, not yet started
  • processing - URLs are being processed
  • completed - All URLs processed successfully
  • partial - Processing finished with some failures
  • failed - All URLs failed
Available options:
pending,
processing,
completed,
partial,
failed
Example:

"completed"

urls_total
integer
required

Total number of URLs to process.

Example:

25

urls_processed
integer
required

Number of URLs successfully processed so far.

Example:

23

urls_failed
integer
required

Number of URLs that failed processing.

Example:

2

created_at
integer

Job creation time as Unix timestamp in milliseconds.

Example:

1707000000000

updated_at
integer

Last update time as Unix timestamp in milliseconds.

Example:

1707000060000

current_batch
integer

Current batch being processed. Only present when status is "processing".

Example:

3

total_batches
integer

Total number of batches. Only present when status is "processing".

Example:

5

results
object[]

Extraction results. Only present when status is "completed" or "partial".

actual_cost_dollars
number

Total cost in USD. Only present when processing is complete.

Example:

0.023

error
string

Error message. Only present when status is "failed" or "partial".