Amazon Scraper API

Go modules - Go 1.21+

Go SDK

Idiomatic Go client with context.Context on every call, typed errors and webhook verification, built only on the standard library. Share one client across goroutines in high-throughput pipelines.

Quick start

1. Install

go get github.com/ChocoData-com/amazon-scraper-api-sdk-go

2. Scrape your first ASIN

package main

import (
    "context"
    "fmt"
    "log"

    asa "github.com/ChocoData-com/amazon-scraper-api-sdk-go"
)

func main() {
    client := asa.New("asa_live_...")

    product, err := client.Product(context.Background(), asa.ProductParams{
        Query:  "B09HN3Q81F",
        Domain: "com",
    })
    if err != nil {
        log.Fatal(err)
    }

    // Responses are map[string]any (the API's JSON, ~55 fields per product).
    fmt.Println(product["title"], product["price"], product["rating"])
}

How-to

Search Amazon

results, err := client.Search(ctx, asa.SearchParams{
    Query:     "wireless earbuds",
    Domain:    "com",
    StartPage: 1,
})
if err != nil {
    log.Fatal(err)
}

products, _ := results["products"].([]any)
for _, item := range products {
    p := item.(map[string]any)
    // Sponsored cards carry sponsored_position instead of organic_position.
    fmt.Println(p["organic_position"], p["asin"], p["title"], p["price"])
}

Async batch with webhooks

batch, err := client.CreateBatch(ctx, asa.BatchCreateParams{
    Endpoint: "amazon.product",
    Items: []map[string]any{
        {"query": "B09HN3Q81F", "domain": "com"},
        {"query": "B0DFBVB6DD", "domain": "com"}, // up to 1,000
    },
    WebhookURL: "https://your.app/webhook", // optional
})
if err != nil {
    log.Fatal(err)
}
// Save this now: the webhook signing secret is returned only once.
fmt.Println("webhook secret:", batch.WebhookSignatureSecret)

// Poll until done (or wait for the webhook)
status, err := client.GetBatch(ctx, batch.ID)
fmt.Println(status["status"], status["processed_count"], "/", status["total_count"])

Context cancellation for timeouts

ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

_, err := client.Product(ctx, asa.ProductParams{Query: "B09HN3Q81F"})
if errors.Is(err, context.DeadlineExceeded) {
    // request timed out cleanly; the in-flight HTTP call was canceled
}

The default HTTP timeout is 120s, which covers the slowest successful scrapes. Use a context deadline, or asa.WithHTTPClient, to set your own.

Handle errors and retry

func productWithRetry(ctx context.Context, client *asa.Client, asin string) (map[string]any, error) {
    for attempt := 1; ; attempt++ {
        p, err := client.Product(ctx, asa.ProductParams{Query: asin, Domain: "com"})
        var ae *asa.Error
        if err == nil || !errors.As(err, &ae) || attempt == 3 {
            return p, err
        }
        switch ae.Code() {
        case "target_unreachable":
            time.Sleep(60 * time.Second) // not charged; Amazon blocked every internal retry
        case "RATE_LIMITED":
            time.Sleep(time.Second)
        default:
            return nil, err // ae.StatusCode, ae.Code() and ae.Body describe the failure
        }
    }
}

The client does not retry on its own, so you decide the policy. Failed requests are never charged. See error codes.

Why use the SDK over net/http?

Idiomatic Go

Functional options, context.Context on every method, and errors.As for typed error checks. Reads like the standard library.

Zero dependencies

Uses only the standard library. No transitive vulnerabilities, no module cache surprises in your go.sum.

Clear errors

Non-2xx responses return `*asa.Error` with `StatusCode`, `Body` and `Code()`, even when a proxy in between returns a non-JSON page. Failures are never billed.

Flexible responses

Results come back as `map[string]any`, so new fields never break your build. Re-marshal into your own struct with encoding/json when you want strong typing.

Goroutine-safe

One client, shared across goroutines. It wraps a standard `*http.Client`, so connections are pooled and reused.

Webhook signature verification

`asa.VerifyWebhookSignature(header, rawBody, secret)` checks the HMAC on batch callbacks in constant time.

Official resources

Pricing

Same rate across every integration. Monthly plans from $19 or pay-as-you-go at $0.90 per 1,000 successful requests. 1,000 free on signup.

Free

$0

Forever free on signup

  • check_circle1,000 requests / month
  • check_circle50 concurrent requests
  • check_circleAll 20 marketplaces
  • check_circleFull dashboard + analytics
  • check_circleTop-up at $0.90 / 1k
  • check_circleCommunity support
Start free
Most popular

Vibe

$19 / month

$0.70 / 1k effective

  • check_circle27,000 requests / month
  • check_circle100 concurrent requests
  • check_circleAll endpoints + content-language
  • check_circleCountry-matched residential IPs
  • check_circlePer-API-key usage tracking
  • check_circleTop-up at $0.90 / 1k
  • check_circleEmail support (1 business day)
Get Vibe

Pro

$49 / month

$0.60 / 1k effective

  • check_circle82,000 requests / month
  • check_circle200 concurrent requests
  • check_circlePriority routing queue
  • check_circleCountry-matched residential IPs
  • check_circleTeam seats (up to 5)
  • check_circleTop-up at $0.90 / 1k
  • check_circleEmail + chat support
Get Pro

Custom

$100-$2k / month

Flat $0.50 / 1k effective at every level

  • check_circle200k - 4M+ requests / month
  • check_circle300-1000+ concurrent requests
  • check_circlePriority queue (highest)
  • check_circlePremium proxy pool + SLA on request
  • check_circleUnlimited team seats
  • check_circleWire / invoice / annual PO
  • check_circleDedicated Slack channel
Pick Custom level

Pay-as-you-go top-up

$0.90 / 1,000 successful requests

Available on every plan including Free. Top up any time when included credits run out. Only 2xx responses charged. Balance never expires.

Ship with Go today

1,000 free requests on signup. No credit card required.