UPC Scraping: How to Extract UPC, EAN and GTIN Codes From Ecommerce Sites
A UPC (Universal Product Code) is the 12-digit barcode number that identifies a product across retailers. Scraping UPCs together with prices and product data lets you match the same item on different websites with certainty, which makes price monitoring, catalog enrichment and marketplace listing much more reliable than matching by product title.
UPC, EAN, GTIN and MPN: What Is the Difference?
| Code | Digits | Used for |
|---|---|---|
| UPC (UPC-A) | 12 | Products sold mainly in the US and Canada |
| EAN (EAN-13) | 13 | Products sold in Europe and most other countries |
| GTIN | 8, 12, 13 or 14 | The umbrella term for UPC, EAN and other GS1 codes; in structured data you see gtin12, gtin13 or gtin14 |
| MPN | Varies | Manufacturer part number; not a barcode, but useful for matching electronics and parts |
A UPC can be turned into an EAN by adding a leading zero, so for matching it is best to normalize all codes to 13 or 14 digits.
Why Scrape UPC Codes
- Exact product matching between your catalog and competitors for price monitoring.
- Marketplace listings: Amazon, Walmart and other marketplaces require a valid GTIN for most product categories.
- Catalog enrichment: fill descriptions, images and attributes for products you already have by barcode.
- Deduplication: find the same product listed under different names in supplier feeds.
Where UPCs Hide on a Product Page
UPCs are often not visible to shoppers but are still present in the page code. A scraper looks in several places:
- Structured data (schema.org JSON-LD): fields such as
gtin12,gtin13orgtinin the Product markup. - Embedded JSON: product data objects that the site's JavaScript uses to render the page.
- Specifications table: a visible "UPC" or "EAN" row in the product details.
- Variant data: on products with sizes or colors each variant has its own UPC, so the scraper has to read all variants, not only the default one.
Examples: Retailers That Publish UPCs
Walgreens
Walgreens shows the UPC in the product data, so it is easy to extract together with price and availability.
Walmart
For Walmart you can extract the UPC and also the MPN and product dimensions.
B&H Photo Video
B&H includes the UPC in the HTML and JSON of the product page.
Other sites with UPCs in product data
- 6pm.com - UPC in the page HTML and JSON
- BJ's Wholesale (bjs.com)
- Farnell (farnell.com) - also manufacturer part numbers
- Home Depot (homedepot.com)
- Lowe's (lowes.com)
Websites change their markup over time, so before a large project we always check where the code is published on each target site today.
Validate Scraped UPCs
Scraped codes sometimes contain errors: missing leading zeros, internal SKUs in the GTIN field or placeholder values. Validate every code before using it:
- Check the length (12 for UPC, 13 for EAN) and that it contains digits only.
- Verify the check digit, the last digit calculated from the others with the GS1 algorithm.
- Normalize to GTIN-14 by padding with leading zeros so UPC and EAN versions of the same product match.
- Flag codes shared by many different products; they are usually placeholders.
UPC Product Scraping Service
We collect UPC, EAN and MPN codes together with prices, stock, images and specifications from the retailers you choose, validate them and deliver the data as Excel, CSV, JSON, XML or an API. For matching your own catalog, send us your list of UPCs and we will look the products up on the target websites.
Have a scraping or integration task? Let our AI solve it.
Describe what data you need or which systems to connect — our AI builds and runs the scraper or integration for you. No coding required.
Free for 14 days, no card needed · already have an account?
Frequently Asked Questions
Can every website be scraped for UPC codes?
No. Only websites that publish the code in the page, its structured data or embedded JSON. Many large US retailers do; some marketplaces hide it. We check each target site before starting.
Is UPC the same as EAN?
They are both GTIN barcodes. A UPC has 12 digits and an EAN has 13; adding a leading zero turns a UPC into the equivalent EAN.
Can you find products by my list of UPCs?
Yes. Send us your UPC list and the target websites, and we will search them and return the matching products with prices, stock and other fields.
How do you make sure scraped UPCs are correct?
We check the length and digits, verify the GS1 check digit, normalize codes to GTIN-14 and flag codes that repeat across different products.
Request UPC Product Scraping
Send the target websites, your UPC list if you have one, and the fields you need. We will check where each site publishes the codes and send a sample.