AlterLab
SearchResearchPricingComparePlaygroundBlogDocsChangelog
    AlterLabAlterLab
    PricingComparePlaygroundBlogDocsChangelog
    IntroductionQuickstartInstallationYour First Request
    REST APICrawl APIMap APISearch APIResearch APINewSERP APINewExtract APIAIJob PollingDomain StatsNewGeocode APINewNews APIBatch ResultsNewAPI KeysSessions APINewEnterprise APIEnterprise
    AccountAutoAI VisibilityAutoAlertsAutoAuthAutoBillingAutoCrawlAutoExtractAutoIntegrationsAutoKeysAutoMapAutoMonitorsAutoOrganizationsAutoResearch SchedulesAutoRunsAutoSchedulesAutoScrapeAutoSearchAutoSearch SchedulesAutoSessionsAutoUser WebhooksAutoV1 EndpointsAutoAffiliatesAutoAgentAutoAgent OnboardingAutoAgent VisibilityAutoAnalyticsAutoApprovalsAutoArtifactsAutoAttributionAutoB2BAutoBatchAutoBeta FeaturesAutoBlogAutoBuyerAutoChatAutoConnectionsAutoConnectorsAutoContact ListsAutoCreatorAutoCross SellAutoDashboardAutoDefaultsAutoDomainsAutoEmail PreferencesAutoFcAutoHandsAutoHealthAutoJobsAutoListingsAutoMaintenanceAutoNewsAutoOauthAutoOauth GrantsAutoPage InspectAutoPlatformAutoPresetsAutoPricingAutoPrivacyAutoPublicAutoPublic PagesAutoReferralAutoReferralsAutoReportsAutoResearchAutoSecretsAutoSerpAutoSSOAutoStorefrontsAutoSupportAutoTemplatesAutoToolsAutoTrackAutoUsageAutoUsage TagsAutoUserAutoWorkflowsAutoWorkspacesAutoWebhooksAuto
    OverviewPythonNode.jsCLI
    Guides OverviewJavaScript RenderingBrowser ActionsOutput FormatsPDF & OCRCachingWebhooksJSON Schema FilteringWebSocket Real-TimeBring Your Own ProxyProSticky SessionsProAuthenticated ScrapingNewHTTP Methods & BodiesNewStructured ExtractionAIWeb SearchAgent and RAG GroundingResearch JobsAgent RunsSite MappingWeb CrawlingBatch ScrapingSchedulerData MarketplaceSelling DataAgent OnboardingEmbeddingsKeyword IdeasAI VisibilityWorkflowsChange DetectionCloud Storage ExportSpend LimitsOrganizations & TeamsScrape TemplatesCustom ConnectorsSecretsContact ListsPlatform Sub-AccountsReferrals & AffiliatesAlerts & NotificationsExtraction ProfilesAIBYOK ExtractionAIOAuth2 Machine-to-MachineSupport & TicketsUnsupported Targets
    Tutorials OverviewStructured ExtractionAIE-commerce ScrapingNews MonitoringPrice MonitoringMulti-Page CrawlingMonitoring DashboardAI Agent / MCPMCPAI Research AgentAISite CrawlingData Pipeline to Cloud
    E-commerceLead GenerationChange MonitoringRAG & AI PipelinesAIResearch
    Reference OverviewPricingRate LimitsReliabilityReliability ContractError CodesChangelogVersioning
    Migrations OverviewFrom FirecrawlFrom ApifyFrom ScrapingBee / ScraperAPIFrom Crawl4AIFrom SpiderSearch to SERPFirecrawl v0 API ReferenceLegacy
    OverviewMCP ServerAIn8n NodeLangChainAICrewAIAILlamaIndexAISupabaseChrome ExtensionSoon
    PlaygroundPricingStatus

    Up to 5,000 free requests · No credit card

    Guide

    Batch Scraping

    Submit up to 100 URLs in a single API call. Jobs are processed in parallel and you can poll for results or receive a webhook when the batch completes.

    Track your batch scrape jobs and view results directly from the dashboard.

    Async by Design

    Batch requests return immediately with a batch_id. Use it to poll status or configure a webhook for delivery.

    How It Works

    1

    Submit

    POST an array of URLs to /api/v1/batch. Cost is pre-debited for the estimated total cost.

    2

    Process

    Each URL becomes an individual job processed in parallel. The same tier escalation and anti-bot logic applies to every job.

    3

    Collect

    Poll GET /api/v1/batch/{batch_id} for individual results, or receive a batch.completed webhook when all jobs finish.

    Submit a Batch

    POST
    /api/v1/batch

    Submit a batch of URLs for asynchronous processing with optional webhook delivery. Returns 202 Accepted.

    Bash
    curl -X POST https://api.alterlab.io/api/v1/batch \
      -H "X-API-Key: your_api_key" \
      -H "Content-Type: application/json" \
      -d '{
        "urls": [
          { "url": "https://example.com/page-1" },
          { "url": "https://example.com/page-2", "mode": "js" },
          {
            "url": "https://example.com/page-3",
            "formats": ["text", "markdown"],
            "cost_controls": { "max_tier": "3" }
          }
        ],
        "webhook_url": "https://your-server.com/webhook"
      }'

    Request Body

    ParameterTypeRequiredDescription
    urlsarrayYesArray of URL objects (1–100 items)
    webhook_urlstringNoURL to receive a batch.completed event when all jobs finish

    Per-URL Options

    Each item in the urls array accepts the same parameters as a single scrape request:

    FieldDefaultDescription
    url—Target URL (required)
    mode"auto"auto, html, js, pdf, ocr
    formats["html", "json"]Output formats: text, json, html, markdown
    cost_controlsnullforce_tier, max_tier, prefer_cost, prefer_speed, fail_fast
    extraction_schemanullJSON schema for structured extraction
    extraction_promptnullNatural language extraction instructions (max 2,000 chars)
    extraction_profile"auto"Pre-defined profile: auto, product, article, job_posting, faq, recipe, event
    advancednullAdvancedOptions object (render_js, screenshot, ocr, etc.)
    include_raw_htmlfalseInclude raw HTML in the response
    cachefalseEnable caching for this URL
    timeout90Per-URL timeout in seconds (1–300)
    wait_fornullCSS selector to wait for before extracting

    Response (202 Accepted):

    JSON
    {
      "batch_id": "batch_7a3b9c8d-4e2f-1a6b-8c5d-9e0f1a2b3c4d",
      "total_urls": 3,
      "status": "processing",
      "estimated_credits": 45000,
      "job_ids": [
        "a1b2c3d4-...",
        "e5f6g7h8-...",
        "i9j0k1l2-..."
      ],
      "jobs": [
        { "index": 0, "url": "https://example.com/page1", "status": "accepted", "job_id": "a1b2c3d4-...", "rejected": null },
        { "index": 1, "url": "https://example.com/page2", "status": "accepted", "job_id": "e5f6g7h8-...", "rejected": null },
        { "index": 2, "url": "https://example.com/page3", "status": "accepted", "job_id": "i9j0k1l2-...", "rejected": null }
      ]
    }

    jobs has one entry per submitted URL, in the order you sent them. Pair job IDs with URLs through jobs. job_ids lists the accepted subset only and is not positional: it is shorter than your submission when any URL is rejected.

    Partial acceptance: when a batch goes over your concurrency limit, the URLs that fit are accepted and the rest come back with status: "rejected" and a rejected object holding scope, reason and retry_after_seconds. Rejected URLs are not charged. If every URL is rejected, the response is a terminal 200 with no batch_id to poll. rejected_items carries the same detail as before. Wait for retry_after_seconds, then resubmit only the rejected URLs; the Node and Python SDKs provide resubmitRejected and resubmit_rejected for this.

    URLs over your concurrency limit are queued by default. They appear in jobs with status: "queued", are charged up front, and start as your running jobs finish. A URL still queued after 15 minutes fails with queue_expired, is refunded, and carries retry_after_seconds. Set queue_over_limit: false to reject those URLs in rejected_items instead. URLs over the sustained rate limit (global_rate) are always rejected.

    Poll Batch Status

    GET
    /api/v1/batch/{batch_id}

    Returns the aggregate status and individual job results for a batch.

    Bash
    curl https://api.alterlab.io/api/v1/batch/batch_7a3b9c8d-... \
      -H "X-API-Key: your_api_key"

    Status Response

    JSON
    {
      "batch_id": "batch_7a3b9c8d-...",
      "status": "completed",
      "total": 3,
      "completed": 2,
      "failed": 1,
      "pending": 0,
      "items": [
        {
          "job_id": "a1b2c3d4-...",
          "url": "https://example.com/page-1",
          "status": "succeeded",
          "result": { "text": "...", "metadata": { ... } }
        },
        {
          "job_id": "e5f6g7h8-...",
          "url": "https://example.com/page-2",
          "status": "succeeded",
          "result": { "text": "...", "metadata": { ... } }
        },
        {
          "job_id": "i9j0k1l2-...",
          "url": "https://example.com/page-3",
          "status": "failed",
          "error": "BLOCKED_BY_ANTIBOT"
        }
      ],
      "created_at": "2026-03-03T12:00:00Z"
    }

    Batch status values:

    StatusMeaning
    processingSome jobs are still running
    completedAll jobs succeeded
    partialAll jobs done, some failed
    failedAll jobs failed

    Webhook Delivery

    If you provide a webhook_url, AlterLab sends a batch.completed POST when every job in the batch finishes (succeeded or failed).

    JSON
    {
      "event": "batch.completed",
      "timestamp": "2026-03-03T12:01:00Z",
      "data": {
        "batch_id": "batch_7a3b9c8d-...",
        "status": "partial",
        "total": 3,
        "completed": 2,
        "failed": 1
      }
    }

    Webhook is fire-once

    The webhook fires exactly once per batch, the first time all jobs are done. Subsequent polls will not re-trigger it.

    Billing & Cost

    • Cost is pre-debited when the batch is submitted, based on estimated per-URL cost.
    • If a job fails, the worker automatically refunds the cost for that URL.
    • BYOP (Bring Your Own Proxy) discounts apply per-URL if you have an active proxy integration.
    • Check estimated_credits in the submit response to see the total debited.

    Limits

    Batch Limits

    • Maximum 100 URLs per batch request
    • Each URL counts as a separate scrape credit-wise
    • Batch jobs are processed in parallel (no guaranteed order)
    • Batch metadata expires after 2 hours — poll or use webhooks before then

    Python Example

    Python
    import alterlab
    import time
    
    client = alterlab.AlterLab(api_key="your_api_key")
    
    # Submit batch
    batch = client.batch_scrape(
        urls=[
            {"url": "https://example.com/page-1"},
            {"url": "https://example.com/page-2", "mode": "js"},
            {"url": "https://example.com/page-3", "formats": ["markdown"]},
        ],
        webhook_url="https://your-server.com/webhook",
    )
    
    print(f"Batch ID: {batch['batch_id']}")
    print(f"Estimated credits: {batch['estimated_credits']}")
    
    # Poll until complete
    while True:
        status = client.get_batch_status(batch["batch_id"])
        print(f"Status: {status['status']} — {status['completed']}/{status['total']} done")
        if status["status"] != "processing":
            break
        time.sleep(2)
    
    # Process results
    for item in status["items"]:
        if item["status"] == "succeeded":
            print(f"✓ {item['url']}: {len(item['result'].get('text', ''))} chars")
        else:
            print(f"✗ {item['url']}: {item.get('error', 'unknown')}")

    Node.js Example

    TYPESCRIPT
    import AlterLab from "alterlab";
    
    const client = new AlterLab({ apiKey: "your_api_key" });
    
    // Submit batch
    const batch = await client.batchScrape({
      urls: [
        { url: "https://example.com/page-1" },
        { url: "https://example.com/page-2", mode: "js" },
        { url: "https://example.com/page-3", formats: ["markdown"] },
      ],
      webhookUrl: "https://your-server.com/webhook",
    });
    
    console.log(`Batch ID: ${batch.batchId}`);
    
    // Poll until complete
    let status;
    do {
      await new Promise((r) => setTimeout(r, 2000));
      status = await client.getBatchStatus(batch.batchId);
      console.log(`${status.completed}/${status.total} done`);
    } while (status.status === "processing");
    
    // Process results
    for (const item of status.items) {
      if (item.status === "succeeded") {
        console.log(`✓ ${item.url}`);
      } else {
        console.log(`✗ ${item.url}: ${item.error}`);
      }
    }

    All request parameters (POST /api/v1/batch)

    NameTypeDefaultDescription
    tagstringOptional spend-attribution tag (^[a-z0-9][a-z0-9_.-]{0,63}$, max 20 active tags per organization).
    urlsobject[]List of URLs to scrape (max 100)
    session_idstringBYOS session ID to apply to all URLs in the batch.
    dry_runbooleanfalseReturn a free cost estimate (per-item predicted tier and cost, totals, predicted time, remaining-budget check) without dispatching, debiting or reserving anything.
    approval_idstringApproval for work above the key's `approval_above_usd` threshold.
    max_in_flight_per_domainintegerOptional cap on this batch's concurrent jobs per registrable domain.
    queue_over_limitbooleantrueWhen true and the over-limit queue is enabled for your account, items over your global or per-domain concurrency limit are queued (job status `queued`) and start as slots free, for up to 15 minutes.
    webhook_urlstringWebhook URL to receive batch.completed event when all jobs finish
    exportobjectCloud storage export config — results uploaded on batch completion
    extraction_selectorsobjectDeterministic field extraction: {field: {css|xpath, attr?, multiple?}} evaluated on the fetched HTML.
    extraction_schemaobjectJSON Schema applied to all URLs that do not supply their own extraction_schema.
    extraction_promptstringNatural language extraction instruction applied to all URLs that do not supply their own extraction_prompt.
    extraction_provider"openai" | "anthropic" | "openrouter" | "groq"LLM provider to use for extraction.
    extraction_profile"auto" | "product" | "article" | "job_posting" | "faq" | "recipe" | "event"Pre-defined extraction profile applied to all URLs that do not supply their own extraction_profile.
    Web CrawlingScheduler
    Last updated: June 2026

    On this page