curl --request GET \
--url https://api.context.dev/v1/batch/{batch_id}/results \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.context.dev/v1/batch/{batch_id}/results"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.context.dev/v1/batch/{batch_id}/results', 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.context.dev/v1/batch/{batch_id}/results",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.context.dev/v1/batch/{batch_id}/results"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.context.dev/v1/batch/{batch_id}/results")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/batch/{batch_id}/results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"data": [
{
"url": "https://example.com/products/anvil",
"status": "ok",
"http_status": 200,
"final_url": "<string>",
"metadata": {
"sourceUrl": "<string>",
"finalUrl": "<string>",
"title": "<string>",
"description": "<string>",
"language": "<string>",
"keywords": [
"<string>"
],
"canonicalUrl": "<string>",
"author": "<string>",
"siteName": "<string>",
"image": "<string>",
"favicon": "<string>",
"publishedTime": "<string>",
"modifiedTime": "<string>",
"robots": "<string>",
"openGraph": {},
"twitter": {},
"alternates": [
{
"href": "<string>",
"hreflang": "<string>",
"type": "<string>",
"title": "<string>"
}
],
"headings": [
{
"level": 3,
"text": "<string>"
}
],
"jsonLd": [
{}
],
"additionalMeta": {}
},
"cache_metadata": {
"status": "hit",
"age_ms": 1
},
"itemId": "sku-1",
"meta": {},
"markdown": "<string>",
"html": "<string>",
"ocr_pages": 3
}
],
"has_more": true,
"next_cursor": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}List Batch Results
Page through a finished batch’s results as JSON instead of downloading the NDJSON files.
curl --request GET \
--url https://api.context.dev/v1/batch/{batch_id}/results \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.context.dev/v1/batch/{batch_id}/results"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.context.dev/v1/batch/{batch_id}/results', 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.context.dev/v1/batch/{batch_id}/results",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.context.dev/v1/batch/{batch_id}/results"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.context.dev/v1/batch/{batch_id}/results")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/batch/{batch_id}/results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"data": [
{
"url": "https://example.com/products/anvil",
"status": "ok",
"http_status": 200,
"final_url": "<string>",
"metadata": {
"sourceUrl": "<string>",
"finalUrl": "<string>",
"title": "<string>",
"description": "<string>",
"language": "<string>",
"keywords": [
"<string>"
],
"canonicalUrl": "<string>",
"author": "<string>",
"siteName": "<string>",
"image": "<string>",
"favicon": "<string>",
"publishedTime": "<string>",
"modifiedTime": "<string>",
"robots": "<string>",
"openGraph": {},
"twitter": {},
"alternates": [
{
"href": "<string>",
"hreflang": "<string>",
"type": "<string>",
"title": "<string>"
}
],
"headings": [
{
"level": 3,
"text": "<string>"
}
],
"jsonLd": [
{}
],
"additionalMeta": {}
},
"cache_metadata": {
"status": "hit",
"age_ms": 1
},
"itemId": "sku-1",
"meta": {},
"markdown": "<string>",
"html": "<string>",
"ocr_pages": 3
}
],
"has_more": true,
"next_cursor": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Authorizations
Bearer authentication header of the form Bearer <API_KEY>. Keys have full access by default.
Path Parameters
ID of the batch to retrieve or cancel.
"batch_9f2c8a"
Query Parameters
Records per page. Defaults to 25. A page can close early so its payload stays under ~8 MB; rely on next_cursor rather than counting records.
1 <= x <= 100next_cursor from the previous page.
Response
One page of result records. Keep paging with next_cursor while has_more is true.
Unique id of this API call, also sent in the X-Request-Id response header. Quote it when contacting support about a failed request.
"3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91"
Result records on this page.
A page the batch fetched successfully.
- Scraped page
- Failed page
Show child attributes
Show child attributes
Whether another page is available.
Cursor for the next page.
Credit usage, included whenever a valid API key is provided.
Show child attributes
Show child attributes
Was this page helpful?