Expert Tutorials
Code Examples
Industry Analysis
Best Practices

Articles tagged "Amazon"

Terminal showing a C struct for the SellerMagnet API client with a 120 second libcurl timeout and the statistics price kept in integer cents

Amazon Product API in C: libcurl Client, json-c Decoding and Retries

Call an Amazon product API from C with libcurl and json-c: one client with the key in an X-Api-Key header and a 120-second CURLOPT_TIMEOUT (libcurl's own default is 0, meaning never), NULL-safe decoding for a price that is a number or the string "N/A", the statistics price in integer cents kept out of a decimal lookup price, and retries that never pay twice for the same billed answer.

Code editor with the C# MinorUnits record struct from the quickstart that keeps the statistics price in cents and converts it to a decimal per marketplace

Amazon Product API in C#: HttpClient, System.Text.Json Records and Retries

Call an Amazon product API from C# with HttpClient and System.Text.Json: one client with the key in the X-Api-Key header and a 120-second timeout, records for product lookup, offers and statistics, a converter that turns "N/A" into null, a separate type for cents so a statistics price never mixes with a decimal one, and retries that never pay twice for the same answer.

Terminal showing a single Ruby Net::HTTP call that results in two requests reaching the server

Ruby Net::HTTP Retries a Timed-Out GET by Default: Why That Doubles Your Bill

Net::HTTP.new(...).max_retries defaults to 1, so a GET that times out while the Amazon API is still answering gets silently re-sent once by Ruby itself, before your own retry code runs - and every send to a billed endpoint is billed. Here is a local test that proves it (2 requests for 1 call), the stdlib source line that causes it, and the one-line fix.

Code editor showing an Amazon search API call with a sort parameter that the server never reads

Amazon Search API Sort and Department Filter: Why Neither Exists

/amazon-search takes q, marketplaceId, count and geo_location - nothing else. A sort or department parameter is ignored, not rejected, so adding one changes nothing and returns no error. Here is the code that proves it, and the two real workarounds: sort the page client-side, or use /amazon-bestsellers for a department.

Power Your Business with Amazon Data

Join thousands of developers using SellerMagnet API for real-time Amazon product intelligence. Start extracting data in minutes.

150 free API credits • No credit card required • Cancel anytime