ASINSpotlight

AI Entegrasyon Rehberi

ASINSpotlight Scraping API'yi Cursor, Claude Code, Continue, ChatGPT'ye bağlayın — kotaya duyarlı, deyimsel kod üreten hazır prompt tarifleriyle.

Bu nedir

ASINSpotlight Scraping API üzerinde AI kodlama araçlarıyla geliştirme yapmak için pratik bir rehber. API, kimlik doğrulama için tek bir başlık kullanan REST + JSON yapısında — LLM'lerin iyi anladığı tam olarak bu biçim. Bu sayfa var çünkü teknik olarak doğru AI-üretimli kod genellikle deyimsel olarak yanlış: kota sinyallerini görmezden gelir, yanlış sayfalar, ürün detayını teklifle karıştırır. Aşağıdaki promptlar ve desenler bu boşluğu kapatır.

Resmi sözleşme için AI'ı OpenAPI spesifikasyonuna yönlendirin:

url
https://www.asinspotlight.com/scraping-api-docs/openapi.json

Cursor, Claude Code, Continue, Windsurf ve ChatGPT — hepsi OpenAPI'yi yerel olarak işliyor. Aşağıdaki her prompt tarifi spesifikasyon URL'sini en başta verir, böylece asistan uygulamayı gerçek şemalar üzerinde kurar.

5 dakikada hızlı başlangıç

board.asinspotlight.com/dashboard/api adresinden anahtar oluşturun ve ortam değişkenine ekleyin:

bash
export ASINSPOTLIGHT_API_KEY="sk_live_..."

Bir istek atın:

bash
curl -H "x-api-key: $ASINSPOTLIGHT_API_KEY" \
  "https://api.asinspotlight.com/v1/product?asin=B0B3ZD8QXJ&marketplace=us"

Yaklaşık şöyle bir şey görmelisiniz:

json
{
  "success": true,
  "page_type": "product",
  "data": {
    "asin": "B0B3ZD8QXJ",
    "title": "Soundcore Q20i Headphones",
    "bb_price": 39.99,
    "rating": 4.6,
    "reviews": 58800,
    "bsr": 12,
    "in_stock": true,
    "bought_past_month": 20000
  },
  "meta": {
    "marketplace": "us",
    "timing_ms": 1842,
    "request_url": "https://www.amazon.com/dp/B0B3ZD8QXJ",
    "timestamp": "2026-05-03T10:14:22.318Z",
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "usage": {"requests_consumed": 1, "requests_remaining": 49999}
  }
}

Sözleşme bu. Her başarılı yanıtta meta.usage.requests_remaining bulunur — kodunuzu ayrı bir kontrol olmadan kotaya duyarlı yapmak için her çağrıda okuyun.

Endpoint'lere genel bakış

İşYolŞunun için
Ürün detayını alGET /v1/product?asin=…&marketplace=…Başlık, Buy Box fiyatı, BSR, puan, yorumlar, marka, kategori, aylık talep. Tipik PDP'lerde saniyeden kısa.
Anahtar kelimeyle araGET /v1/search?keyword=…&marketplace=…Organik arama sonuçlarının ilk sayfası. Her giriş zaten fiyat, puan, yorum, aylık talep, ASIN içerir — kısa liste için /product takip çağrısı gerekmez.
Tüm satıcıları alGET /v1/offers?asin=…&marketplace=…Tüm Buy Box paneli: her satıcı, fiyat, kargo, FBA/FBM, puan. Gerçek zamanlı, önbellekten değil.
Herhangi bir URL'i kazıPOST /v1/scrapeapiDocs.ai.endpoints.row4UseFor

Prompt tarifleri

Her tarif Cursor, Claude Code, ChatGPT veya başka bir kodlama asistanına yapıştırmaya hazır. Spesifikasyon URL'sini, ortam değişkenini ve AI'ın genelde kaçırdığı tuzağı belirtirler.

1. Pazaryerleri arası fiyat karşılaştırması

prompt
Build a script that compares prices for a list of ASINs across multiple Amazon marketplaces using the ASINSpotlight Scraping API.

OpenAPI spec: https://www.asinspotlight.com/scraping-api-docs/openapi.json
API base URL: https://api.asinspotlight.com (note: api., not www.)
Auth: API key in the `x-api-key` header (read from env var `ASINSPOTLIGHT_API_KEY`).
Endpoint: GET /v1/product?asin=...&marketplace=...

