UPC Scraping: How to Extract UPC, EAN and GTIN Codes From Ecommerce Sites

By Nikolai Kekish, 20+ years in ecommerce data extraction · Updated November 2026

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?

CodeDigitsUsed for
UPC (UPC-A)12Products sold mainly in the US and Canada
EAN (EAN-13)13Products sold in Europe and most other countries
GTIN8, 12, 13 or 14The umbrella term for UPC, EAN and other GS1 codes; in structured data you see gtin12, gtin13 or gtin14
MPNVariesManufacturer 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

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:

  1. Structured data (schema.org JSON-LD): fields such as gtin12, gtin13 or gtin in the Product markup.
  2. Embedded JSON: product data objects that the site's JavaScript uses to render the page.
  3. Specifications table: a visible "UPC" or "EAN" row in the product details.
  4. 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.

Walgreens product page with the UPC field highlighted for scraping

Walmart

For Walmart you can extract the UPC and also the MPN and product dimensions.

Walmart product page with the UPC field highlighted Walmart product specifications with MPN and dimensions

B&H Photo Video

B&H includes the UPC in the HTML and JSON of the product page.

B&H Photo Video product page with UPC in the page data

Other sites with UPCs in product data

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:

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.

AI

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.