Datarova
Reports

get_report

Get report ยท Read-only, idempotent

Read one existing report's state, parameters and file metadata.

Poll unfinished reports at least 5 seconds apart. When state is ready, read a JSON or JSONL report's keywords with get_report_records; give the user get_report_download_link for a CSV report or when they want the file.

Cost and limits: Costs no credits.

Input

NameTypeRequiredDescription
report_idstring (uuid)RequiredA report ID from list_reports data.reports[].id or request_report data.id. Pattern in the full JSON Schema below.

Output

Read this object from the result's structuredContent. The result's content carries a text version for the model, which is not always the same JSON.

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.

data is one of 2 shapes.

KeywordsForKeywordReport

NameTypeRequiredDescription
idstring (uuid)Required
report_type"keywords_for_keyword.1"Required
parametersobjectRequiredThe request's parameters as accepted: normalised, with the defaults of interval, include_periods and format filled in.
statestringRequiredqueued 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. One of queued, processing, ready, failed, expired.
failure_codestring | nullRequiredStable terminal failure code. See Get a report for recovery.
failure_messagestring | nullRequiredPlain-language explanation and next step for a failed report. Null in every other state.
created_atstring (date-time)RequiredWhen the request was accepted.
started_atstring | null (date-time)Required
completed_atstring | null (date-time)Required
resultobject | nullRequiredNull 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.

data.parameters

NameTypeRequiredDescription
keywordstringRequiredThe 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. Minimum length 1. Maximum length 200.
marketplacestringRequiredThe marketplace to research. Case-insensitive; stored in upper case. One of US, CA, MX, UK, DE, FR, IT, ES, AU.
interval"weekly" | "monthly"RequiredWhether clicks and sales are weekly or monthly averages. weekly returns 403 weekly_interval_not_allowed on plans without weekly data. Default "monthly".
start_datestring (date)RequiredFirst 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_datestring (date)RequiredLast 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_periodsbooleanOptionalWhether each record has a periods array with the keyword's week-by-week or month-by-month detail. Default false.
format"json" | "jsonl" | "csv"OptionalThe file format. Default "json".

data.result

NameTypeRequiredDescription
row_countintegerRequiredKeywords in the file, whatever its format. A CSV header is not counted, and a CSV with periods can have more rows than keywords. Minimum 0.
compressed_bytesintegerRequiredMinimum 0.
expires_atstring (date-time)Required

KeywordsForAsinReport

NameTypeRequiredDescription
idstring (uuid)Required
report_type"keywords_for_asin.1"Required
parametersobjectRequiredThe request's parameters as accepted: normalised, with the defaults of interval, include_periods and format filled in.
statestringRequiredqueued 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. One of queued, processing, ready, failed, expired.
failure_codestring | nullRequiredStable terminal failure code. See Get a report for recovery.
failure_messagestring | nullRequiredPlain-language explanation and next step for a failed report. Null in every other state.
created_atstring (date-time)RequiredWhen the request was accepted.
started_atstring | null (date-time)Required
completed_atstring | null (date-time)Required
resultobject | nullRequiredNull 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.

data.parameters

NameTypeRequiredDescription
asinstringRequiredThe 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. Pattern ^[A-Za-z0-9]{10}$.
marketplacestringRequiredThe marketplace to research. Case-insensitive; stored in upper case. One of US, CA, MX, UK, DE, FR, IT, ES, AU.
interval"weekly" | "monthly"RequiredWhether clicks and sales are weekly or monthly averages. weekly returns 403 weekly_interval_not_allowed on plans without weekly data. Default "monthly".
start_datestring (date)RequiredFirst 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_datestring (date)RequiredLast 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_periodsbooleanOptionalWhether each record has a periods array with the keyword's week-by-week or month-by-month detail. Default false.
format"json" | "jsonl" | "csv"OptionalThe file format. Default "json".

data.result

NameTypeRequiredDescription
row_countintegerRequiredKeywords in the file, whatever its format. A CSV header is not counted, and a CSV with periods can have more rows than keywords. Minimum 0.
compressed_bytesintegerRequiredMinimum 0.
expires_atstring (date-time)Required
Full input and output JSON Schema
JSONCode
{ "inputSchema": { "type": "object", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "report_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$", "description": "A report ID from list_reports data.reports[].id or request_report data.id." } }, "required": [ "report_id" ], "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." } } } }