Skip to main content
Glama

openapi_v2_keyword_search_results

Get keyword search results

  1. Function

Return factual product listings and absolute ranking positions for a keyword in the weekly period, with optional placement filtering. SERP aggregates and keyword market metrics are intentionally excluded and provided by dedicated metric endpoints.

  1. Use cases

Inspect which products, brands and placements appear for a keyword, and compare their ranking positions. Use market-profile for market-level assessments.

Responses:

200: Successful Response (Success Response) Content-Type: application/json

Example Response:

{
  "success": true,
  "meta": {
    "requestId": "Requestid",
    "timestamp": "Timestamp"
  }
}

Output Schema:

{
  "properties": {
    "success": {
      "type": "boolean",
      "title": "Success",
      "description": "Whether the request was successful",
      "default": true
    },
    "data": {
      "description": "Response data payload"
    },
    "error": {
      "description": "Error details if request failed"
    },
    "meta": {
      "description": "Metadata for API responses.\n\nCredit fields follow the ADR-0003 parallel-fields strategy (Option 3):\n- `credits_remaining` / `credits_consumed` (int): legacy fields, rounded\n  to whole credits, kept for zero-breaking-change to existing SDK clients.\n- `credits_remaining_exact` / `credits_consumed_exact` (float): new\n  precision-aware fields for clients that opt in to decimal credits.\n\nSee ADR-0003 decision 5 and the \u00a78 deprecation timeline.\n\nTODO(2026-11, ADR-0003 \u00a78 +6mo): mark `credits_remaining` /\n`credits_consumed` as `deprecated=True` in their Field() definitions\nand announce in customer changelog.\nTODO(2027-05, ADR-0003 \u00a78 +12mo): remove the legacy int fields via a\nmajor-version bump of the OpenAPI surface.",
      "properties": {
        "requestId": {
          "type": "string",
          "title": "Requestid",
          "description": "Unique request identifier"
        },
        "timestamp": {
          "type": "string",
          "title": "Timestamp",
          "description": "Response timestamp in ISO 8601 format"
        },
        "total": {
          "title": "Total",
          "description": "Total number of records"
        },
        "page": {
          "title": "Page",
          "description": "Current page number"
        },
        "pageSize": {
          "title": "Pagesize",
          "description": "Number of records per page"
        },
        "totalPages": {
          "title": "Totalpages",
          "description": "Total number of pages"
        },
        "creditsRemaining": {
          "title": "Creditsremaining",
          "description": "Remaining API credits (rounded to whole credits; see creditsRemainingExact for precise value)"
        },
        "creditsConsumed": {
          "title": "Creditsconsumed",
          "description": "Credits consumed by this request (rounded; see creditsConsumedExact for precise value)"
        },
        "creditsRemainingExact": {
          "title": "Creditsremainingexact",
          "description": "Remaining API credits, precise to 1 decimal place"
        },
        "creditsConsumedExact": {
          "title": "Creditsconsumedexact",
          "description": "Credits consumed by this request, precise to 1 decimal place"
        },
        "tokensUsage": {
          "description": "Provider token-usage block \u2014 populated on terminal video polls only, null on every non-video endpoint. See TokensUsage for its fields."
        }
      },
      "type": "object",
      "required": [
        "requestId",
        "timestamp"
      ],
      "title": "ResponseMeta"
    }
  },
  "type": "object",
  "required": [
    "meta"
  ],
  "title": "OpenApiResponse[KeywordSearchResultsData]",
  "examples": []
}

422: Validation Error Content-Type: application/json

Example Response:

{
  "detail": [
    {
      "loc": [],
      "msg": "Message",
      "type": "Error Type",
      "ctx": {}
    }
  ]
}

Output Schema:

