import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.batch.getResults('batch_9f2c8a');
console.log(response.data);import os
from context.dev import ContextDev
client = ContextDev(
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
)
response = client.batch.get_results(
batch_id="batch_9f2c8a",
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/context-dot-dev/context-go-sdk"
"github.com/context-dot-dev/context-go-sdk/option"
)
func main() {
client := contextdev.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Batch.GetResults(
context.TODO(),
"batch_9f2c8a",
contextdev.BatchGetResultsParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.batch.get_results("batch_9f2c8a")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ContextDev\Client;
use ContextDev\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');
try {
$response = $client->batch->getResults(
'batch_9f2c8a', cursor: 'cursor', limit: 1
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}context-dev batch get-results \
--api-key 'My API Key' \
--batch-id batch_9f2c8acurl --request GET \
--url https://api.context.dev/v1/batch/{batch_id}/results \
--header 'Authorization: Bearer <token>'HttpResponse<String> response = Unirest.get("https://api.context.dev/v1/batch/{batch_id}/results")
.header("Authorization", "Bearer <token>")
.asString();{
"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>"
}
],
"jsonLd": [
{}
],
"additionalMeta": {}
},
"itemId": "sku-1",
"meta": {},
"markdown": "<string>",
"html": "<string>"
}
],
"has_more": true,
"next_cursor": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"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.
import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.batch.getResults('batch_9f2c8a');
console.log(response.data);import os
from context.dev import ContextDev
client = ContextDev(
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
)
response = client.batch.get_results(
batch_id="batch_9f2c8a",
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/context-dot-dev/context-go-sdk"
"github.com/context-dot-dev/context-go-sdk/option"
)
func main() {
client := contextdev.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Batch.GetResults(
context.TODO(),
"batch_9f2c8a",
contextdev.BatchGetResultsParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.batch.get_results("batch_9f2c8a")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ContextDev\Client;
use ContextDev\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');
try {
$response = $client->batch->getResults(
'batch_9f2c8a', cursor: 'cursor', limit: 1
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}context-dev batch get-results \
--api-key 'My API Key' \
--batch-id batch_9f2c8acurl --request GET \
--url https://api.context.dev/v1/batch/{batch_id}/results \
--header 'Authorization: Bearer <token>'HttpResponse<String> response = Unirest.get("https://api.context.dev/v1/batch/{batch_id}/results")
.header("Authorization", "Bearer <token>")
.asString();{
"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>"
}
],
"jsonLd": [
{}
],
"additionalMeta": {}
},
"itemId": "sku-1",
"meta": {},
"markdown": "<string>",
"html": "<string>"
}
],
"has_more": true,
"next_cursor": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"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.
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.
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.
Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.
Show child attributes
Show child attributes
Was this page helpful?