{
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"report_type": {
"type": "string",
"enum": [
"keywords_for_keyword.1",
"keywords_for_asin.1"
],
"description": "keywords_for_keyword.1 for a keyword's related keywords; keywords_for_asin.1 for an ASIN's keywords."
},
"parameters": {
"type": "object",
"properties": {
"keyword": {
"description": "Required for keywords_for_keyword.1 only: the keyword to research, 1 to 200 characters.",
"type": "string",
"maxLength": 1024
},
"asin": {
"description": "Required for keywords_for_asin.1 only: a 10-character ASIN. Its variations are always included.",
"type": "string",
"maxLength": 32
},
"marketplace": {
"type": "string",
"maxLength": 32,
"description": "Marketplace code, any letter case: US, CA, MX, UK, DE, FR, IT, ES, AU."
},
"interval": {
"description": "weekly or monthly: whether clicks and sales are weekly or monthly averages. Default monthly.",
"type": "string",
"maxLength": 32
},
"start_date": {
"type": "string",
"maxLength": 10,
"description": "First week or month, YYYY-MM-DD: the first day of a month, or the Sunday that starts a week."
},
"end_date": {
"type": "string",
"maxLength": 10,
"description": "Last day the report covers, YYYY-MM-DD, on or after start_date."
},
"include_periods": {
"description": "Default false. true adds each keyword's week-by-week or month-by-month detail to the file only, at extra cost; only when the user asks for it.",
"type": "boolean"
},
"format": {
"description": "json, jsonl or csv: the gzip file's contents. Default json. csv only when the user asks for a CSV file; it cannot be read inline.",
"type": "string",
"maxLength": 32
}
},
"required": [
"marketplace",
"start_date",
"end_date"
],
"additionalProperties": false,
"description": "The report type's parameters. A parameter of the other type is refused."
}
},
"required": [
"report_type",
"parameters"
],
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/$defs/Report"
}
},
"$defs": {
"Report": {
"type": "object",
"description": "One accepted report and its result. `report_type` says which type it is and which `parameters` it has. `failure_code` is machine-readable and `failure_message` says what to do next; see Get a report for every code.",
"required": [
"report_type"
],
"oneOf": [
{
"$ref": "#/$defs/KeywordsForKeywordReport"
},
{
"$ref": "#/$defs/KeywordsForAsinReport"
}
]
},
"KeywordsForKeywordReport": {
"title": "Keywords for a keyword",
"type": "object",
"description": "One accepted keywords_for_keyword.1 report and its result. The fields and states are those of an export, with `report_type` in place of `export_type`.",
"required": [
"id",
"report_type",
"parameters",
"state",
"failure_code",
"failure_message",
"created_at",
"started_at",
"completed_at",
"result"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"report_type": {
"type": "string",
"enum": [
"keywords_for_keyword.1"
]
},
"parameters": {
"$ref": "#/$defs/KeywordsForKeywordReportRunParameters"
},
"state": {
"type": "string",
"enum": [
"queued",
"processing",
"ready",
"failed",
"expired"
],
"description": "`queued` and `processing` are unfinished; poll at least 5 seconds apart. `ready` has a file. `failed` and `expired` are terminal. Decide failure from `state`, not `failure_code`."
},
"failure_code": {
"type": [
"string",
"null"
],
"description": "Stable terminal failure code. See Get a report for recovery."
},
"failure_message": {
"type": [
"string",
"null"
],
"description": "Plain-language explanation and next step for a `failed` report. Null in every other state."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "When the request was accepted."
},
"started_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"completed_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"result": {
"type": [
"object",
"null"
],
"description": "Null until successful completion. Ready and expired reports keep this metadata; a report with no matching keywords has `row_count` 0. Download links come only from the download endpoint.",
"required": [
"row_count",
"compressed_bytes",
"expires_at"
],
"properties": {
"row_count": {
"type": "integer",
"minimum": 0,
"description": "Keywords in the file, whatever its format. A CSV header is not counted, and a CSV with periods can have more rows than keywords."
},
"compressed_bytes": {
"type": "integer",
"minimum": 0
},
"expires_at": {
"type": "string",
"format": "date-time"
}
}
}
}
},
"KeywordsForKeywordReportRunParameters": {
"title": "Keywords for a keyword parameters, as accepted",
"type": "object",
"required": [
"keyword",
"marketplace",
"interval",
"start_date",
"end_date"
],
"properties": {
"keyword": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "The keyword to research. The report covers it and every keyword that contains it, as the app's default Keyword Spy search finds them. For data on an exact list of keywords use `GET /v0/keywords`. Surrounding and repeated spaces are removed and it is stored in lower case."
},
"marketplace": {
"type": "string",
"enum": [
"US",
"CA",
"MX",
"UK",
"DE",
"FR",
"IT",
"ES",
"AU"
],
"description": "The marketplace to research. Case-insensitive; stored in upper case."
},
"interval": {
"type": "string",
"enum": [
"weekly",
"monthly"
],
"default": "monthly",
"description": "Whether `clicks` and `sales` are weekly or monthly averages. `weekly` returns `403 weekly_interval_not_allowed` on plans without weekly data."
},
"start_date": {
"type": "string",
"format": "date",
"description": "First week or month of the range, `YYYY-MM-DD`: the first day of a month, or the Sunday that starts a week. Any other day returns `400 invalid_date` with `error.suggested_start_date`."
},
"end_date": {
"type": "string",
"format": "date",
"description": "Last week or month of the range, `YYYY-MM-DD`, on or after `start_date`. The range covers at most 12 weeks or months and must lie within the research data available on your plan."
},
"include_periods": {
"type": "boolean",
"default": false,
"description": "Whether each record has a `periods` array with the keyword's week-by-week or month-by-month detail."
},
"format": {
"type": "string",
"enum": [
"json",
"jsonl",
"csv"
],
"default": "json",
"description": "The file format."
}
},
"description": "The request's parameters as accepted: normalised, with the defaults of `interval`, `include_periods` and `format` filled in."
},
"KeywordsForAsinReport": {
"title": "Keywords for an ASIN",
"type": "object",
"description": "One accepted keywords_for_asin.1 report and its result. The fields and states are those of an export, with `report_type` in place of `export_type`.",
"required": [
"id",
"report_type",
"parameters",
"state",
"failure_code",
"failure_message",
"created_at",
"started_at",
"completed_at",
"result"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"report_type": {
"type": "string",
"enum": [
"keywords_for_asin.1"
]
},
"parameters": {
"$ref": "#/$defs/KeywordsForAsinReportRunParameters"
},
"state": {
"type": "string",
"enum": [
"queued",
"processing",
"ready",
"failed",
"expired"
],
"description": "`queued` and `processing` are unfinished; poll at least 5 seconds apart. `ready` has a file. `failed` and `expired` are terminal. Decide failure from `state`, not `failure_code`."
},
"failure_code": {
"type": [
"string",
"null"
],
"description": "Stable terminal failure code. See Get a report for recovery."
},
"failure_message": {
"type": [
"string",
"null"
],
"description": "Plain-language explanation and next step for a `failed` report. Null in every other state."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "When the request was accepted."
},
"started_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"completed_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"result": {
"type": [
"object",
"null"
],
"description": "Null until successful completion. Ready and expired reports keep this metadata; a report with no matching keywords has `row_count` 0. Download links come only from the download endpoint.",
"required": [
"row_count",
"compressed_bytes",
"expires_at"
],
"properties": {
"row_count": {
"type": "integer",
"minimum": 0,
"description": "Keywords in the file, whatever its format. A CSV header is not counted, and a CSV with periods can have more rows than keywords."
},
"compressed_bytes": {
"type": "integer",
"minimum": 0
},
"expires_at": {
"type": "string",
"format": "date-time"
}
}
}
}
},
"KeywordsForAsinReportRunParameters": {
"title": "Keywords for an ASIN parameters, as accepted",
"type": "object",
"required": [
"asin",
"marketplace",
"interval",
"start_date",
"end_date"
],
"properties": {
"asin": {
"type": "string",
"pattern": "^[A-Za-z0-9]{10}$",
"description": "The ASIN to research: 10 letters and digits. Surrounding spaces are removed and it is stored in upper case. The report always includes the ASIN's variations."
},
"marketplace": {
"type": "string",
"enum": [
"US",
"CA",
"MX",
"UK",
"DE",
"FR",
"IT",
"ES",
"AU"
],
"description": "The marketplace to research. Case-insensitive; stored in upper case."
},
"interval": {
"type": "string",
"enum": [
"weekly",
"monthly"
],
"default": "monthly",
"description": "Whether `clicks` and `sales` are weekly or monthly averages. `weekly` returns `403 weekly_interval_not_allowed` on plans without weekly data."
},
"start_date": {
"type": "string",
"format": "date",
"description": "First week or month of the range, `YYYY-MM-DD`: the first day of a month, or the Sunday that starts a week. Any other day returns `400 invalid_date` with `error.suggested_start_date`."
},
"end_date": {
"type": "string",
"format": "date",
"description": "Last week or month of the range, `YYYY-MM-DD`, on or after `start_date`. The range covers at most 12 weeks or months and must lie within the research data available on your plan."
},
"include_periods": {
"type": "boolean",
"default": false,
"description": "Whether each record has a `periods` array with the keyword's week-by-week or month-by-month detail."
},
"format": {
"type": "string",
"enum": [
"json",
"jsonl",
"csv"
],
"default": "json",
"description": "The file format."
}
},
"description": "The request's parameters as accepted: normalised, with the defaults of `interval`, `include_periods` and `format` filled in."
}
}
}
}