{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {},
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesLookup date (YYYY-MM-DD). Returns the latest snapshot on or before this date; actual date is `resolvedDate`.
pageNoPage number, starting at 1.
sortByNoSort field: absolutePosition=SERP position; estimateImpressionPoint=estimated impressions; latestObservedAt=latest observation; price, rating, ratingCount, and recentSales use their named product metrics; asin and title use lexical order.absolutePosition
keywordYesKeyword to search.
pageSizeNoItems per page; 1 to 100.
sortOrderNoSort direction. The default `absolutePosition asc` returns the lowest rank numbers first.asc
granularityNoData period granularity. Only `week` is currently supported.week
marketplaceNoAmazon marketplace code. Only 'US' is currently supported.US
exploreTypesNoOptional placement filter. Empty means all result types. Allowed values: ORG/SP/SB/SBV/SPR.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • changedInput schema / properties / date / description
      Previous value: -"Lookup date in YYYY-MM-DD format. The response returns the latest snapshot on or before this date."New value: +"Lookup date (YYYY-MM-DD). Returns the latest snapshot on or before this date; actual date is `resolvedDate`."
    • addedInput schema / properties / date / format
      Added value: +"date"
    • addedInput schema / properties / date / pattern
      Added value: +"^\\d{4}-(0[1-9]|1[0-2])-([0-2]\\d|3[01])$"
    • removedInput schema / properties / exploreTypes / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "enum": [
      -        "ORG",
      -        "SP",
      -        "SB",
      -        "SBV",
      -        "SPR"
      -      ],
      -      "type": "string"
      -    },
      -    "type": "array"
      -  }
      -]
    • addedInput schema / properties / exploreTypes / items
      Added value: +{
      +  "enum": [
      +    "ORG",
      +    "SP",
      +    "SB",
      +    "SBV",
      +    "SPR"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / granularity
      Added value: +{
      +  "const": "week",
      +  "default": "week",
      +  "description": "Data period granularity. Only `week` is currently supported.",
      +  "title": "granularity",
      +  "type": "string"
      +}
    • addedInput schema / properties / keyword / minLength
      Added value: +1
    • addedInput schema / properties / keyword / pattern
      Added value: +"\\S"
    • changedInput schema / properties / page / description
      Previous value: -"Page number."New value: +"Page number, starting at 1."
    • changedInput schema / properties / pageSize / description
      Previous value: -"Page size."New value: +"Items per page; 1 to 100."
    • changedInput schema / properties / sortBy / description
      Previous value: -"Sort field."New value: +"Sort field: absolutePosition=SERP position; estimateImpressionPoint=estimated impressions; latestObservedAt=latest observation; price, rating, ratingCount, and recentSales use their named product metrics; asin and title use lexical order."
  2. Changed1 schema field changed
    • removedInput schema / properties / granularity
      Removed value: -{
      -  "default": "week",
      -  "description": "Period granularity. Supports `day`, `week`, and `month`.",
      -  "enum": [
      -    "day",
      -    "week",
      -    "month"
      -  ],
      -  "title": "granularity",
      -  "type": "string"
      -}
  3. Changed3 schema fields changed
    • addedInput schema / properties / marketplace / const
      Added value: +"US"
    • changedInput schema / properties / marketplace / description
      Previous value: -"Amazon marketplace code"New value: +"Amazon marketplace code. Only 'US' is currently supported."
    • removedInput schema / properties / marketplace / enum
      Removed value: -[
      -  "US",
      -  "UK"
      -]
  4. Changed5 schema fields changed
    • removedInput schema / properties / granularity / const
      Removed value: -"lately_day"
    • changedInput schema / properties / granularity / default
      Previous value: -"lately_day"New value: +"week"
    • changedInput schema / properties / granularity / description
      Previous value: -"Observation-window granularity. Keyword SERP currently supports `lately_day` only."New value: +"Period granularity. Supports `day`, `week`, and `month`."
    • addedInput schema / properties / granularity / enum
      Added value: +[
      +  "day",
      +  "week",
      +  "month"
      +]
    • removedInput schema / properties / lookbackDays
      Removed value: -{
      -  "const": 7,
      -  "default": 7,
      -  "description": "Observation-window length in days. Currently only `7` is supported.",
      -  "title": "lookbackDays",
      -  "type": "integer"
      -}
  5. Changed6 schema fields changed
    • changedInput schema / properties / date / description
      Previous value: -"Lookup date in YYYY-MM-DD format. Data is stored as daily snapshots for the most recent 7 days, and the response returns the latest snapshot on or before this date."New value: +"Lookup date in YYYY-MM-DD format. The response returns the latest snapshot on or before this date."
    • changedInput schema / properties / exploreTypes / description
      Previous value: -"Optional placement filter. Empty means all result types."New value: +"Optional placement filter. Empty means all result types. Allowed values: ORG/SP/SB/SBV/SPR."
    • addedInput schema / properties / granularity
      Added value: +{
      +  "const": "lately_day",
      +  "default": "lately_day",
      +  "description": "Observation-window granularity. Keyword SERP currently supports `lately_day` only.",
      +  "title": "granularity",
      +  "type": "string"
      +}
    • addedInput schema / properties / lookbackDays
      Added value: +{
      +  "const": 7,
      +  "default": 7,
      +  "description": "Observation-window length in days. Currently only `7` is supported.",
      +  "title": "lookbackDays",
      +  "type": "integer"
      +}
    • changedInput schema / properties / sortBy / enum
      Previous value: -[
      -  "absolutePosition",
      -  "estimateImpressionPoint",
      -  "observedAt",
      -  "price",
      -  "rating",
      -  "ratingCount",
      -  "recentSales",
      -  "asin",
      -  "title"
      -]New value: +[
      +  "absolutePosition",
      +  "estimateImpressionPoint",
      +  "latestObservedAt",
      +  "price",
      +  "rating",
      +  "ratingCount",
      +  "recentSales",
      +  "asin",
      +  "title"
      +]
    • changedInput schema / properties / sortOrder / description
      Previous value: -"Sort direction."New value: +"Sort direction. The default `absolutePosition asc` returns the lowest rank numbers first."
  6. Changed8 schema fields changed
    • changedInput schema / properties / date / description
      Previous value: -"查询日期,格式 YYYY-MM-DD。数据按天快照存储,保留最近 7 天,返回该日期当日或之前最近一个快照数据。"New value: +"Lookup date in YYYY-MM-DD format. Data is stored as daily snapshots for the most recent 7 days, and the response returns the latest snapshot on or before this date."
    • changedInput schema / properties / exploreTypes / description
      Previous value: -"可选的曝光位置筛选;为空时表示返回全部位置类型"New value: +"Optional placement filter. Empty means all result types."
    • changedInput schema / properties / keyword / description
      Previous value: -"要搜索的关键词"New value: +"Keyword to search."
    • changedInput schema / properties / marketplace / description
      Previous value: -"亚马逊站点代码"New value: +"Amazon marketplace code"
    • changedInput schema / properties / page / description
      Previous value: -"页码,从 1 开始"New value: +"Page number."
    • changedInput schema / properties / pageSize / description
      Previous value: -"每页条数,最大 100"New value: +"Page size."
    • changedInput schema / properties / sortBy / description
      Previous value: -"排序字段"New value: +"Sort field."
    • changedInput schema / properties / sortOrder / description
      Previous value: -"排序方向"New value: +"Sort direction."
  7. Added

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description itself carries the behavioral disclosure burden. It says the tool returns factual product data and positions rather than market metrics, that the period is weekly, and that results can be placement-filtered. It also documents success, validation-error, and metadata behavior. Auth or rate-limit details are not covered, but the practical behavior for an agent is adequately transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well structured and front-loaded with 'Function' and 'Use cases,' which is helpful. However, it is padded with large response schemas, ADR credit-migration notes, and TODO details that an agent needs less for tool selection and invocation. It is readable, but not every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter read-style query tool, this is largely complete: the description explains what type of data is returned, what is excluded, when to use it versus market-profile, and the response/error envelope. Item-level response fields are not fully expanded, but the sortBy enum implies the product fields, so an agent can safely invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already documents all params with 100% description coverage, including formats, defaults, enum meanings, and constraints. The description contributes only high-level context like 'weekly period' and 'optional placement filtering.' Since the schema does the heavy lifting, a baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Return factual product listings and absolute ranking positions for a keyword in the weekly period,' and adds the optional placement-filtering behavior. It also distinguishes itself from sibling endpoints by stating that SERP aggregates and keyword market metrics are intentionally excluded and provided by dedicated metric endpoints.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'Use cases' section clearly tells an agent when to use this tool: to inspect which products, brands, and placements appear for a keyword and compare ranking positions. It also points to 'market-profile' for market-level assessments, giving an explicit alternative. It does not enumerate every sibling exclusion, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources