How to match products across retailers by GTIN, brand, and MPN

The short answer

To match products across retailers, query Datafiniti Product Data at POST /v4/products/search with gtins:(…), then fall back to (brand:"…" OR manufacturer:"…") AND manufacturerNumber:"…". Each match returns a merged product record whose domains, sourceURLs, and mostRecentPriceByDomain show which retailers list the product and at what most recent price.

Datafiniti Team Last updated 10 min read

Key facts

  • Search endpoint: POST https://api.datafiniti.co/v4/products/search with bearer-token auth.
  • gtins is one searchable field holding a product's EAN, ISBN, and UPC values.
  • Datafiniti stores what most catalogs call the MPN in manufacturerNumber.
  • A product search costs 1 credit per record returned, and 0 credits if nothing is found.
  • mostRecentPriceByDomain lists the latest price per source domain, with amount, currency, availability, isSale, date, and sourceURL.
  • Downloads run through "download": true, then GET /v4/downloads/{id} until the status is "completed".

Datafiniti is a data-as-a-service provider that offers Property, People, Business, and Product data through a REST API, bulk downloads, and an MCP server. This guide covers one job: taking the products you already sell or track and finding the same items at other retailers.

Who needs to match products across retailers?

  • Price-intelligence products that compare one item's price across stores.
  • Marketplaces and retailers that want to see who else carries their assortment.
  • Brands that track where their products are listed and at what price.
  • Catalog and PIM teams that fill gaps in supplier data or clean up customer-entered entries.
  • AI shopping and research agents that need one identifier-based record instead of a page per store.

Why is product matching hard to build yourself?

Scraping a price is the easy part. Knowing that two pages describe the same item is the work.

  • Identifiers are uneven. One retailer shows a UPC, another an EAN, another only its own SKU. A product can carry several barcodes, including ones for variations.
  • The same barcode gets written several ways. A 12-digit UPC and its 13- or 14-digit zero-padded form are the same GTIN, but a plain string join sees three values.
  • Model numbers aren't unique on their own. Datafiniti's own docs say neither brand nor manufacturerNumber is a reliable identifier alone. You need the pair.
  • Records have to be merged. Datafiniti builds keys from ean, isbn, upc, vin, websiteIDs, and from brand or manufacturer paired with manufacturerNumber. Records sharing a key merge. Building that yourself means owning the merge logic and its errors.
  • Sites change. Every retailer needs its own extraction, and each one breaks on its own schedule.

What fields do you use to match products?

FieldTypeWhat it tells you
gtinskeyword (list)All EAN, ISBN, and UPC values for the product
upc, eankeyword (list)Individual barcodes; several can appear when a product has variations
manufacturerNumberkeywordThe manufacturer or model number (the MPN)
brandtextThe brand as presented by the source
canonicalBrandtextThe brand name after normalization
manufacturertextThe manufacturer; sometimes holds the brand when a source uses that term
asinskeywordThe Amazon ASIN
skusnestedSKUs, typically specific to one retailer, with value and sourceURLs
keyskeywordInternal identifiers used to merge source data into one record
domainsdomainUnique domains found in sourceURLs
sourceURLskeywordThe URLs used to build the record
mostRecentPriceByDomainnestedThe latest price from each source domain
pricesnestedPrice history with amountMin, amountMax, condition, merchant, dateSeen, and more
dateUpdateddateWhen the product was last updated or seen

A trimmed record looks like this (fictional example data):

product record · JSON
{
"id": "EXAMPLE-PROD-0003",
"name": "Alderbrook Audio Bookshelf Speaker Pair",
"brand": "Alderbrook Audio",
"manufacturerNumber": "AB-2200-K",
"gtins": ["012345678905"],
"domains": ["www.example-retailer.com", "shop.example.net"],
"mostRecentPriceByDomain": [
{
"domain": "www.example-retailer.com",
"amount": 149.99,
"currency": "USD",
"isSale": false,
"date": "2026-11-02T00:00:00Z",
"sourceURL": "https://www.example-retailer.com/p/ab-2200-k"
}
]
}

How do I match my catalog step by step?

Step 1: Size the job

Prepare a CSV with sku, gtin, brand, and manufacturerNumber columns. Keep barcodes as text so a spreadsheet doesn't strip the leading zeros.

