Amazon API — Parse an Amazon URL into an ASIN
Documentation menu
FetchLayer FetchLayer API

Parse an Amazon URL

Turn any Amazon URL into the structured input it encodes, without contacting Amazon. A product URL in any of its common shapes (/dp/, /gp/product/, /gp/aw/d/, with or without a slug and tracking parameters) comes back as its marketplace and ASIN; a search URL comes back as its query, department, price bounds, sort order and page. Both come with a clean canonical URL. Parsing a URL does not consume a credit.

POST /resolve-url Utility
https://api.fetchlayer.dev/amazon/resolve-url
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

url string required

Any Amazon URL, to be parsed into structured input.

format string optional

json or markdown. (default: json)

timeoutMs number optional

Per-request time limit in milliseconds (max 600000).

Response Fields

resolve-url

Parse an Amazon URL

kind string

What the URL points at: product, search, or unknown.

marketplace string

The marketplace, for example com. null for a URL that is not on a supported Amazon marketplace.

asin string

Present when kind is product — pass it to price-check or product-details.

query string

Present when kind is search — pass it to search-products.

department string

Department carried in a search URL.

minPrice number

Lower price bound carried in a search URL.

maxPrice number

Upper price bound carried in a search URL.

sortBy string

Sort order carried in a search URL.

page number

Page number carried in a search URL.

canonicalUrl string

A clean URL for the product or search.

Request

curl -X POST "https://api.fetchlayer.dev/amazon/resolve-url" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.amazon.com/Instant-Pot-Multi-Use-Programmable-Pressure/dp/B00FLYWNYQ/ref=sr_1_3?keywords=instant+pot"}'

Response

{
  "kind": "product",
  "marketplace": "com",
  "asin": "B00FLYWNYQ",
  "query": null,
  "department": null,
  "minPrice": null,
  "maxPrice": null,
  "sortBy": null,
  "page": null,
  "canonicalUrl": "https://www.amazon.com/dp/B00FLYWNYQ"
}