Skip to content
Products
Developers & lookup

UPC API

Send a UPC code and get the product behind it as JSON: the name, and the brand, category, description and image where we have them. 100 found lookups a month are free, with no card.

curl "https://barcodereport.com/api/v2/products/038000001277" -H "X-API-Key: YOUR_API_KEY"

A UPC we do not have costs nothing. Checking a number's format is free and needs no key.

What a UPC API does

A UPC API takes the 12-digit number printed under a barcode and returns the product it belongs to, in a form your software can read. Scanner apps, point-of-sale systems, inventory tools and marketplace listing tools use one to turn a scan into a product name without anyone typing it.

Ours is one REST endpoint that answers in JSON. The same endpoint also takes EAN, GTIN and ISBN numbers, so an app that scans imported goods or books needs no second integration. For books, see the ISBN API; for everything in one place, the Barcode Lookup API overview.

One request, one product

curl "https://barcodereport.com/api/v2/products/038000001277" \
  -H "X-API-Key: YOUR_API_KEY"

The answer, shortened here where marked with an ellipsis:

{
    "found": true,
    "requested": "038000001277",
    "barcode": {
        "type": "UPC-A",
        "check_digit_valid": true,
        "upc_a": "038000001277",
        "upc_e": "03812707",
        "ean_13": "0038000001277",
        "gtin_14": "00038000001277",
        "prefix": {
            "range": "000-019",
            "label": "United States and Canada",
            "iso": "US"
        },
        "…": "…",
        "record_barcode": "038000001277",
        "match": "exact"
    },
    "product": {
        "title": "Kellogg's cereal corn flakes 24oz",
        "brand": "Kellogg's",
        "brand_source": "enrichment",
        "category": "Processed Cereal Products",
        "category_path": [
            "Processed Cereal Products"
        ],
        "description": "Ingredients: Milled corn, sugar, malt flavor, contains 2% or less of salt. …",
        "image_url": "https://images.openfoodfacts.org/images/products/003/800/000/1277/front_en.3.400.jpg",
        "quantity": "42.0 GRM",
        "model_number": null,
        "color": null,
        "size": null,
        "weight": null,
        "dimensions": null,
        "price": null,
        "asin": null,
        "url": null
    },
    "book": null,
    "media": null,
    "sources": [
        "usda_fdc",
        "openfoodfacts"
    ],
    "attribution": "Product data from Open Food Facts (Open Database License)"
}

A blank is always null, never an empty string. When attribution is filled, the record includes open data and that line should be shown with it.

What comes back for a UPC

Every record has a product title. The other fields are filled where we have them, and it is better to know how often before you build on them. These shares come from a random sample of 13,000 of our US and Canada records, taken in December 2026:

TitleEvery record.
BrandAbout one record in four.
CategoryAbout one in five, also split into category_path.
DescriptionAbout one in five.
Image linkAbout one in twelve. The link points to a picture hosted elsewhere; we do not host images.
Amazon ASINOn more than 16 million records. The ASIN to UPC converter uses the same data.
The number itselfAlways: type, whether the check digit is right, where the prefix was issued, and the same number as UPC-A, UPC-E, EAN-13 and GTIN-14.

Popular retail products tend to have fuller records than the average, and private-label or very new items thinner ones. To see what you would get for your own products, send up to 1,000 of your codes to the free coverage test. It returns how many are on record and how often each field is filled, and uses no lookups.

UPC forms it reads

  • UPC-A, the usual 12 digits, with or without spaces and dashes.
  • UPC-E, the 8-digit short code on cans and small packs. It is expanded to its UPC-A.
  • 11 digits, a UPC-A whose leading zero a spreadsheet dropped, when the restored number checks out.
  • EAN-13 and GTIN-14. A UPC with a zero in front is its EAN-13, and a case code leads to the item inside when the case has no record of its own.

UPCs that start with 2 or 4 are assigned by each shop for weighed goods and in-store labels. The answer marks them as restricted, because no database can resolve them reliably.

Code samples

Authenticate with an X-API-Key header (or Authorization: Bearer). A found product returns 200; a UPC we do not have returns 404 with "code": "not_found".

Python

import requests

API_KEY = "YOUR_API_KEY"

def lookup(code):
    r = requests.get(
        "https://barcodereport.com/api/v2/products/" + code,
        headers={"X-API-Key": API_KEY},
        timeout=10,
    )
    if r.status_code == 404:
        return None        # not on record; this call was free
    r.raise_for_status()
    return r.json()

