amzn / ads-advanced-tools-docs

Code samples and supplements for the Amazon Ads advanced tools center
https://advertising.amazon.com/API/docs/en-us/index
MIT No Attribution
96 stars 32 forks source link

429 Too Many Requests Error on First Request to /sp/targets/keywords/recommendations Endpoint for Specific Brand Account #300

Open safaehariri opened 3 months ago

safaehariri commented 3 months ago

I am managing two separate brand accounts on the Amazon Ads platform. When initiating the first API call to the /sp/targets/keywords/recommendations endpoint with the first brand's account, I receive a 429 Too Many Requests error in the first requests. This problem does not occur with the second brand's account, where identical API calls are processed successfully.

Note : I am not making any other API calls in parallel.

Here are the headers :

headers = { 'Authorization': 'Bearer {actual_access_token_here}', 'Amazon-Advertising-API-MarketplaceId': '{actual_marketplace_id_here}', 'Amazon-Advertising-API-AdvertiserId': '{actual_profile_id_of_problematic_account}', 'Amazon-Advertising-API-ClientId': '{actual_client_id_here}', 'Amazon-Advertising-API-Scope': '{actual_profile_id_of_problematic_account}', 'Content-Type': 'application/vnd.spkeywordsrecommendation.v4+json' }

request_data = { "asins": ["{actual_asin_here}"], "recommendationType": "KEYWORDS_FOR_ASINS", "targets": [], "maxRecommendations": 200, "sortDimension": "CONVERSIONS" }