curl --request GET \
--url https://api.context.dev/v1/batch/list \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.context.dev/v1/batch/list"
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/list', 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/list",
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/list"
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/list")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/batch/list")
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": [
{
"id": "batch_9f2c8a",
"status": "queued",
"mode": "scrape",
"format": "markdown",
"tags": [
"docs"
],
"crawl": {
"source": {
"type": "start_url",
"url": "https://example.com/docs"
},
"max_pages": 500,
"max_depth": 0,
"follow_subdomains": true,
"url_pattern": "^https://example\\.com/docs/"
},
"input": {
"reserved": 24817,
"reserved_is_ceiling": false,
"submitted": 25000,
"duplicates": 183,
"invalid": 0
},
"progress": {
"succeeded": 18091,
"failed": 311,
"pending": 6415
},
"credits": {
"reserved": 24817,
"refunded": 6726,
"ocr_charged": 42,
"net": 18091
},
"timing": {
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>"
},
"page_errors": [
{
"code": "WEBSITE_ACCESS_ERROR",
"count": 204
}
],
"failure": {
"code": "stalled",
"message": "Batch stopped reporting progress and was finalized automatically"
},
"results": {
"expires_at": "<string>",
"files": [
{
"url": "<string>",
"items": 123,
"bytes": 123
}
]
}
}
],
"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",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}List Batches
List your batches from newest to oldest. Filter by status or continue with a cursor.
curl --request GET \
--url https://api.context.dev/v1/batch/list \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.context.dev/v1/batch/list"
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/list', 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/list",
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/list"
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/list")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/batch/list")
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": [
{
"id": "batch_9f2c8a",
"status": "queued",
"mode": "scrape",
"format": "markdown",
"tags": [
"docs"
],
"crawl": {
"source": {
"type": "start_url",
"url": "https://example.com/docs"
},
"max_pages": 500,
"max_depth": 0,
"follow_subdomains": true,
"url_pattern": "^https://example\\.com/docs/"
},
"input": {
"reserved": 24817,
"reserved_is_ceiling": false,
"submitted": 25000,
"duplicates": 183,
"invalid": 0
},
"progress": {
"succeeded": 18091,
"failed": 311,
"pending": 6415
},
"credits": {
"reserved": 24817,
"refunded": 6726,
"ocr_charged": 42,
"net": 18091
},
"timing": {
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>"
},
"page_errors": [
{
"code": "WEBSITE_ACCESS_ERROR",
"count": 204
}
],
"failure": {
"code": "stalled",
"message": "Batch stopped reporting progress and was finalized automatically"
},
"results": {
"expires_at": "<string>",
"files": [
{
"url": "<string>",
"items": 123,
"bytes": 123
}
]
}
}
],
"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",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Authorizations
Bearer authentication header of the form Bearer <API_KEY>, where <API_KEY> is your api key.
Query Parameters
Batches per page. Defaults to 25.
1 <= x <= 100Cursor from the previous page.
Filter by status.
queued, running, cancelling, completed, cancelled, failed Free-text search term, matched against the batch id, crawl source (start URL or sitemap domain), and tags.
200"batch_1a2b"
prefix for as-you-type prefix matching (default), exact for full-token matching.
exact, prefix Comma-separated list of tags to filter by (matches batches having any of them).
"docs,competitor"
Response
Your batches, newest first. Use next_cursor to page through the rest.
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"
Batches on this 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?