ASIN lookup: find an Amazon product's ASIN from a link, a UPC or a keyword, with Python
Look up Amazon ASINs from a product link, a UPC barcode, a keyword or another store's page, with parent ASIN, GTIN and variants, and a tested Python script.
An ASIN lookup finds the Amazon Standard Identification Number of a product: the 10-character code Amazon uses for every item in its catalog. You need it to link to a product, to track its price or rank, to match it against your own catalog, or to check whether a product you sell elsewhere is already on Amazon.
A free lookup tool is fine for one product. This guide is for when you have a list: product links, barcodes from a spreadsheet, or items from another store. It explains what an ASIN is and how it relates to a UPC, shows what a real lookup returns, and gives a tested Python script of about 130 lines that turns ASINs, Amazon links, UPC or EAN barcodes and Walmart links into ASINs with their parent ASIN, GTIN, part number, Best Sellers Rank and variant ASINs. Every number below comes from real runs on 16 November 2026.
What is an ASIN?
ASIN stands for Amazon Standard Identification Number. Amazon assigns one to each product in its catalog, and the product page lives at amazon.com/dp/ followed by that code. An ASIN is 10 characters of capital letters and digits. Most start with B0, like B07GV2S1GS, the Keurig K-Mini coffee maker in black. For books, the ASIN is the book's 10-digit ISBN.
There are two kinds you will meet:
| Kind | What it is | Example from our runs |
|---|---|---|
| Child ASIN | One buyable item: one color, one size | B07GV2S1GS, the K-Mini in black |
| Parent ASIN | The group that holds all variants of a product, so they share one page | B0D7NQ64H4, the K-Mini in all six colors |
Prices, stock and sellers belong to the child ASIN. The parent is the grouping a shopper sees as the color or size picker. When you look up an ASIN, keep both: the child tells you exactly which item you mean, and the parent ties the variants together.
How is an ASIN different from a UPC?
A UPC (or its international form, the EAN) is the barcode number the brand gets from GS1 and prints on the box. Both are kinds of GTIN, the Global Trade Item Number. The barcode is the same in every store that sells the product; the ASIN exists only on Amazon.
| ASIN | UPC / EAN (GTIN) | |
|---|---|---|
| Who assigns it | Amazon | The brand, through GS1 |
| Length | 10 characters, letters and digits | 12 digits (UPC) or 13 (EAN), digits only |
| Where it works | Amazon only | Every store, on the box itself |
| Use it to | Open, track or cite an Amazon listing | Match the same product across stores |
That difference is why "UPC to ASIN" is such a common search. The barcode is what you already have in your own catalog or on a Walmart page; the ASIN is what you need to find the item on Amazon.
Where do you find the ASIN of a product?
On a single page, look in two places. The URL holds it after /dp/ (or /gp/product/), as in https://www.amazon.com/Instant-Pot-Electric-Pressure-Cooker/dp/B00FLYWNYQ?th=1, where the ASIN is B00FLYWNYQ. The page also lists it in its product details section.
For more than a few products, use one of these routes, depending on what you start from:
| You start from | How the lookup works | Cost with datawebot |
|---|---|---|
| An ASIN | Read amazon.com/dp/ASIN to get the parent ASIN, GTIN, brand and variants |
1 credit |
| An Amazon link | Take the ASIN from the URL, then read the page as above | 1 credit |
| A UPC or EAN barcode | Search Amazon for the barcode, read the first result and check that the page lists the same barcode | 6 credits (a search and a read) |
| A product link from another store | Read the page to get its GTIN, then look up that barcode on Amazon | 7 credits |
| A keyword | Search Amazon and take the ASIN of each result | 5 credits a page |
datawebot reads Amazon search and product pages, along with Walmart, eBay, Zalando, Mercado Libre and the brand stores on its scraper page, and returns them as JSON over REST for your code or MCP for your agent. The Amazon product data API page lists what each Amazon read returns.
What does an ASIN lookup return?
More than the ASIN. Here is what a read of https://www.amazon.com/dp/B07GV2S1GS returned on 16 November 2026 at 23:43 UTC:
| Field | Value from the read |
|---|---|
details.identifiers |
asin B07GV2S1GS, parent_asin B0D7NQ64H4, mpn K-Mini |
details.brand |
Keurig |
details.model_number |
K-Mini |
details.best_sellers_rank |
#3,186 in Home & Kitchen, #8 in Single-Serve Brewers |
details.category_path |
Home & Kitchen › Kitchen & Dining › Coffee, Tea & Espresso › Coffee Makers › Single-Serve Brewers |
details.variants |
6 colors, each with its own ASIN |
price |
USD 69.35, with original_price USD 99.99 |
meta.as_of |
2026-11-16T23:43:30Z |
The six variants under parent B0D7NQ64H4 came back like this:
| Color | Child ASIN |
|---|---|
| Black | B07GV2S1GS |
| Dusty Rose | B08323NVL1 |
| Evergreen | B09RQ568FD |
| Oasis | B07GV2BHKC |
| Studio Gray | B07N3G8GRY |
| Warm Stone | B0D9326MCM |
So one lookup of one ASIN gives you every sibling ASIN as well. If you track a product, that is how you find all its colors without searching for each one.
The Instant Pot Duo 6-quart, read at 23:44 UTC, showed the other identifiers a page can carry: ASIN B00FLYWNYQ, parent B0GXKV5FHP, part number DUO 60 and GTIN 810028585201, the UPC on its box. When a page lists a GTIN, the lookup returns it, and that is what makes the barcode route below work. The product data page lists every field a product read returns.
How do you convert a UPC to an ASIN?
Search Amazon for the barcode number, then confirm the result. A search for 810028585201 on amazon.com, run on 16 November 2026 at 22:14 UTC, returned four organic results:
| # | ASIN | Title (shortened) |
|---|---|---|
| 1 | B00FLYWNYQ | Instant Pot Duo 6 Qt 7-in-1 Electric Pressure Cooker |
| 2 | B08F31PJ16 | Instant Pot Duo 7-in-1 Electric Pressure Cooker, 6 Quart |
| 3 | B07BW5LJG1 | Instant Pot Obsession cookbook and Instant Pot DUO60 |
| 4 | B07BW78JSD | Indian Instant Pot Cookbook and Instant Pot DUO60 |
The first result was the right one: its page lists GTIN 810028585201. The others were a related listing and two bundles that pair a cookbook with the same cooker. That is the reason to confirm instead of taking the first hit on trust. The script below reads the top result and checks that the barcode you searched for appears in the page's own identifiers. If it does, the row is marked barcode confirmed; if not, it is marked check by hand so a person can look.
Two details make barcode matching reliable:
- Ignore leading zeros. The same barcode can be written as 12 digits (UPC-A), 13 (EAN-13, with a leading 0) or 14 (GTIN-14, with two). The script strips leading zeros before it compares, so
011120007503and0011120007503match. - Expect more than one GTIN. The Bissell Little Green 1400B page lists two:
011120007503and058342001681. The script accepts a match on any of them.
How do you look up ASINs in bulk with Python?
The script reads a text file with one lookup per line. Each line can be an ASIN, an Amazon link, a UPC or EAN barcode, or a product link from another store. It saves one CSV row per line and prints a short summary. It uses the standard library only and needs Python 3.9 or later.
Get access
Every account starts with 200 free credits, and sign-in is by email. The quickest way is to give your coding agent (Claude Code, Cursor or similar) this line:
set up https://mcp.datawebot.com/setup.md
The agent asks for your email and you approve the sign-in from the email datawebot sends. The key is saved to ~/.datawebot/credentials, readable only by you, and the script reads it from there. On a server or in CI, put the key in an environment variable named DATAWEBOT_API_KEY from your secret store instead, and never commit it.
The lookups
For this run, lookups.txt held one of each kind: a bare ASIN, an Amazon link with extra text around the ASIN, the UPC of the Bissell Little Green 1400B and the Walmart link for the Instant Pot Duo:
B07GV2S1GS
https://www.amazon.com/Instant-Pot-Electric-Pressure-Cooker/dp/B00FLYWNYQ?th=1
011120007503
https://www.walmart.com/ip/Instant-Pot-Duo-6-Qt-Electric-Pressure-Cooker-7-in-1-with-Easy-Release-Steam-Switch-Slow-Cooker-Rice-Cooker-Steamer-and-More/575389962
The script
"""Look up Amazon ASINs from the ASINs, Amazon links, UPC/EAN barcodes or
other stores' product links listed in lookups.txt, and save the ASIN, parent
ASIN, GTIN, part number, brand, Best Sellers Rank and variant ASINs to
asins.csv. Standard library only."""
import csv, json, os, re, sys, time, urllib.request
API = "https://api.datawebot.com/v1/requests"
ASIN = re.compile(r"(?:/dp/|/gp/product/|^)([A-Z0-9]{10})(?:[/?]|$)")
def api_key():
key = os.environ.get("DATAWEBOT_API_KEY")
if key:
return key
# Written by the agent setup (https://mcp.datawebot.com/setup.md).
with open(os.path.expanduser("~/.datawebot/credentials")) as f:
return json.load(f)["profiles"]["https://mcp.datawebot.com"]["api_key"]
def call(method, url, body=None):
req = urllib.request.Request(url, method=method,
data=json.dumps(body).encode() if body else None,
headers={"Authorization": "Bearer " + api_key(),
"Content-Type": "application/json",
"User-Agent": "asin-lookup-example/1.0"})
with urllib.request.urlopen(req, timeout=120) as r:
return json.loads(r.read())
def ask(body):
"""Send a request; when the answer is "working", poll until it is done."""
res = call("POST", API, body)
for _ in range(40):
if res.get("status") != "working":
return res
time.sleep(res.get("check_after_seconds") or 4)
res = call("GET", f"{API}/{res['request_id']}")
raise RuntimeError("still working after three minutes; try again later")
def asin_in(text):
m = ASIN.search(text.strip())
return m.group(1) if m else None
def read(asin):
res = ask({"capability": "product", "url": f"https://www.amazon.com/dp/{asin}", "country": "US"})
p = res["product"]
d = p.get("details") or {}
ids = {}
for i in d.get("identifiers") or []:
ids.setdefault(i["type"], []).append(i["value"])
rank = (d.get("best_sellers_rank") or [{}])[0]
return {
"asin": (ids.get("asin") or [asin])[0],
"parent_asin": " ".join(ids.get("parent_asin", [])),
"title": p["title"],
"brand": d.get("brand"),
"gtin": " ".join(ids.get("gtin", [])),
"mpn": " ".join(ids.get("mpn", [])),
"best_sellers_rank": f"#{rank['rank']} in {rank['category']}" if rank else "",
"variant_asins": " ".join(v["id"] for v in d.get("variants") or []),
"url": p["url"],
"as_of": res["meta"]["as_of"],
}
def from_barcode(code):
"""Search Amazon for a UPC or EAN, then read the first result and check
that its page lists the same barcode."""
res = ask({"capability": "search", "query": code, "site": "amazon.com", "country": "US", "limit": 3})
for hit in res.get("products") or []:
asin = asin_in(hit["url"])
if asin:
row = read(asin)
barcodes = {g.lstrip("0") for g in row["gtin"].split()}
row["matched"] = "barcode confirmed" if code.lstrip("0") in barcodes else "check by hand"
return row
return None
def from_other_store(url):
"""Read a product page in another store, then look up its GTIN on Amazon."""
res = ask({"capability": "product", "url": url, "country": "US"})
details = res["product"].get("details") or {}
for i in details.get("identifiers") or []:
if i["type"] == "gtin":
row = from_barcode(i["value"])
if row:
row["matched"] += f" (GTIN {i['value']})"
return row
return None
def lookup(line):
asin = asin_in(line)
if asin:
row = read(asin)
row["matched"] = "asin"
elif line.isdigit() and len(line) in (8, 12, 13, 14):
row = from_barcode(line)
elif line.startswith("https://"):
row = from_other_store(line)
else:
row = None
return {"input": line, **(row or {"matched": "no match"})}
def main(path="lookups.txt"):
with open(path) as f:
lines = [line.strip() for line in f if line.strip()]
rows = [lookup(line) for line in lines]
fields = ["input", "matched", "asin", "parent_asin", "title", "brand", "gtin", "mpn",
"best_sellers_rank", "variant_asins", "url", "as_of"]
with open("asins.csv", "w", newline="", encoding="utf-8") as f:
w = csv.DictWriter(f, fieldnames=fields, restval="")
w.writeheader()
w.writerows(rows)
print(f"{len(rows)} lookups saved to asins.csv\n")
for r in rows:
print(f"{r['input'][:44]:<44} -> {r.get('asin', '-')} ({r['matched']})")
if r.get("asin"):
print(f" {r['title'][:70]}")
variants = len(r["variant_asins"].split())
print(f" parent {r['parent_asin'] or '-'} gtin {r['gtin'] or '-'} mpn {r['mpn'] or '-'}")
print(f" {r['best_sellers_rank'] or 'no rank'} {variants} variant ASINs")
if __name__ == "__main__":
main(*sys.argv[1:])
Run it from the folder that holds lookups.txt:
python3 asin_lookup.py
How it works
The lookup function decides what each line is. If the line is or contains an ASIN (10 capital letters and digits, on its own or after /dp/ or /gp/product/), it reads the Amazon page for that ASIN. If the line is 8, 12, 13 or 14 digits, it treats it as a barcode: it searches Amazon for it, reads the first result and compares barcodes. If the line is any other link, it reads that page, takes its GTIN and looks the GTIN up on Amazon the same way. A 10-digit book ISBN is also a valid ASIN, so it goes down the first path.
read keeps the fields an ASIN lookup is usually for: the ASIN and parent ASIN, title, brand, GTINs, part number, the top Best Sellers Rank and every variant's ASIN, plus the product link and the time of the read.
What it printed
This is the real output of the run on 16 November 2026, which started at 23:44 UTC and took about a minute and a half:
4 lookups saved to asins.csv
B07GV2S1GS -> B07GV2S1GS (asin)
Keurig K-Mini Single Serve K-Cup Pod Coffee Maker, 6 to 12oz Brew size
parent B0D7NQ64H4 gtin - mpn K-Mini
#3186 in Home & Kitchen 6 variant ASINs
https://www.amazon.com/Instant-Pot-Electric- -> B00FLYWNYQ (asin)
Instant Pot Duo 6 Qt 7-in-1 Electric Pressure Cooker, Stainless Steel
parent B0GXKV5FHP gtin 810028585201 mpn DUO 60
#103 in Kitchen & Dining 2 variant ASINs
011120007503 -> B0016HF5GK (barcode confirmed)
BISSELL Little Green Multi-Purpose Portable Carpet Cleaner, 1400B | Mu
parent B0HRB3VP1Z gtin 011120007503 058342001681 mpn 1400B
#30 in Home & Kitchen 4 variant ASINs
https://www.walmart.com/ip/Instant-Pot-Duo-6 -> B00FLYWNYQ (barcode confirmed (GTIN 810028585201))
Instant Pot Duo 6 Qt 7-in-1 Electric Pressure Cooker, Stainless Steel
parent B0GXKV5FHP gtin 810028585201 mpn DUO 60
#103 in Kitchen & Dining 2 variant ASINs
All four lookups found their ASIN. The UPC of the Bissell led to B0016HF5GK, and the page confirmed the barcode. The Walmart link for the Instant Pot carried GTIN 810028585201; the script searched Amazon for it and landed on B00FLYWNYQ, the same ASIN the Amazon link gave on the line above. That is a Walmart item matched to its Amazon listing with no human in the loop, through the barcode both stores show.
The CSV has the input, how it was matched, the ASIN, parent ASIN, title, brand, GTINs, part number, Best Sellers Rank, variant ASINs, product link and read time for every row. To look up more products, add lines to lookups.txt. An ASIN or Amazon link costs 1 credit, a barcode 6 and another store's link 7, so the 200 free credits cover 200 ASIN reads or 33 barcodes.
How do you find ASINs from a keyword?
When you have a product name but no link or barcode, search. A search for "keurig k-mini" on amazon.com on 16 November 2026 at 23:43 UTC returned ten organic results, each with its ASIN in the link. The first five:
| # | ASIN | Title (shortened) | Price | Reviews |
|---|---|---|---|---|
| 1 | B0FMTSRKYL | Keurig K-Mini Mate, Black | $49.99 | 5,100 |
| 2 | B07GV2S1GS | Keurig K-Mini, 6 to 12oz Brew size | $69.35 | 116,100 |
| 3 | B0FMSTSYL7 | Keurig K-Mini Mate, Glamping Green | $49.99 | 5,100 |
| 4 | B09715G57M | Keurig K-Express, Black | $59.99 | 53,100 |
| 5 | B0CT43D46H | Keurig K-Express, Warm Stone | $59.99 | 53,100 |
The K-Mini itself was second. First was the K-Mini Mate, a different model with a similar name. A keyword search gives you candidates, not answers: take the ASINs you want and confirm each with a product read, comparing the brand and part number. For the K-Mini, the read returned mpn K-Mini, which settles it.
How do you look up an ASIN from an AI agent?
If you work in Claude, ChatGPT, Cursor or another agent that supports MCP, you do not need the script. After the setup line above, ask in plain language:
Use datawebot to find the Amazon ASIN for UPC 011120007503 and for
https://www.walmart.com/ip/Instant-Pot-Duo-6-Qt-Electric-Pressure-Cooker-7-in-1-with-Easy-Release-Steam-Switch-Slow-Cooker-Rice-Cooker-Steamer-and-More/575389962
Give me the ASIN, parent ASIN, brand and part number, and check that
each one is the same product.
The agent calls search_products with site set to amazon.com and get_product to read and confirm each result. It gets the same JSON as the REST API, so you can try a lookup in an agent first and move it to a script later without changing what you get. The MCP server page lists every tool and how to connect each client.
What should you check in an ASIN lookup?
The runs above show five things to check, whichever tool you use:
- Child or parent.
B07GV2S1GSis one color;B0D7NQ64H4is the group of six. Prices and stock belong to the child. Store both, and link to the child. - Confirm barcode matches. A barcode search returned bundles and a related listing next to the right product. Read the result and check that its identifiers include your barcode before you trust it.
- When there is no barcode, check brand and part number. The K-Mini page lists no GTIN, but it does list brand Keurig and part number K-Mini. Those two fields confirm a match when a barcode cannot.
- One product can carry several GTINs. The Bissell 1400B lists two. Match on any of them, not on the whole list.
- Ranks and prices are snapshots. Best Sellers Rank and price are what the page showed at
meta.as_of. The ASIN stays the same; the rank does not. Store the read time with every row.
How do you choose an ASIN lookup tool?
Use this checklist when you compare tools:
| Question | Why it matters |
|---|---|
| Does it take a list, not just one product at a time? | Most real lookups come from a spreadsheet or catalog |
| Does it accept UPC and EAN barcodes? | Your own catalog and other stores use barcodes, not ASINs |
| Does it return the parent ASIN and every variant's ASIN? | One lookup should give you all sizes and colors |
| Does it return the GTIN and part number from the page? | They are how you confirm a match |
| Is every answer labelled with the time it was read? | Ranks and prices change; the ASIN does not |
| Are failed requests free? | You should not pay for a page that did not load |
| Can an AI agent call it, not only your code? | MCP support lets you try a lookup before writing code |
What does it cost?
A product read costs 1 credit and a search 5 credits a page. Failed requests are free; a page that loads but has no results is still charged. Every account starts with 200 free credits. More credits are one-time packs with no subscription, listed on the pricing page. The Amazon endpoint page has an example request for each endpoint, and our Amazon scraper guide goes deeper into the fields an Amazon read returns. To match products that have no barcode at all, see our guide to product matching.
Need this at volume?
If you need ASINs for thousands of products, or a catalog matched to Amazon on a schedule, send a volume request and we will size it in credits. Our published samples show the result format.
Frequently asked questions
What is an ASIN lookup?
Finding the Amazon Standard Identification Number of a product, the 10-character code Amazon gives every item, from something else you have: a product link, a UPC or EAN barcode, a product name, or the same item's page in another store. A good lookup also returns the parent ASIN, the GTIN and the brand, so you can confirm the match.
How do I find the ASIN of a product on Amazon?
Look at the product link: the ASIN is the 10 characters after /dp/. It is also listed in the product details on the page. For many products at once, send each link or ASIN to a product read, as the script in this guide does for 1 credit each.
How do I convert a UPC to an ASIN?
Search Amazon for the UPC number, read the first result and check that its page lists the same barcode. In our run, UPC 810028585201 led to B00FLYWNYQ, the Instant Pot Duo 6-quart, and the page confirmed it. The script in this guide does this for every barcode in a file.
What is the difference between an ASIN and a UPC?
A UPC is the barcode number a brand gets from GS1 and prints on the box; it is the same in every store. An ASIN is the code Amazon assigns to the product in its own catalog and exists only on Amazon. A product sold on Amazon can have both, and a product read returns both when the page shows them.
What is a parent ASIN?
The ASIN of the group that holds all variants of a product, such as every color of the Keurig K-Mini under B0D7NQ64H4. Each variant has its own child ASIN, and the child is what a shopper buys. A product read returns the parent ASIN and every child ASIN in one answer.
Can I look up ASINs in bulk?
Yes. Put the ASINs, links or barcodes in a text file, one per line, and run the script in this guide. It saves every result to a CSV. At volume, send a list and we will size it in credits.
Is there a free ASIN lookup tool?
You can start free: every datawebot account gets 200 free credits with no card, enough for 200 ASIN reads or 33 barcode lookups. After that, credits are one-time packs with no subscription.
Sources
- https://www.datawebot.com/llms.txt
- https://mcp.datawebot.com/setup.md
- https://www.datawebot.com/scraper/amazon
- https://www.datawebot.com/solutions/amazon-product-data-api
- https://knowledge.plytix.com/glossary/amazon-standard-identification-number-asin/
- https://www.gs1.org/standards/id-keys/gtin
- https://www.gs1us.org/upcs-barcodes-prefixes/what-is-a-gtin
- https://docs.python.org/3/library/csv.html
- https://docs.python.org/3/library/urllib.request.html
- https://modelcontextprotocol.io/specification/2025-06-18/server/tools
Read Amazon search results and product pages as JSON.
Every account starts with 200 free credits, with no subscription: a search costs 5 credits and a product read 1. Failed requests are free.