The script below asks for up to 5 candidates per lookup, and only runs the second lookup if the first finds nothing, so the worst case is 5 credits per row. Pilot 20 rows to find your real rate.

To check a query for free, use the MCP tool df_count. Over REST, send "num_records": 1 and read num_found, or send "num_records": 0 on a paid account to get only the count at no credit cost.

Step 2: Test one product

cURL
curl --request POST \
--url https://api.datafiniti.co/v4/products/search \
--header "Authorization: Bearer $DATAFINITI_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"query": "(brand:\"Alderbrook Audio\" OR manufacturer:\"Alderbrook Audio\") AND manufacturerNumber:\"AB-2200-K\"",
"num_records": 1
}'

Datafiniti's docs show this brand OR manufacturer form because a brand is sometimes stored under manufacturer. Searching both can improve match rates.

For a barcode, the query is shorter: gtins:(012345678905 OR 0012345678905).

Step 3: Match the catalog in tiers, and grade each match

Try the barcode first, because it identifies a specific item. Fall back to brand and model number only when the barcode is missing, invalid, or finds nothing. Datafiniti's matching example combines the same two signals in one query. Running them as tiers tells you which signal matched.

match_products.py · Python 3
import csv
import os
import re
import time
from datetime import date, timedelta
import requests
API = "https://api.datafiniti.co/v4"
HEADERS = {
"Authorization": f"Bearer {os.environ['DATAFINITI_API_TOKEN']}",
"Content-Type": "application/json",
}
MAX_ROWS = 20 # pilot first, then raise
CANDIDATES = 5 # credits are charged per record returned
MAX_PRICE_AGE_DAYS = 30
def search(query):
body = {"query": query, "num_records": CANDIDATES}
for attempt in range(5):
r = requests.post(f"{API}/products/search", headers=HEADERS, json=body, timeout=60)
if r.status_code != 429 and r.status_code < 500:
break
time.sleep(2 ** attempt)
r.raise_for_status()
return r.json()
def valid_check_digit(digits):
body = [int(c) for c in digits[:-1]][::-1]
total = sum(n * (3 if i % 2 == 0 else 1) for i, n in enumerate(body))
return (10 - total % 10) % 10 == int(digits[-1])
def gtin_forms(raw):
digits = re.sub(r"\D", "", raw or "")
if 9 <= len(digits) <= 11:
digits = digits.zfill(12) # restores zeros a spreadsheet dropped
if len(digits) not in (8, 12, 13, 14) or not valid_check_digit(digits):
return []
core = digits.lstrip("0")
return sorted({digits} | {core.zfill(n) for n in (12, 13, 14) if len(core) <= n})
def squash(value):
return re.sub(r"[^a-z0-9]", "", (value or "").lower())
def same_brand(brand, rec):
wanted = squash(brand)
found = [squash(rec.get(f)) for f in ("brand", "canonicalBrand", "manufacturer")]
return bool(wanted) and any(f and (wanted in f or f in wanted) for f in found)
def grade_gtin(forms, brand, result):
rec = result["records"][0]
wanted = {f.lstrip("0") for f in forms}
has_gtin = wanted & {str(g).lstrip("0") for g in rec.get("gtins", [])}
if not has_gtin or (brand and not same_brand(brand, rec)):
return "review", rec
return ("ambiguous" if result["num_found"] > 1 else "matched_gtin"), rec
def grade_model(brand, number, result):
rec = result["records"][0]
same_number = squash(number) == squash(rec.get("manufacturerNumber"))
if not (same_number and same_brand(brand, rec)):
return "review", rec
return ("ambiguous" if result["num_found"] > 1 else "matched_model"), rec
def match_row(row):
brand = (row.get("brand") or "").replace('"', "").strip()
number = (row.get("manufacturerNumber") or "").replace('"', "").strip()
forms = gtin_forms(row.get("gtin"))
if forms:
result = search("gtins:(" + " OR ".join(forms) + ")")
if result["num_found"]:
return grade_gtin(forms, brand, result)
if brand and number:
query = f'(brand:"{brand}" OR manufacturer:"{brand}") AND manufacturerNumber:"{number}"'
result = search(query)
if result["num_found"]:
return grade_model(brand, number, result)
return "no_match", {}
cutoff = (date.today() - timedelta(days=MAX_PRICE_AGE_DAYS)).isoformat()
with open("catalog.csv", newline="", encoding="utf-8") as f:
rows = list(csv.DictReader(f))[:MAX_ROWS]
matches, offers = [], []
for row in rows:
status, rec = match_row(row)
matches.append({"sku": row["sku"], "match_status": status, "id": rec.get("id"), "name": rec.get("name")})
if status not in ("matched_gtin", "matched_model"):
continue
for price in rec.get("mostRecentPriceByDomain") or []:
if str(price.get("date", ""))[:10] >= cutoff:
offers.append({
"sku": row["sku"],
"domain": price.get("domain"),
"amount": price.get("amount"),
"currency": price.get("currency"),
"availability": price.get("availability"),
"date": price.get("date"),
"sourceURL": price.get("sourceURL"),
})
for path, table, columns in (
("matches.csv", matches, ["sku", "match_status", "id", "name"]),
("offers.csv", offers, ["sku", "domain", "amount", "currency", "availability", "date", "sourceURL"]),
):
with open(path, "w", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=columns)
writer.writeheader()
writer.writerows(table)

