Skip to content

    Retrieval simulator and content testing

    Search passages

    Searches the brand's imported page text, or supplied asset text, and returns matching passages with the page URL and text offsets.

    POST /v2/passages/search

    Authentication and access

    Authentication
    Bearer API key
    Scopes
    analytics:read
    Roles
    approver, editor, owner, publisher, service, viewer
    Plans
    Optimizer, Analyzer
    Credits
    No credit charge.

    Parameters

    The contract lists no fields for this section.

    Request body

    {
      "brand_id": "00000000-0000-4000-8000-000000000001",
      "query": "product documentation"
    }
    Request body fields 1
    NameTypeRequiredDescription
    brand_idstring (uuid)Yes
    limitintegerNo
    querystringNo
    Request body fields 2
    NameTypeRequiredDescription
    asset_filterobjectYesSearch supplied asset text only.
    asset_filter.asset_type"pdf" | "chart" | "table" | "transcript" | "diagram" | nullNo
    asset_filter.content_idsarray of string (uuid) | nullNo
    asset_filter.revision_idsarray of string (uuid) | nullNo
    brand_idstring (uuid)Yes
    limitintegerNo
    querystringYes

    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/passages/search" \
      -H "Authorization: Bearer $AEO_API_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_passages_search(
            body=body,
        )
        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.v2PostPassagesSearch(
      body,
    );
    console.log(response.body);

    Responses

    HTTP 200

    Successful Response

    application/json

    Example generated from the response schema.

    {
      "data": [],
      "meta": {}
    }
    HTTP 200 response fields 1
    NameTypeRequiredDescription
    dataarray of objectYesThe requested result. See the fields below for its contents.
    data[].content_idstringYes
    data[].end_offsetintegerYes
    data[].meaning_rankinteger | nullYes
    data[].ordinalintegerYes
    data[].passage_idstringYes
    data[].revisionstringYes
    data[].rights_expire_atstringYes
    data[].scorenumberYes
    data[].start_offsetintegerYes
    data[].term_rankinteger | nullYes
    data[].textstringYes
    data[].urlstringYes
    metaobjectYesInformation about this response, including any warnings or pagination details.
    HTTP 200 response fields 2
    NameTypeRequiredDescription
    dataarray of objectYesThe requested result. See the fields below for its contents.
    data[].content_idstring (uuid)Yes
    data[].end_offsetintegerYes
    data[].locatorobject | object | object | object | objectYes
    data[].locator.pageintegerConditional
    data[].locator.type"pdf" | "transcript" | "chart" | "table" | "diagram"Yes
    data[].locator.end_msintegerConditional
    data[].locator.start_msintegerConditional
    data[].locator.seriesstringConditional
    data[].locator.xobjectConditional
    data[].locator.x.labelstringConditional
    data[].locator.x.unitstring | nullConditional
    data[].locator.x.valuestringConditional
    data[].locator.yobjectConditional
    data[].locator.y.labelstringConditional
    data[].locator.y.unitstringConditional
    data[].locator.y.valuestringConditional
    data[].locator.rowintegerConditional
    data[].locator.labelstringConditional
    data[].meaning_rankinteger | nullYes
    data[].ordinalintegerYes
    data[].passage_idstring (uuid)Yes
    data[].revisionstring (uuid)Yes
    data[].rights_expire_atstring (date-time)Yes
    data[].scorenumberYes
    data[].sha256stringYes
    data[].start_offsetintegerYes
    data[].term_rankinteger | nullYes
    data[].textstringYes
    data[].urlstringYes
    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.

    Retrieval simulator and content testing reference