curl --request POST \
--url https://api.olostep.com/v1/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"custom_id": "product-123",
"url": "https://example.com/product/123",
"metadata": {
"source": "catalog_sync",
"priority": "high"
}
},
{
"custom_id": "product-456",
"url": "https://example.com/product/456"
}
],
"country": "US",
"metadata": {
"batch_name": "Q1 Product Sync",
"initiated_by": "automation"
}
}
'import requests
url = "https://api.olostep.com/v1/batches"
payload = {
"items": [
{
"custom_id": "product-123",
"url": "https://example.com/product/123",
"metadata": {
"source": "catalog_sync",
"priority": "high"
}
},
{
"custom_id": "product-456",
"url": "https://example.com/product/456"
}
],
"country": "US",
"metadata": {
"batch_name": "Q1 Product Sync",
"initiated_by": "automation"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
custom_id: 'product-123',
url: 'https://example.com/product/123',
metadata: {source: 'catalog_sync', priority: 'high'}
},
{custom_id: 'product-456', url: 'https://example.com/product/456'}
],
country: 'US',
metadata: {batch_name: 'Q1 Product Sync', initiated_by: 'automation'}
})
};
fetch('https://api.olostep.com/v1/batches', 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.olostep.com/v1/batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'custom_id' => 'product-123',
'url' => 'https://example.com/product/123',
'metadata' => [
'source' => 'catalog_sync',
'priority' => 'high'
]
],
[
'custom_id' => 'product-456',
'url' => 'https://example.com/product/456'
]
],
'country' => 'US',
'metadata' => [
'batch_name' => 'Q1 Product Sync',
'initiated_by' => 'automation'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/batches"
payload := strings.NewReader("{\n \"items\": [\n {\n \"custom_id\": \"product-123\",\n \"url\": \"https://example.com/product/123\",\n \"metadata\": {\n \"source\": \"catalog_sync\",\n \"priority\": \"high\"\n }\n },\n {\n \"custom_id\": \"product-456\",\n \"url\": \"https://example.com/product/456\"\n }\n ],\n \"country\": \"US\",\n \"metadata\": {\n \"batch_name\": \"Q1 Product Sync\",\n \"initiated_by\": \"automation\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.olostep.com/v1/batches")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"custom_id\": \"product-123\",\n \"url\": \"https://example.com/product/123\",\n \"metadata\": {\n \"source\": \"catalog_sync\",\n \"priority\": \"high\"\n }\n },\n {\n \"custom_id\": \"product-456\",\n \"url\": \"https://example.com/product/456\"\n }\n ],\n \"country\": \"US\",\n \"metadata\": {\n \"batch_name\": \"Q1 Product Sync\",\n \"initiated_by\": \"automation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"custom_id\": \"product-123\",\n \"url\": \"https://example.com/product/123\",\n \"metadata\": {\n \"source\": \"catalog_sync\",\n \"priority\": \"high\"\n }\n },\n {\n \"custom_id\": \"product-456\",\n \"url\": \"https://example.com/product/456\"\n }\n ],\n \"country\": \"US\",\n \"metadata\": {\n \"batch_name\": \"Q1 Product Sync\",\n \"initiated_by\": \"automation\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "batch_abc123def456",
"object": "batch",
"status": "in_progress",
"created": 1704067200,
"total_urls": 2,
"completed_urls": 0,
"country": "US",
"metadata": {
"batch_name": "Q1 Product Sync",
"initiated_by": "automation"
}
}{
"id": "error_abc123",
"object": "error",
"code": "validation_error",
"type": "https://docs.olostep.com/api-reference/errors/bad_request",
"status": 400,
"title": "Slecht Verzoek",
"detail": "The 'items' array is required and must contain at least one item.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "invalid_api_key",
"type": "https://docs.olostep.com/api-reference/errors/unauthorized",
"status": 401,
"title": "Niet geautoriseerd",
"detail": "Your API key is invalid. Try double-checking it or reaching out to info@olostep.com if you're facing issues.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "credits_exhausted",
"type": "https://docs.olostep.com/api-reference/errors/payment_required",
"status": 402,
"title": "Betaling Vereist",
"detail": "You have consumed all available credits. Please upgrade your plan from the dashboard: https://www.olostep.com/auth/",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "access_denied",
"type": "https://docs.olostep.com/api-reference/errors/forbidden",
"status": 403,
"title": "Verboden",
"detail": "You don't have access to this feature. Please reach out to info@olostep.com to get approved",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "idempotency_key_in_progress",
"type": "https://docs.olostep.com/api-reference/errors/idempotency_error",
"status": 409,
"title": "Idempotentie Fout",
"detail": "A request with this idempotency key is currently being processed. Please wait and retry.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "idempotency_key_reuse",
"type": "https://docs.olostep.com/api-reference/errors/unprocessable_entity",
"status": 422,
"title": "Niet-verwerkbare Entiteit",
"detail": "A request with this idempotency key was already made with different parameters. Idempotency keys must be unique per request.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "internal_server_error",
"type": "https://docs.olostep.com/api-reference/errors/internal_error",
"status": 500,
"title": "Interne Serverfout",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}Batch aanmaken
Start een nieuwe batch. Je ontvangt een id die je kunt gebruiken om de voortgang van de batch bij te houden zoals getoond hier. Opmerking: De verwerkingstijd is constant ongeacht de batchgrootte
curl --request POST \
--url https://api.olostep.com/v1/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"custom_id": "product-123",
"url": "https://example.com/product/123",
"metadata": {
"source": "catalog_sync",
"priority": "high"
}
},
{
"custom_id": "product-456",
"url": "https://example.com/product/456"
}
],
"country": "US",
"metadata": {
"batch_name": "Q1 Product Sync",
"initiated_by": "automation"
}
}
'import requests
url = "https://api.olostep.com/v1/batches"
payload = {
"items": [
{
"custom_id": "product-123",
"url": "https://example.com/product/123",
"metadata": {
"source": "catalog_sync",
"priority": "high"
}
},
{
"custom_id": "product-456",
"url": "https://example.com/product/456"
}
],
"country": "US",
"metadata": {
"batch_name": "Q1 Product Sync",
"initiated_by": "automation"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
custom_id: 'product-123',
url: 'https://example.com/product/123',
metadata: {source: 'catalog_sync', priority: 'high'}
},
{custom_id: 'product-456', url: 'https://example.com/product/456'}
],
country: 'US',
metadata: {batch_name: 'Q1 Product Sync', initiated_by: 'automation'}
})
};
fetch('https://api.olostep.com/v1/batches', 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.olostep.com/v1/batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'custom_id' => 'product-123',
'url' => 'https://example.com/product/123',
'metadata' => [
'source' => 'catalog_sync',
'priority' => 'high'
]
],
[
'custom_id' => 'product-456',
'url' => 'https://example.com/product/456'
]
],
'country' => 'US',
'metadata' => [
'batch_name' => 'Q1 Product Sync',
'initiated_by' => 'automation'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/batches"
payload := strings.NewReader("{\n \"items\": [\n {\n \"custom_id\": \"product-123\",\n \"url\": \"https://example.com/product/123\",\n \"metadata\": {\n \"source\": \"catalog_sync\",\n \"priority\": \"high\"\n }\n },\n {\n \"custom_id\": \"product-456\",\n \"url\": \"https://example.com/product/456\"\n }\n ],\n \"country\": \"US\",\n \"metadata\": {\n \"batch_name\": \"Q1 Product Sync\",\n \"initiated_by\": \"automation\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.olostep.com/v1/batches")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"custom_id\": \"product-123\",\n \"url\": \"https://example.com/product/123\",\n \"metadata\": {\n \"source\": \"catalog_sync\",\n \"priority\": \"high\"\n }\n },\n {\n \"custom_id\": \"product-456\",\n \"url\": \"https://example.com/product/456\"\n }\n ],\n \"country\": \"US\",\n \"metadata\": {\n \"batch_name\": \"Q1 Product Sync\",\n \"initiated_by\": \"automation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"custom_id\": \"product-123\",\n \"url\": \"https://example.com/product/123\",\n \"metadata\": {\n \"source\": \"catalog_sync\",\n \"priority\": \"high\"\n }\n },\n {\n \"custom_id\": \"product-456\",\n \"url\": \"https://example.com/product/456\"\n }\n ],\n \"country\": \"US\",\n \"metadata\": {\n \"batch_name\": \"Q1 Product Sync\",\n \"initiated_by\": \"automation\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "batch_abc123def456",
"object": "batch",
"status": "in_progress",
"created": 1704067200,
"total_urls": 2,
"completed_urls": 0,
"country": "US",
"metadata": {
"batch_name": "Q1 Product Sync",
"initiated_by": "automation"
}
}{
"id": "error_abc123",
"object": "error",
"code": "validation_error",
"type": "https://docs.olostep.com/api-reference/errors/bad_request",
"status": 400,
"title": "Slecht Verzoek",
"detail": "The 'items' array is required and must contain at least one item.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "invalid_api_key",
"type": "https://docs.olostep.com/api-reference/errors/unauthorized",
"status": 401,
"title": "Niet geautoriseerd",
"detail": "Your API key is invalid. Try double-checking it or reaching out to info@olostep.com if you're facing issues.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "credits_exhausted",
"type": "https://docs.olostep.com/api-reference/errors/payment_required",
"status": 402,
"title": "Betaling Vereist",
"detail": "You have consumed all available credits. Please upgrade your plan from the dashboard: https://www.olostep.com/auth/",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "access_denied",
"type": "https://docs.olostep.com/api-reference/errors/forbidden",
"status": 403,
"title": "Verboden",
"detail": "You don't have access to this feature. Please reach out to info@olostep.com to get approved",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "idempotency_key_in_progress",
"type": "https://docs.olostep.com/api-reference/errors/idempotency_error",
"status": 409,
"title": "Idempotentie Fout",
"detail": "A request with this idempotency key is currently being processed. Please wait and retry.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "idempotency_key_reuse",
"type": "https://docs.olostep.com/api-reference/errors/unprocessable_entity",
"status": 422,
"title": "Niet-verwerkbare Entiteit",
"detail": "A request with this idempotency key was already made with different parameters. Idempotency keys must be unique per request.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "internal_server_error",
"type": "https://docs.olostep.com/api-reference/errors/internal_error",
"status": 500,
"title": "Interne Serverfout",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}webhook-parameter door met de URL van je endpoint om een HTTP POST te ontvangen wanneer de batch is voltooid. Zie Webhooks voor details.metadata-parameter om sleutel-waardeparen op te slaan. Ondersteund op twee niveaus:- Batch-niveau — in de request body
- Item-niveau — op elk item in de
itemsarray
Autorisaties
Bearer authenticatie header in de vorm Bearer , waar jouw auth token is.
Body
Array van items die in de batch verwerkt moeten worden.
Show child attributes
Show child attributes
Land voor de batchuitvoering. Geef op in ISO 3166-1 alpha-2 codes zoals US(USA), IN(India), enz.
Je kunt deze parameter gebruiken om de parser te specificeren die je wilt gebruiken. Parsers zijn handig om gestructureerde inhoud uit webpagina's te halen. Olostep heeft een paar ingebouwde parsers voor de meest voorkomende webpagina's, en je kunt ook je eigen parsers maken.
Show child attributes
Show child attributes
Haal alle links op die aanwezig zijn op elke pagina in de batch. Links worden altijd geretourneerd als absolute URLs.
Show child attributes
Show child attributes
Set van sleutel-waarde paren voor het opslaan van aanvullende informatie over een object. Volgt Stripe's aanpak met validatieregels: max 50 sleutels, sleutel max 40 tekens (geen vierkante haken), waarde max 500 tekens, alle waarden opgeslagen als strings.
Show child attributes
Show child attributes
{
"order_id": "12345",
"customer_name": "John Doe",
"priority": "high",
"processed": "true"
}
Respons
Batch succesvol gestart.
Batch ID
Het soort object. "batch" voor dit endpoint.
in_progress of completed
Aangemaakte epoch
Aantal URLs in de batch
Aantal voltooide URLs
Set van sleutel-waarde paren voor het opslaan van aanvullende informatie over een object. Volgt Stripe's aanpak met validatieregels: max 50 sleutels, sleutel max 40 tekens (geen vierkante haken), waarde max 500 tekens, alle waarden opgeslagen als strings.
Show child attributes
Show child attributes
{
"order_id": "12345",
"customer_name": "John Doe",
"priority": "high",
"processed": "true"
}
Webhook URL om een voltooiingsmelding te ontvangen
Aantal credits verbruikt door dit verzoek. Wordt ingevuld nadat de uitvoering voltooid is. Credits zijn de bron van waarheid voor facturering.
Geschatte kosten in USD voor dit verzoek. Wordt ingevuld nadat de uitvoering voltooid is. Berekend op basis van verbruikte credits en je abonnementsprijs — 99% nauwkeurig, maar credits_consumed is de gezaghebbende waarde.
Was deze pagina nuttig?