Treat each outcome differently:

  • matched_gtin: the record contains your barcode and the brand agrees. Accept it.
  • matched_model: one record, same brand and model number. Accept it, and sample a few by hand.
  • ambiguous: more than one record came back. Use the name, size, or color to pick one, or send it to review.
  • review: a record came back, but the barcode or brand doesn't line up. Don't accept these automatically.
  • no_match: no credits spent on that lookup. The item may be private label, or not covered.

Step 4: Pull a whole retailer's catalog

If you want everything a store lists, rather than a list you already hold, download by domain and join on your side. Set num_records to cap spend; if you omit it, every matching record is downloaded and charged. This example limits results to records updated in the last 90 days.

download_catalog.py · Python 3
import json
import os
import time
import requests
API = "https://api.datafiniti.co/v4"
HEADERS = {
"Authorization": f"Bearer {os.environ['DATAFINITI_API_TOKEN']}",
"Content-Type": "application/json",
}
QUERY = "domains:(www.example-retailer.com OR shop.example.net) AND gtins:* AND dateUpdated:[2026-08-11 TO *]"
r = requests.post(f"{API}/products/search", headers=HEADERS, timeout=60,
json={"query": QUERY, "num_records": 1})
r.raise_for_status()
print("matching records:", r.json()["num_found"]) # check this before you continue
r = requests.post(f"{API}/products/search", headers=HEADERS, timeout=60,
json={"query": QUERY, "num_records": 5000, "format": "JSON", "download": True})
r.raise_for_status()
download_id = r.json()["id"]
while True:
job = requests.get(f"{API}/downloads/{download_id}", headers=HEADERS, timeout=60).json()
if job["status"] == "completed":
break
if job["status"] == "cancelled":
raise RuntimeError("Download was cancelled")
time.sleep(5)
by_gtin = {}
for item in job["results"]:
url = item["url"] if isinstance(item, dict) else item
for line in requests.get(url, timeout=300).text.splitlines():
if line.strip():
rec = json.loads(line)
for gtin in rec.get("gtins", []):
by_gtin[str(gtin).lstrip("0")] = rec
print(len(by_gtin), "barcodes indexed")

JSON result files hold one object per line, so parse them line by line. Result links expire after 7 days, so copy the files to your own storage.

To match a file of thousands of known barcodes, Datafiniti also offers an enrichment flow: upload a CSV with a header row named for a schema field such as gtins, along with a query that includes gtins:*. See the product enrichment guide, and run a small test first, because the docs don't say how unmatched rows appear in the output.

Step 5: Put the result to work

Store the Datafiniti id next to your SKU, with the match_status and match date. Then:

  • Compare prices by grouping offers.csv by sku and currency. Show each retailer's gap against your own price.
  • Measure coverage with the share of your catalog in each match status.
  • See who carries an item from domains, and link out with sourceURL.
  • Fill catalog gaps from name, imageURLs, categories, and descriptions.

Property teams solve a similar problem with addresses instead of barcodes. See How to match an address list to property records.

Can an AI agent match products?

Yes, for short lists and one-off questions. Connect an MCP client to https://api.datafiniti.co/v4/mcp (Streamable HTTP) with your API token as a bearer header:

