Skip to content

    AI answer collection and runs

    Estimate a batch of checks

    Quotes up to 20 managed checks in one request.

    POST /v2/runs

    • Body workflow is managed_batch.
    • Body estimate is true. Default is false.

    Authentication and access

    Authentication
    Bearer API key
    Scopes
    collections:write
    Roles
    editor, owner, service
    Plans
    Optimizer, Analyzer
    Credits
    The estimate uses zero credits.

    Parameters

    Request parameters
    NameWhereTypeRequiredDescription
    Idempotency-KeyheaderstringYes

    Request body

    {
      "estimate": true,
      "items": [
        {
          "idempotency_key": "example-estimate-0001",
          "request": {
            "brand_id": "00000000-0000-4000-8000-000000000001",
            "market": {
              "country": "US",
              "language": "en"
            }
          }
        }
      ],
      "workflow": "managed_batch"
    }
    Request body fields 1
    NameTypeRequiredDescription
    estimatetrueYes
    itemsarray of objectYes
    items[].idempotency_keystringYes
    items[].requestobjectYes
    items[].request.allow_country_levelbooleanNoAllow a country-level answer when the source cannot apply the requested location.
    items[].request.answer_mode"standard" | "new"NoUse standard for the normal answer or new to request a new answer.
    items[].request.brand_idstring (uuid)Yes
    items[].request.marketobjectYes``components.schemas.Market``.
    items[].request.market.citystring | nullNo
    items[].request.market.countrystringYes
    items[].request.market.languagestringYes
    items[].request.market.latitudenumber | nullNo
    items[].request.market.location_idstring (uuid) | nullNo
    items[].request.market.longitudenumber | nullNo
    items[].request.market.postal_codestring | nullNo
    items[].request.market.regionstring | nullNo
    items[].request.sourcesarray of object | nullNo
    items[].request.sources.device"desktop" | "mobile" | "unknown" | nullNo
    items[].request.sources.mode"ui_normal" | "ui_search" | "api_normal" | "api_web" | "ai_mode" | "ai_overview" | "organic_search"ConditionalThe mode used to collect the answer. The unverified value appears only in evidence.
    items[].request.sources.platform"chatgpt" | "gemini" | "claude" | "perplexity" | "google" | "bing" | "brave" | "meta_ai" | "grok" | "universal"ConditionalThe platform where the answer was observed.
    items[].request.sources.providerstring | nullNo
    items[].request.websitestring | nullNo
    workflow"managed_batch"Yes

    Request examples

    Set AEO_API_BASE_URL to https://api.aeoapi.dev and AEO_API_KEY to your server-side API key. Set the other environment variables to the values for your request.

    Save the JSON request body as request.json. Replace sample IDs, revisions and other values with your own.

    curl --fail-with-body -X POST "$AEO_API_BASE_URL/v2/runs" \
      -H "Authorization: Bearer $AEO_API_KEY" \
      -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
      -H "Content-Type: application/json" \
      --data-binary @request.json
    import json
    from pathlib import Path
    from os import environ
    from aeo_sdk import AeoClient
    
    body = json.loads(Path("request.json").read_text())
    
    with AeoClient(environ["AEO_API_KEY"], base_url=environ["AEO_API_BASE_URL"]) as client:
        response = client.v2_post_runs(
            body=body,
            idempotency_key=environ["IDEMPOTENCY_KEY"],
        )
        print(response.body)
    import { AeoClient } from "@aeoapi/aeo-sdk";
    import { readFile } from "node:fs/promises";
    
    const client = new AeoClient(process.env.AEO_API_KEY!, {
      baseUrl: process.env.AEO_API_BASE_URL!,
    });
    const body = JSON.parse(await readFile("request.json", "utf8"));
    const response = await client.v2PostRuns(
      body,
      {
        idempotencyKey: process.env.IDEMPOTENCY_KEY!,
      },
    );
    console.log(response.body);

    Responses

    HTTP 200

    Successful Response

    application/json

    Response fields are listed below.

    HTTP 200 response fields 1
    NameTypeRequiredDescription
    dataarray of object | objectYesThe requested result. See the fields below for its contents.
    data[].brand_idstring (uuid)Yes
    data[].dataobjectConditional
    data[].data.brand_idstringConditional
    data[].data.eligible_enginesarray of objectConditional
    data[].data.eligible_engines[].applied_locationobject | nullNo
    data[].data.eligible_engines[].applied_location.citystring | nullNo
    data[].data.eligible_engines[].applied_location.countrystring | nullNo
    data[].data.eligible_engines[].applied_location.granularity"country" | "region" | "city" | "postal" | "coordinates"Conditional
    data[].data.eligible_engines[].applied_location.latitudenumber | nullNo
    data[].data.eligible_engines[].applied_location.longitudenumber | nullNo
    data[].data.eligible_engines[].applied_location.postal_codestring | nullNo
    data[].data.eligible_engines[].applied_location.regionstring | nullNo
    data[].data.eligible_engines[].charge_per_stepintegerConditional
    data[].data.eligible_engines[].reserve_per_stepintegerConditional
    data[].data.eligible_engines[].sourceobjectConditional
    data[].data.eligible_engines[].unenforced_controlsarray of stringConditional
    data[].data.estimate_fingerprintstringConditional
    data[].data.estimated_creditsintegerConditional
    data[].data.excluded_sourcesarray of objectConditionalSources omitted from the estimate. Location estimates include the affected location_id with each exclusion. Location exclusions have reason location_not_supported. Sources outside your plan have reason feature_not_offered.
    data[].data.excluded_sources[].location_idstring (uuid)No
    data[].data.expires_atstringConditional
    data[].data.location_totalsarray of objectNo
    data[].data.location_totals[].eligible_enginesarray of objectNo
    data[].data.location_totals[].eligible_engines[].sourceobjectConditional
    data[].data.location_totals[].eligible_engines[].unenforced_controlsarray of stringConditional
    data[].data.location_totals[].estimated_creditsintegerConditional
    data[].data.location_totals[].location_idstring (uuid)Conditional
    data[].data.location_totals[].marketobjectConditional
    data[].data.location_totals[].market.citystring | null | nullNo
    data[].data.location_totals[].market.countrystringConditional
    data[].data.location_totals[].market.languagestringConditional
    data[].data.location_totals[].market.latitudenumber | nullNo
    data[].data.location_totals[].market.location_idstring (uuid)No
    data[].data.location_totals[].market.longitudenumber | nullNo
    data[].data.location_totals[].market.postal_codestring | nullNo
    data[].data.location_totals[].market.regionstring | null | nullNo
    data[].data.location_totals[].maximum_creditsintegerConditional
    data[].data.location_totals[].prompt_countintegerConditional
    data[].data.maximum_creditsintegerConditional
    data[].data.poll_urlstringConditional
    data[].data.prompt_countintegerConditional
    data[].data.prompt_set_revisionstringConditional
    data[].data.run_idstring | nullNo
    data[].data.websitestring | nullConditional
    data[].idempotency_keystringYes
    data[].status200 | integerYes
    data[].errorobjectConditional
    data[].error.codestringConditional
    data[].error.field_errorsarray of objectNo
    data[].error.field_errors[].fieldstring | nullConditional
    data[].error.field_errors[].messagestringConditional
    data[].error.messagestringConditional
    metaobjectYesInformation about this response, including any warnings or pagination details.
    meta.as_ofstring (date-time)YesThe point in time that the response represents.
    meta.cohort_versionstring | nullNoIdentifies the version of the group used to calculate the results.
    meta.collected_atstring (date-time) | nullYesWhen the data was collected, if available.
    meta.metric_versionstring | nullNoThe version of the metric definition used for these results.
    meta.next_cursorstring | nullYesWhen present, pass this value as cursor to request the next page with the same filters.
    meta.next_refresh_atstring (date-time) | nullYes
    meta.request_idstring (uuid)YesKeep this ID when reporting a problem with the request.
    meta.restricted_fieldsarray of stringNoFields that your current access does not allow the API to return.
    meta.rights_filteredbooleanYesIndicates whether access rights affected the returned data.
    meta.schema_version"1.0"YesThe version of the response format.
    meta.stalebooleanYes
    meta.warningsarray of stringYesRead these notes for limitations that affect the results.

    Errors

    Read code and message in the error response. Keep request_id when you contact support.

    AI answer collection and runs reference