Loading...
Loading...
One-stop skill for obtaining Amazon Ads reports, covering all report types of Sponsored Products (SP) / Sponsored Brands (SB). The script automatically completes report creation, waiting, downloading, and decompression, and directly returns readable structured data. The valid report types and their column lists/groupBy/filters are sourced from `references/report-types/<adProduct-dir>/<reportTypeId>.md` as the single source of truth. This skill is triggered when users mention pulling Amazon Ads reports, downloading Amazon Ads reports, or obtaining any reports such as SP/SB campaigns, keywords, search terms, advertised products, purchased products, ad groups, traffic anomalies, Prompt extensions, etc. This skill depends on linkfox-amazon-ads-auth. Sponsored Display (SD) / Sponsored Television (ST) / Amazon DSP are not covered yet.
npx skill4agent add linkfox-ai/linkfox-skills linkfox-amazon-ads-report.mdreferences/report-types/linkfox-amazon-ads-authDEPENDENCY_MISSINGprofileIdauthorized_stores.pylinkfox-amazon-ads-authcountryCodeUSaccountNamelinkfox-amazon-ads-authlinkfox-amazon-ads-auth.mdreferences/report-types/get_report.pyreferences/report-types/<adProduct-dir>/<reportTypeId>.mdreferences/api.md| Script | Responsibility |
|---|---|
| One-stop execution. Required parameters |
| Checks if linkfox-amazon-ads-auth is installed |
references/api.mdspCampaignsspAdvertisedProductsbPurchasedProductspSearchTermreferences/report-types/<adProduct-dir>/<reportTypeId>.mdadProductgroupBytimeUnitformatdateRangefilterstimeUnitcolumnsfiltersadProductgroupBycolumns| Condition | Default Rule |
|---|---|
| Date range ≤ 7 days → |
| Must include |
| |
| Only add when user mentions intent like "sales/conversion/ROI/ACOS": |
| No filters applied (return full data) |
| Take the first value in the frontmatter |
adProductgroupBycolumnspython scripts/get_report.py '{
"profileId": 1234567890, "region": "NA",
"reportTypeId": "spCampaigns",
"adProduct": "SPONSORED_PRODUCTS",
"groupBy": ["campaign"],
"columns": ["date","campaignId","campaignName","impressions","clicks","cost"],
"startDate": "2026-04-27","endDate": "2026-05-03",
"timeUnit": "DAILY"
}'python scripts/get_report.py '{
"profileId": 1234567890, "region": "NA",
"reportTypeId": "spSearchTerm",
"adProduct": "SPONSORED_PRODUCTS",
"groupBy": ["searchTerm"],
"columns": ["searchTerm","keyword","matchType","impressions","clicks","cost",
"sales7d","sales14d","purchases7d","acosClicks14d","roasClicks14d",
"startDate","endDate"],
"startDate": "2026-04-01","endDate": "2026-04-30",
"timeUnit": "SUMMARY",
"filters": [{"field":"keywordType","values":["BROAD","PHRASE","EXACT"]}]
}'python scripts/get_report.py '{
"profileId": 1234567890, "region": "NA",
"reportTypeId": "sbAdGroup",
"adProduct": "SPONSORED_BRANDS",
"groupBy": ["adGroup"],
"columns": ["adGroupId","adGroupName","impressions","clicks","cost","purchases","sales","startDate","endDate"],
"startDate": "2026-04-01","endDate": "2026-04-30"
}'reportIdprofileIdregionreportIdpython scripts/get_report.py '{
"profileId": 1234567890, "region": "NA",
"reportId": "7df1ef5d-45ba-40cc-b607-ff2148cf4f5e",
"maxAttempts": 60, "pollInterval": 30
}'Auto-recovery: If the caller does not passand Amazon triggers deduplication for the same parameter request (returns HTTP 425reportId), the script will automatically parse the old reportId and switch to polling that old report, no retry is needed.The Request is a duplicate of : <uuid>
{
"success": true,
"reportId": "4ee811a0-...",
"reportTypeId": "spCampaigns",
"startDate": "2026-04-28", "endDate": "2026-05-04",
"downloadPath": "C:/.../tmp/report_data.json",
"extractedFileHttpUrl": "http://127.0.0.1:51234/download",
"extractedFileHttpServeSeconds": 300
}{"error":"Upstream HTTP 400","httpStatus":400,
"body":"{\"code\":\"400\",\"detail\":\"startDate to endDate range (32 days) must not exceed maximum range (31 days)\"}"}status=STILL_PROCESSINGresumeHint.params| Status | Meaning | Suggestion |
|---|---|---|
| Caller did not explicitly pass in the three required parameters | Go back to Step 2 of "Agent Calling Flow", read and supplement the parameters from |
| accessToken expired | Call |
| No associated ad account or insufficient permissions | Check the manager account/ad account association in the Amazon Ads backend |
| Date range exceeds limit (most are 31 days) | Split the pull and merge locally; refer to the frontmatter |
| Column name misspelled / does not match reportTypeId / exceeds Base metrics | Check against the Base metrics table in the |
| Upstream generation failed | Mostly due to date window or permission issues; handle according to the specific failureReason |
| Client polling window exhausted but report is still being generated | Not a failure. stdout already contains |
| A report with the same parameters is already running | The script will automatically parse and switch to polling the old reportId; no intervention is needed from the caller under normal circumstances |
| exit 42 | Dependent skill not installed | Install |
sbPurchasedProductspGrossAndInvalidssbGrossAndInvalidssdGrossAndInvalidsdateRange.dataRetentionDaysendDate >= today[]linkfox-amazon-ads-entitylinkfox-amazon-ads-authreferences/api.md