Inputs:
  - List of ASINs (e.g., ["B0B3ZD8QXJ", "B0CQXMXJC5"])
  - List of marketplace codes (e.g., ["us", "uk", "de"])

For each (asin, marketplace) pair, fetch product details and collect: asin, marketplace, title, bb_price, in_stock, rating.

Output: CSV with columns asin, marketplace, title, bb_price, in_stock, rating.

Constraints:
  - Stop early and surface the error if a request returns 401, 429, or 5xx.
  - After each successful response, read `meta.usage.requests_remaining` and abort if it drops below 50.
  - Don't run more than 5 requests in parallel — the account has a parallel-request limit.

AI'ın genelde doğru yaptığı: istek döngüsü, env-var kimlik doğrulama, JSON parse.
Genelde kaçırdığı: meta.usage okumak, paralelliği sınırlamak. Her ikisi de promptta açıkça belirtilmiştir bu yüzden.

2. Günlük anahtar kelime takibi

prompt
Build a daily keyword tracker that records the top 10 ASINs for a list of keywords using the ASINSpotlight Scraping API.

OpenAPI spec: https://www.asinspotlight.com/scraping-api-docs/openapi.json
API base URL: https://api.asinspotlight.com (note: api., not www.)
Auth: API key in the `x-api-key` header (env var `ASINSPOTLIGHT_API_KEY`).
Endpoint: GET /v1/search?keyword=...&marketplace=...

For each keyword, fetch the search results page, take the first 10 entries from `data.shallow_parts`, and write one row per (keyword, rank, asin, title, price, rating, reviews, bought_past_month, captured_at).

Storage: append to a SQLite table `keyword_rankings` keyed on (keyword, marketplace, captured_at, rank).

Run cadence: once per day, intended to be invoked by cron.

Don't:
  - Don't try to "follow up" with a /v1/product call for each search result — `shallow_parts` already contains everything we need.
  - Don't paginate past page 1; we only care about the top 10.
  - Don't retry on 4xx errors; only on 5xx and `CAPTCHA_DETECTED` (with backoff).

Tuzak: AI sıklıkla her arama sonucu için takip eden bir /v1/product çağrısı üretir, kredi tüketimini iki katına çıkarır. shallow_parts yükü zaten günlük takipçinin ihtiyacı olan her şeyi içerir.

3. Buy Box sahipliği izleyicisi

prompt
Build a Buy Box ownership monitor for a watchlist of ASINs using the ASINSpotlight Scraping API.

OpenAPI spec: https://www.asinspotlight.com/scraping-api-docs/openapi.json
API base URL: https://api.asinspotlight.com (note: api., not www.)
Auth: API key in the `x-api-key` header (env var `ASINSPOTLIGHT_API_KEY`).
Endpoint: GET /v1/offers?asin=...&marketplace=...

For each ASIN, call /v1/offers and identify the current Buy Box owner — the seller in `data.product_sellers_info` whose price equals the lowest `price + shipping_price` and who has `is_fba: true` (the typical Amazon Buy Box rule).

Compare against the previously recorded owner stored in a JSON file `buybox_state.json` keyed by asin. When the owner changes, log a line to stdout with: timestamp, asin, previous owner, new owner, new price.

Run as a loop with a 10-minute interval between full sweeps.

Don't:
  - Don't conflate /v1/product and /v1/offers — `/v1/product` returns the Buy Box price but not the full seller list. You need /v1/offers for ownership.
  - Don't ignore `stock_qty: 0` sellers; filter those out before picking a winner.
  - Don't run all watchlist requests at once; respect the parallel limit (default ~5).

Tuzak: asistanlar sıklıkla buybox / bb_price alanlarını /v1/product'tan çekip Buy Box sahibi olarak adlandırır. O alan size fiyatın Buy Box olduğunu söyler, kime ait olduğunu değil. Sahiplik verisi yalnızca /v1/offers'tadır.

4. ASIN listesi toplu yenileme

prompt
Build an ASIN-list batch refresh that updates cached product data using the ASINSpotlight Scraping API.

