Amazon-SP-API-CSharp: AmazonQuotaExceededException thrown

Hi, I’m trying to retrieve info about many products with the API, I split them in chunks of 20 and I’m submitting them all inside a loop:

var ChunkSize = 20;
foreach (var batch in products.Chunk(ChunkSize)) {
  var results = connection.CatalogItem.SearchCatalogItems202204(new ParameterSearchCatalogItems202204 {
    identifiers = batch.Select(p => p.Code).ToArray(),
    identifiersType = IdentifiersType.SKU,
    sellerId = VendorCode,
    pageSize = ChunkSize,
    includedData = new List<IncludedData> {
      IncludedData.identifiers
    }
  });
}

In the console I see that it sends out 3 requests succesfully and then it fails on the 4th.

I noticed that the 3rd request (still successful) logs:

... [RateLimits ,CatalogItems20220401_SearchCatalogItems]: 24/11/2022 10:02:53	 Request/Burst: FULL/2	 Rate: 2,0/500ms

While the first two log:

... [RateLimits ,CatalogItems20220401_SearchCatalogItems]: 24/11/2022 10:02:53	 Request/Burst: 2/2	 Rate: 2,0/500ms

Tried both Async and sync method, no difference

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

But even this one shouldn’t happen because we follow the documentation in Amazon.

I will do another test from my side again

I think amazon share rate limit some how , i try with another developer the application heavy use amazon service and but never use SearchCatalogItems202204 and i get error message

its look more Amaozn not manage rate limit exactly as the documentation

I Use the following code and arrived to 600+ request without any error <I use new fresh application>

int i = 0;
            while (true)
            {
                Console.Write(i++ + " ");
                var results = amazonConnection.CatalogItem.SearchCatalogItems202204(new ParameterSearchCatalogItems202204
                {
                    identifiers = new List<string> { "B07X4DWF8C" },
                    identifiersType = IdentifiersType.ASIN,
                    includedData = new List<IncludedData> {
                      IncludedData.identifiers
                    }
                });

            }

I think the problem came from amazon not from our library

image

@RenzoF and @J-W-Chan , Can you help here i try from my side its look ok but i want you test also