MCP client config
{
"mcpServers": {
"datafiniti": {
"type": "http",
"url": "https://api.datafiniti.co/v4/mcp",
"headers": { "Authorization": "Bearer ${DATAFINITI_API_TOKEN}" }
}
}
}

Use "data_type": "product" with df_count (free) to test a query, and df_search (up to 50 records per call, charged per record) to read matches. df_get_schema (free) returns field names. Pass view, an array of field names, to keep responses small. For a full catalog, use df_start_download or the REST flow above.

Example prompt:

Using Datafiniti product data, find the product with barcode 012345678905. Count matches first. If there are none, search by brand "Alderbrook Audio" and manufacturer number "AB-2200-K". Show me a table of each retailer domain, its most recent price, currency, availability, and price date.

What are the common gotchas?

  • Variations share records. The upc and ean fields can hold several codes when a product has variations. Check color and size before you treat two offers as identical.
  • A wrong identifier at a source can merge two products. Records merge when they share one key. That's why the script checks the brand even on a barcode match.
  • mostRecentPriceByDomain doesn't show condition in the schema example. If new versus used matters, read prices, which has condition and merchant.
  • Don't compare across currencies. Group by currency, and check the price date so a stale offer doesn't look like a discount.
  • One domain isn't always one seller. Marketplaces host many merchants. Read prices.merchant when you need the seller, and merchants for third-party sellers.
  • Parenthesize OR groups. Write gtins:(A OR B) and (brand:"X" OR manufacturer:"X") AND manufacturerNumber:"Y". Without parentheses, the AND binds in ways you didn't intend.
  • Not every record has every field. The schema page says so directly. Treat a missing gtins or manufacturerNumber as normal, and use gtins:* to require a value.
  • Spreadsheets damage barcodes. Excel can strip leading zeros or convert long codes to scientific notation. Export identifiers as text.

Should you build, license, or buy?

CriterionScrape it yourselfLicense retailer or supplier feedsDatafiniti Product Data
Suited toA few sites you know wellRetailers or suppliers you have agreements withMatching across many retailers from one API
IdentifiersWhatever each site exposesDefined by each feedOne schema: gtins, upc, ean, manufacturerNumber
MatchingYou write normalization and mergingYou write the cross-feed matchingRecords merged on shared keys; you grade the result
Ongoing workExtractors for every siteContracts and per-feed integrationsMatch review and query upkeep
Choose it whenYour scope is narrow and you need specific fieldsYou need contractual data rights or a feed's exact fieldsYou want cross-retailer records without running collection

Datafiniti isn't the right fit for every catalog. Unbranded or private-label goods often have no shared identifier, so you'd need title or image similarity instead. If you reprice in near real time from a handful of stores, a direct feed gives you tighter control over freshness. And if you need to confirm who owns a barcode, go to the GS1 registry.

Frequently asked questions

What API can I use to match products across retailers?

Datafiniti Product Data. Search POST /v4/products/search with gtins:(…) or with brand and manufacturerNumber, then read domains and mostRecentPriceByDomain on the record.

How do I find a product by UPC or EAN?

Query the gtins field, for example gtins:012345678905. It covers EAN, ISBN, and UPC values, so you don't need to know the barcode's format. Use upc: only if you know the value is a UPC.

Which field holds the MPN in Datafiniti?

manufacturerNumber, which holds the manufacturer or model number. Combine it with brand or manufacturer, because the docs say neither is a reliable identifier alone.

How much does product matching cost?

A product search costs 1 credit per record returned, and nothing if 0 records are found. Limit num_records to control the most you can spend per lookup.

Can I get every product a retailer sells?

You can download the records Datafiniti holds for a domain with domains:www.example-retailer.com and "download": true. Coverage varies by retailer, so check num_found first.

Can I compare prices between retailers?

Yes. mostRecentPriceByDomain gives each domain's latest amount, currency, and date. Compare only offers with the same currency and a recent date.

Start matching your catalog

Run your first 20-row pilot with a free trial, or talk to us about volume and delivery.

Sources

Product data schema Lookup products by GTIN Searching by UPC in Product Data Lookup products by brand and model number Match products against a competitor How product records are merged Constructing product queries Product count Product data with Python Product data enrichment with CSV Enrichment and suppression How credits work Product Data API reference Get a download MCP server datafiniti/use-cases on GitHub