Asin 0.1.0

dotnet add package Asin --version 0.1.0
                    
NuGet\Install-Package Asin -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Asin" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Asin" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Asin" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Asin --version 0.1.0
                    
#r "nuget: Asin, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Asin@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Asin&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Asin&version=0.1.0
                    
Install as a Cake Tool

Asin .NET SDK

The official .NET SDK for the Asin Amazon price tracking API.

Track Amazon prices and products with a scheduled watchlist, price history, offers and alerts.

The SDK exposes 11 typed async methods, one per documented endpoint (with required properties checked at compile time), plus a generic RequestAsync.

Requirements

  • .NET 8 or newer

Installation

dotnet add package Asin

Get your API key

Sign up for Asin or sign in, then copy your API key from the dashboard. new AsinClient() reads the ASIN_API_KEY environment variable.

Quick start

using Asin;

using var client = new AsinClient();
var response = await client.SearchAmazonAsync(new SearchAmazonParams { Query = "wireless earbuds" });
Console.WriteLine(response.Json);

Parameter classes mirror the API reference. Use response.Deserialize<MyType>() to map the JSON onto your own types.

HTTP methods

Each method uses the HTTP verb of its endpoint. GET and DELETE send parameters in the query string; POST and PATCH send them as a JSON body, except wait on /products/{id}/check, which stays in the query string. Null values are never sent, so target_price cannot be removed through the SDK yet.

Any endpoint

var response = await client.RequestAsync("GET", "/account");

Errors

try
{
    await client.SearchAmazonAsync(new SearchAmazonParams { Query = "wireless earbuds" });
}
catch (AsinApiException exception)
{
    Console.Error.WriteLine($"{exception.StatusCode}: {exception.Message}");
}
Exception When
AsinConfigurationException Missing API key, invalid options or unsupported method.
AsinSerializationException A required parameter is missing or a value can't be sent.
AsinTransportException Network failure or timeout.
AsinApiException Non-2xx status (StatusCode, ErrorMessage, ResponseBody, RawResponse).
AsinResponseDecodingException A success response could not be decoded.

All of them derive from AsinException. Caller cancellation surfaces as OperationCanceledException.

Retries

Requests are retried up to 3 times after a network error, a 408, 429, 500, 502, 503 or 504. Other statuses, such as 400, 401, 402 or 404, and client-side timeouts are not retried. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a Retry-After header wins.

using var client = new AsinClient(new AsinClientOptions { MaxRetries = 5, RetryDelay = TimeSpan.FromMilliseconds(500) });
await client.SearchAmazonAsync(new SearchAmazonParams { Query = "wireless earbuds" }, new RequestOptions { MaxRetries = 0 }); // one request without retries

Batch requests

BatchAsync runs a function per item with at most 10 in flight (concurrency) and returns one BatchResult per item, in input order. A failing item never stops the others.

string[] inputs = { "wireless earbuds", "mechanical keyboard", "usb-c hub" };
var results = await client.BatchAsync(inputs, (value, ct) =>
    client.SearchAmazonAsync(new SearchAmazonParams { Query = value }, cancellationToken: ct), concurrency: 5);
foreach (var result in results)
{
    if (result.Ok)
    {
        Console.WriteLine(result.Value!.Json);
    }
    else
    {
        Console.Error.WriteLine($"{inputs[result.Index]}: {result.Error!.Message}");
    }
}
Constant Default Description
AsinClient.DefaultConcurrency 10 Tasks run at the same time by batch
AsinClient.DefaultTimeout TimeSpan.FromSeconds(120) Request timeout
AsinClient.MaxRetries 3 Retry attempts after a network error, a 408/429/5xx
AsinClient.RetryBackoffFactor 1.5 Exponential backoff multiplier
AsinClient.DefaultRetryDelay TimeSpan.FromSeconds(1) Delay before the first retry

Configuration

using var client = new AsinClient(new AsinClientOptions
{
    ApiKey = Environment.GetEnvironmentVariable("ASIN_API_KEY"),
    Timeout = TimeSpan.FromSeconds(60), // default 120 s
    HttpClient = myHttpClient,           // optional, you keep ownership
});

Endpoints

11 methods, generated from the OpenAPI document.

Method HTTP Description
CheckProductAsync POST /products/{id}/check Asks for a check right away (1 credit), at most once per 5 minutes; earlier calls return the product unchanged. A paused product has to be…
DeleteProductAsync DELETE /products/{id} Removes the product and its price history.
FetchOffersAsync POST /offers Reads the offers on Amazon for 1 credit, refunded if it doesn't answer. A read made in the last 3 hours, by anyone, is returned instead, fo…
GetAccountAsync GET /account Your plan, the credits left (monthly allowance and packs), how many products you track and the credits they use per month.
GetAsinHistoryAsync GET /history Every price Asin read for an ASIN on a marketplace over the period, whoever tracks it, oldest first, with the lowest, highest and average o…
GetOffersAsync GET /offers Who sells the product and at what price, as last read, cheapest first, with Amazon's own price and the cheapest new and used offers (used i…
GetProductAsync GET /products/{id} The product's latest state and every price read of the period, oldest first. The history covers every read of this ASIN on this marketplace…
ListProductsAsync GET /products Your watchlist, newest first, with each product's latest state and its recent prices (trend). Filter with asin (and marketplace) to know if…
SearchAmazonAsync GET /search Amazon search results (up to 60, sponsored included), to find the ASIN of a product. Free, limited to 30 searches per hour.
TrackProductAsync POST /products Adds an ASIN, an Amazon link or a short link (amzn.to, a.co…) to your watchlist. The first check runs in the background within seconds (che…
UpdateProductAsync PATCH /products/{id} Target price, drop alerts, check interval, or pause. Send only what changes.

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 0 11/6/2026