item = lookup("038000001277")
if item:
    print(item["product"]["title"], "|", item["product"]["brand"])

JavaScript (Node 18 or later, or the browser)

const API_KEY = process.env.BARCODE_API_KEY;

async function lookup(code) {
  const res = await fetch("https://barcodereport.com/api/v2/products/" + encodeURIComponent(code), {
    headers: { "X-API-Key": API_KEY },
  });
  if (res.status === 404) return null;   // not on record; this call was free
  if (!res.ok) throw new Error("Lookup failed: " + res.status);
  return res.json();
}

const item = await lookup("038000001277");
if (item) console.log(item.product.title, "|", item.product.brand);

PHP

function lookup(string $code): ?array
{
    $ch = curl_init("https://barcodereport.com/api/v2/products/" . rawurlencode($code));
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => ["X-API-Key: " . getenv("BARCODE_API_KEY")],
        CURLOPT_TIMEOUT => 10,
    ]);
    $body = curl_exec($ch);
    $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if ($status === 404) return null;      // not on record; this call was free
    if ($status !== 200) throw new RuntimeException("Lookup failed: $status");
    return json_decode($body, true);
}

$item = lookup("038000001277");
if ($item) echo $item["product"]["title"], " | ", $item["product"]["brand"], PHP_EOL;

A list of UPCs in one request

Send up to 100 codes at once. Each code that is found uses one lookup, and the whole batch counts as one request against the rate limit.

curl -X POST "https://barcodereport.com/api/v2/products" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"barcodes": ["038000001277", "049000050103", "883904306832"]}'

For a spreadsheet rather than code, bulk barcode lookup takes a file of up to 100,000 codes, and the Google Sheets function fills in a column for you.

Other requests

GET /api/v2/search?q=Find products, and their UPCs, by name, brand or category. One lookup per call that returns results.
GET /api/v2/products/asin/{asin}The products sold under an Amazon ASIN, each with its UPC or EAN. Free when nothing is found.
GET /api/v2/validate/{code}What a number itself says: type, check digit, other forms. Free, no key.
POST /api/v2/coverageHow many of your own codes are on record and how complete those records are. Free, counts only.

The full reference, with every field and error code, is in the API documentation. AI assistants can use the same data through the MCP server.

What it costs

You pay for products that are found. A UPC with no record, a malformed number and a format check all cost nothing.

Free100 found lookups a month, 60 requests a minute. $0, no card.
Standard Plan10,000 found lookups a month, 300 requests a minute. $24.95 a month.
Premium Plan50,000 found lookups a month, 600 requests a minute. $74.95 a month.
Professional Plan100,000 found lookups a month, 1,200 requests a minute. $99.99 a month.
Enterprise Plan200,000 found lookups a month, 2,400 requests a minute. $199.00 a month.

Plans can be paid monthly or yearly; see pricing for the details.

UPC API FAQ

Is there a free UPC API?

Yes. The free plan includes 100 found lookups a month at up to 60 requests a minute, with no card, on the same endpoints as the paid plans. A UPC that is not on record does not use a lookup, and checking a number's format and check digit is free and needs no key.

What does the UPC API return?

Every record has a product title. Brand, category, description, an image link, quantity, size, the lowest price seen and the Amazon ASIN are returned where we have them. In a sample of our US and Canada records taken in December 2026, about one in four had a brand, about one in five a category or a description, and about one in twelve an image link.

Does it read UPC-E and EAN-13 codes?

Yes. Send a 12-digit UPC-A, an 8-digit UPC-E, the same number as a 13-digit EAN-13 with a zero in front, or the 14-digit case code. They all lead to the same record, and the answer lists the number in every form.

How many UPC codes does it cover?

The database holds more than 500 million barcode records, of which more than 200 million are UPCs issued in the United States and Canada. What matters is your own range: the free coverage test takes up to 1,000 of your codes and tells you how many are on record before you pay anything.

Am I charged for a UPC that is not found?

No. A code with no record returns 404 with the code not_found and does not use a lookup. The answer still says whether the number is well formed, so your app can tell a mistyped code from a product we do not have.

Can I find a UPC from a product name or an Amazon ASIN?

Yes. The search endpoint finds products by name, brand or category and returns their barcodes. The ASIN endpoint returns the products sold under an Amazon ASIN, each with its UPC or EAN.

What is the rate limit?

The free plan allows 60 requests a minute and paid plans allow more. A batch request carries up to 100 codes and counts as one request, so batching is the fastest way through a long list.