OpenAPI spec: https://www.asinspotlight.com/scraping-api-docs/openapi.json
API base URL: https://api.asinspotlight.com (note: api., not www.)
Auth: API key in the `x-api-key` header (env var `ASINSPOTLIGHT_API_KEY`).
Endpoint: GET /v1/product?asin=...&marketplace=...

Inputs: a JSON file `watchlist.json` of `{asin, marketplace, last_refreshed_at}` records.

Refresh strategy:
  1. Sort the list by `last_refreshed_at` ascending (oldest first).
  2. For each entry, call /v1/product. On a successful 200, write the response data and the new timestamp back to the file.
  3. After every response, read `meta.usage.requests_remaining`. If it would dip below the configured floor (default 1000), stop the run and log how many entries were skipped.
  4. Run requests in batches of 5 in parallel.

Error handling:
  - `PAGE_NOT_FOUND` (404): mark the entry as `status: gone` and continue. PAGE_NOT_FOUND consumes 1 credit — that's expected.
  - `CAPTCHA_DETECTED` (503): retry up to 3 times with exponential backoff.
  - `RATE_LIMIT_EXCEEDED` (429): wait 30 seconds and retry the same entry.
  - Any other error: log and stop.

Tuzak: saf toplu işler paralel istek limitini ve kota tabanını yok sayar. Her ikisi de 429'lar ve meta.usage üzerinden net şekilde sinyalize edilir — prompt AI'ya bunlara bakmasını söyler.

5. Arama → veritabanı işlem hattı (sayfalamayla)

prompt
Build a search-to-database pipeline that captures the full first 5 pages of results for a keyword using the ASINSpotlight Scraping API.

OpenAPI spec: https://www.asinspotlight.com/scraping-api-docs/openapi.json
API base URL: https://api.asinspotlight.com (note: api., not www.)
Auth: API key in the `x-api-key` header (env var `ASINSPOTLIGHT_API_KEY`).

The /v1/search endpoint returns page 1 by default. To walk further pages, use POST /v1/scrape with an explicit Amazon search URL containing `&page=N`:

  POST /v1/scrape
  Body: {"url": "https://www.amazon.com/s?k=wireless+headphones&page=2", "marketplace": "us"}

Steps:
  1. Call GET /v1/search?keyword=...&marketplace=us — this is page 1. Read `data.last_page_number` to know the upper bound.
  2. For pages 2..min(5, last_page_number), call POST /v1/scrape with the page-N URL.
  3. Append every entry to a Postgres table `search_results` with columns (keyword, marketplace, page, rank, asin, title, price, rating, reviews, captured_at).

Don't:
  - Don't try `?page=2` on the typed /v1/search endpoint — that endpoint doesn't accept a `page` parameter.
  - Don't fetch past `last_page_number` — Amazon will return an empty result set and you'll waste credits.

Tuzak: AI /v1/search?keyword=...&page=2 dener çünkü bariz biçim odur. Tipli arama endpoint'i page kabul etmez. Sayfaları gezmek için POST /v1/scrape'i açık Amazon URL'iyle kullanın — prompt bu değişimi açık hâle getirir.

AI araçlarına bağlama

Cursor

OpenAPI spesifikasyonuna referans veren bir proje kuralı ekleyin. .cursor/rules/asinspotlight.md oluşturun:

markdown
---
description: ASINSpotlight Amazon Scraping API
globs: ["**/*.py", "**/*.ts", "**/*.js"]
alwaysApply: false
---

When working with the ASINSpotlight Scraping API:

- Spec: https://www.asinspotlight.com/scraping-api-docs/openapi.json
- Auth: `x-api-key` header, value from env var `ASINSPOTLIGHT_API_KEY`
- Base URL: https://api.asinspotlight.com/v1
- Endpoints: /product (asin, marketplace), /search (keyword, marketplace), /offers (asin, marketplace), POST /scrape (body: {url, marketplace})
- Read `meta.usage.requests_remaining` after every successful response
- Cap parallelism at 5 unless told otherwise
- For search pagination beyond page 1, use POST /scrape with an explicit Amazon URL containing `&page=N`

Claude Code

Spesifikasyon URL'sini promptunuza geçirin veya proje kökündeki CLAUDE.md'ye ekleyin. Claude Code ilk referansta bunu çekip üzerinde akıl yürütür. Cursor kuralı için yukarıdaki aynı talimatlar bir CLAUDE.md bölümü olarak çalışır.

