Skip to main content
POST
/
v1
/
batches-airops
Créer un lot AirOps
curl --request POST \
  --url https://api.olostep.com/v1/batches-airops \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "items": [
    {
      "url": "https://example.com/blog/post-1",
      "custom_id": "post-1"
    },
    {
      "url": "https://example.com/blog/post-2",
      "custom_id": "post-2"
    }
  ],
  "brands": [
    "Acme Corp",
    "TechBrand"
  ],
  "country": "US",
  "webhook": "https://your-server.com/webhook"
}
'
{
  "id": "batch_abc123xyz",
  "object": "batch_airops",
  "created": 1705315200000,
  "total_urls": 2,
  "status": {
    "overall": "in_progress",
    "scraping": {
      "state": "started",
      "submitted": 2,
      "valid": 2,
      "succeeded": 0,
      "failed": 0,
      "started_at": 1705315200000,
      "completed_at": null,
      "error": null
    },
    "analyzing": {
      "state": "pending",
      "items_analyzed": 0,
      "items_needing_enrichment": 0,
      "items_complete": 0,
      "fields_to_enrich": null,
      "started_at": null,
      "completed_at": null
    },
    "enriching": {
      "state": "pending",
      "items_to_enrich": 0,
      "items_enriched": 0,
      "items_failed": 0,
      "llm_batch_id": null,
      "started_at": null,
      "completed_at": null,
      "error": null
    }
  }
}

Overview

Creates a new AirOps batch that:
  1. Scrapes all provided URLs
  2. Extracts structured metadata automatically
  3. Identifies items with missing fields
  4. Enriches incomplete items via LLM
  5. Returns unified results for all URLs

Request Parameters

items
array
required
Array of URLs to process. Each item requires:
  • url - Valid URL to scrape
  • custom_id - Your unique identifier (1-255 chars)
brands
array
default:"[]"
Brand names to look for in page content. The LLM will detect mentions of these specific brands and return matches in the brand_mentions field.
{
  "brands": ["Acme Corp", "TechBrand", "SaaS Pro"]
}
country
string
default:"RANDOM"
Country for geo-targeted scraping. Use ISO 3166-1 alpha-2 codes (US, GB, DE) or RANDOM.
webhook
string
URL to receive webhook notifications. All lifecycle events for this batch will be sent here.
metadata
object
Custom key-value pairs attached to the batch. Stripe-style: max 50 keys, key ≤40 chars, value ≤500 chars.

Response

The response includes the batch ID and initial workflow status:
{
  "id": "batch_abc123xyz",
  "object": "batch_airops",
  "created": 1705315200000,
  "total_urls": 100,
  "status": {
    "scraping": {
      "state": "started",
      "submitted": 100,
      "valid": 100,
      "succeeded": 0,
      "failed": 0,
      "started_at": 1705315200000,
      "completed_at": null,
      "error": null
    },
    "analyzing": {
      "state": "pending",
      "items_analyzed": 0,
      "items_needing_enrichment": 0,
      "items_complete": 0,
      "fields_to_enrich": null,
      "started_at": null,
      "completed_at": null
    },
    "enriching": {
      "state": "pending",
      "items_to_enrich": 0,
      "items_enriched": 0,
      "items_failed": 0,
      "llm_batch_id": null,
      "started_at": null,
      "completed_at": null,
      "error": null
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
items
object[]
required

Tableau d'éléments à traiter.

Required array length: 1 - 10000 elements
brands
string[]

Noms de marques à rechercher dans le contenu de la page. Le LLM extraira les mentions de ces marques de chaque page.

Required string length: 1 - 100
country
string
default:RANDOM

Pays pour le scraping géo-ciblé. Utilisez les codes ISO 3166-1 alpha-2 (US, GB, DE, etc.) ou 'RANDOM' pour une sélection automatique.

webhook
string<uri> | null

URL pour recevoir des notifications webhook pour les événements du cycle de vie du lot.

metadata
object

Paires clé-valeur pour les données personnalisées. Max 50 clés, clé max 40 caractères, valeur max 500 caractères.

Example:
{
"project_id": "12345",
"source": "weekly-crawl"
}

Response

Lot créé avec succès.

id
string

Identifiant unique du lot.

object
enum<string>

Identifiant du type d'objet.

Available options:
batch_airops
created
integer

Horodatage Unix (millisecondes) lorsque le lot a été créé.

total_urls
integer

Nombre total d'URLs dans le lot.

status
object

Objet de statut unifié montrant toutes les phases du flux de travail.