Continue.dev

Spesifikasyonu ~/.continue/config.json'a bir dokümantasyon kaynağı olarak ekleyin:

json
{
  "docs": [
    {
      "title": "ASINSpotlight Scraping API",
      "startUrl": "https://www.asinspotlight.com/scraping-api-docs/openapi.json",
      "rootUrl": "https://www.asinspotlight.com/scraping-api-docs/openapi.json"
    }
  ]
}

Sohbette @docs ASINSpotlight Scraping API ile referans verin.

ChatGPT (web)

OpenAPI URL'sini sohbete yapıştırın ve ChatGPT'ye onu getirmesini söyleyin. Tarama açıkken spesifikasyonu çekip yazdığı tüm kod için sözleşme olarak kullanır. Claude (claude.ai) ve Gemini'de de aynı şekilde çalışır.

Diğer araçlar (Windsurf, Cline, codex CLI, …)

URL'leri çekebilen veya OpenAPI dokümanı kabul eden herhangi bir ajan aynı şekilde entegre olur: https://www.asinspotlight.com/scraping-api-docs/openapi.json'i gösterin ve yukarıdaki prompt tariflerini kullanın.

Taklit edilecek desenler

Bunlar kotaya duyarlı üretim kodunu naif scriptlerden ayıran deyimlerdir.

Kotaya duyarlı döngüler

Her başarılı yanıt meta.usage.requests_remaining taşır. Devam edip etmeyeceğine karar vermek için ayrı bir endpoint sorgulamayın — her çağrıda okuyun:

typescript
for (const asin of asins) {
  const res = await fetchProduct(asin);
  if (!res.success) handleError(res.error.code);
  if (res.meta.usage.requests_remaining < FLOOR) break;
  store(res.data);
}

Pazaryeri değiştirme

marketplace, hangi Amazon vitrininin sorgulanacağını kontrol eden tek parametredir. Her çağrıda açıkça geçirin — us varsayılanına güvenmeyin, eğer kasıtlı değilse. Geçerli kodlar spesifikasyonun Marketplace şemasında listelenmiştir.

Kredi yakmayan hata yönetimi

Çoğu hata yanıtı kredi tüketmez. İstisna PAGE_NOT_FOUND (404) — parser yine de çalıştığı için ücretlendirilirsiniz. Buna göre planlayın: silinmiş ASIN'lere giden bir yenileme işi her birinden 1 kredi alarak kotayı yavaşça boşaltır, bu yüzden bu girişleri işaretleyin ve yenilemeyi durdurun.

/scrape ile sayfalama

/v1/search 1. sayfayı döndürür. 2+ için açık Amazon URL https://www.amazon.com/s?k=…&page=N ile POST /v1/scrape kullanın. Yanıt biçimi SearchData ile eşleşir.

AI-üretimli kodun düştüğü yaygın tuzaklar

  • /v1/product ve /v1/offers'i karıştırmak. Product size Buy Box fiyatını verir; offers Buy Box sahibini ve diğer her satıcıyı verir. Karıştırmayın.
  • /v1/search'te ?page=N denemek. Tipli arama endpoint'i yalnızca keyword ve marketplace kabul eder. Sonraki sayfalar için /scrape kullanın.
  • meta.usage okumak yerine sorgulamak. Kalan kredi sayısı her başarılı yanıttadır. Çağrılacak başka bir şey yok.
  • 429 ile 503'ü karıştırmak. 429 çok fazla eşzamanlı istek veya kredi yok demektir — geri çekilin veya durun. CAPTCHA_DETECTED kodlu 503 geçicidir — üstel geri çekilmeyle yeniden deneyin.
  • marketplace parametresini unutmak. Onsuz her çağrı amazon.com'a gider — Avrupa veya Japonya iş akışları için sessiz UX hatası. Her zaman açıkça geçin.
  • PAGE_NOT_FOUND'u ücretsiz saymak. 1 krediye mal olur (parser çalıştı). Eskimiş izleme listelerine karşı yenileme işleri kotayı sessizce boşaltır.
  • 4xx'i körü körüne yeniden denemek. Doğrulama (400) ve kimlik doğrulama (401) hataları kendiliğinden düzelmez. Yalnızca 429, 502 ve 503 yeniden denemeye değer.

Sonraki adımlar