Skip to main content

Barcode symbology encyclopedia API client — look up UPC, EAN, Code 128, QR, Data Matrix formats, standards, and specifications from BarcodeFYI.

Project description

barcodefyi

PyPI version Python License: MIT

Barcode symbology encyclopedia API client for Python. Look up 50+ barcode formats across 1D linear, 2D matrix, stacked, and composite categories, 30+ international standards from ISO and GS1, anatomy components, check digit algorithms, and GS1 company prefixes from BarcodeFYI -- the comprehensive barcode reference with 518 records covering UPC, EAN, Code 128, QR Code, Data Matrix, PDF417, and every major symbology in commercial and industrial use.

Extracted from BarcodeFYI, a barcode symbology platform with 518 records spanning 50+ symbologies, 30+ standards, anatomy breakdowns, and industry-specific encoding guides used by supply chain engineers, retail systems developers, and industrial automation architects worldwide.

Explore barcodes at barcodefyi.com -- Symbology Explorer | Standards Reference | Anatomy Guide | GS1 Prefixes

barcodefyi demo -- barcode symbology lookup, comparison, and standard reference in Python

Table of Contents

Install

pip install barcodefyi[api]     # API client (httpx)
pip install barcodefyi[cli]     # + CLI (typer, rich)
pip install barcodefyi[mcp]     # + MCP server
pip install barcodefyi[all]     # Everything

Quick Start

from barcodefyi.api import BarcodeFYI

with BarcodeFYI() as api:
    # Search symbologies, standards, components, glossary
    results = api.search("upc")
    print(results)

    # Look up a specific symbology by slug
    upc = api.symbology("upc-a")
    print(upc["name"], upc["year_introduced"])  # UPC-A 1974

    # Compare two symbologies side-by-side
    diff = api.compare("upc-a", "ean-13")
    print(diff)

    # Discover a random symbology
    surprise = api.random()
    print(surprise["name"])

What You'll Find on BarcodeFYI

BarcodeFYI is a comprehensive barcode symbology encyclopedia covering 50+ formats across 1D linear, 2D matrix, stacked, and composite categories. Barcodes are machine-readable optical labels that encode data using patterns of bars, spaces, dots, or modules -- the foundation of supply chain management, retail checkout, healthcare tracking, and industrial automation worldwide.

1D Linear Symbologies

One-dimensional barcodes encode data in a single row of bars and spaces. They remain the dominant format in retail and logistics due to omnidirectional scanning, low print cost, and decades of infrastructure investment. Each symbology defines a specific character set, encoding density, and error detection mechanism.

Symbology Year Characters Density Primary Use
UPC-A 1974 12 numeric Low US/Canada retail checkout
UPC-E 1974 8 numeric (compressed) Low Small retail items
EAN-13 1977 13 numeric Low International retail (GTIN-13)
EAN-8 1977 8 numeric Low Small international products
Code 128 1981 Full ASCII (128 chars) High Shipping labels, GS1-128
Code 39 1974 43 alphanumeric Medium Government, defense (MIL-STD-1189)
Code 93 1982 Full ASCII High Logistics, postal
Interleaved 2 of 5 1972 Numeric pairs Medium Warehouse carton marking
Codabar 1972 16 characters Low Blood banks, FedEx airbills
MSI Plessey 1971 10 numeric Low Retail shelf marking

UPC-A structure: A 12-digit UPC-A barcode contains a number system digit (0=standard, 2=weighted items, 5=coupons), a 5-digit manufacturer code assigned by GS1 US, a 5-digit product code assigned by the manufacturer, and a Modulo 10 check digit. The barcode encodes these digits using three bar widths across 95 modules, flanked by start (101), center (01010), and stop (101) guard patterns.

EAN-13 structure: EAN-13 extends UPC-A with a leading country code digit encoded implicitly through the parity pattern of the left-side digits. GS1 country prefixes range from 000-019 (US/Canada) to 690-699 (China), 450-459 (Japan), and 880 (South Korea). The check digit uses the same Modulo 10 algorithm: alternate digits weighted 1 and 3, subtracted from the next multiple of 10.

Learn more: Symbology Explorer | Barcode Anatomy

2D Matrix Symbologies

Two-dimensional barcodes encode data in both horizontal and vertical dimensions, achieving dramatically higher data density. They use patterns of dark and light modules arranged in a matrix, with built-in error correction that allows reliable reading even when partially damaged or obscured.

Symbology Year Max Capacity Error Correction Primary Use
QR Code (Model 2) 1997 7,089 numeric Reed-Solomon (7-30%) Mobile apps, marketing, payments
Data Matrix (ECC 200) 1994 3,116 numeric Reed-Solomon Electronics, pharma serialization
Aztec Code 1995 3,832 numeric Reed-Solomon (5-95%) Boarding passes (BCBP), transit tickets
MaxiCode 1992 138 numeric Reed-Solomon UPS package sorting
PDF417 1991 2,710 numeric Reed-Solomon (1-512 cw) Driver licenses (AAMVA), shipping
Han Xin Code 2007 7,827 numeric Reed-Solomon Chinese logistics, government

Data Matrix is the dominant symbology for small-item marking in electronics manufacturing and pharmaceutical serialization. Its ECC 200 variant uses Reed-Solomon error correction with adjustable redundancy. The smallest Data Matrix symbol (10x10 modules) encodes 6 numeric or 3 alphanumeric characters, while the largest (144x144) holds 3,116 numeric characters.

Learn more: Standards Reference | Glossary

Stacked and Composite Symbologies

Stacked symbologies arrange multiple 1D barcode rows vertically to increase data density without requiring 2D imager hardware. Composite symbologies combine a 1D linear component with a 2D composite component (CC-A, CC-B, or CC-C) to link primary identification with supplementary data.

Symbology Type Rows Max Capacity Standard
PDF417 Stacked 3-90 2,710 numeric ISO 15438
Code 49 Stacked 2-8 49 alphanumeric USS Code 49
Codablock F Stacked 2-44 2,725 alphanumeric AIM USS
GS1 DataBar Composite Composite 1D + CC Varies ISO 24724
GS1-128 Composite Composite 1D + CC Varies ISO 24723

GS1 DataBar (formerly RSS -- Reduced Space Symbology) is designed specifically for point-of-sale scanning of small, difficult-to-mark items. Variants include Omnidirectional, Stacked, Limited, Expanded, and Truncated, each optimizing for different scanning environments and data requirements.

Learn more: GS1 Prefixes | Industry Applications

GS1 System and Company Prefixes

The GS1 system provides the global infrastructure for barcode identification through a hierarchical numbering scheme. GS1 assigns unique company prefixes that serve as the foundation for GTINs (Global Trade Item Numbers), SSCCs (Serial Shipping Container Codes), and GLNs (Global Location Numbers).

GS1 Prefix Range Assignment Coverage
000-019 GS1 US United States and Canada
020-029 Restricted distribution In-store use only
030-039 GS1 US (drugs) US pharmaceutical NDC/HRI
300-379 GS1 France France and overseas territories
400-440 GS1 Germany Germany
450-459 GS1 Japan Japan (also 490-499)
690-699 GS1 China China
880 GS1 South Korea South Korea
978-979 ISBN/ISMN Books and sheet music

A GS1 Company Prefix (GCP) typically ranges from 7 to 11 digits. Longer prefixes allow fewer unique product codes per company but cost less to license. For example, a 7-digit GCP allows up to 100,000 unique GTINs, while an 11-digit GCP allows only 10.

Learn more: GS1 Prefixes | Glossary

Barcode Anatomy

Every barcode consists of fundamental structural components that enable reliable machine reading. Understanding these components is essential for print quality optimization, scanner configuration, and troubleshooting read failures.

Component Function Critical For
Quiet Zone Mandatory whitespace margin (10x module for 1D) Scanner must distinguish barcode from background
Start/Stop Characters Format identification patterns Scanner identifies symbology type
Data Characters Encoded payload (bars/spaces/modules) Actual data content
Check Digit Error detection (Modulo 10, Modulo 43, etc.) Data integrity verification
Finder Patterns Orientation detection (2D only) Camera-based scanning alignment
Timing Patterns Module grid coordinate mapping (2D only) Accurate module sampling
Error Correction Reed-Solomon codewords (2D only) Damage recovery

Learn more: Anatomy Explorer | Check Digit Algorithms

Check Digit Algorithms

Barcode check digits detect transcription errors, substitution errors, and adjacent transposition errors. Different symbologies use different algorithms:

Algorithm Used By Detection Capability
Modulo 10 (Luhn variant) UPC-A, EAN-13, ITF-14 Single-digit errors, most transpositions
Modulo 43 Code 39 Single substitution errors
Modulo 103 Code 128 Single-digit and double-digit errors
Modulo 47 Code 93 Two check characters for higher reliability
Reed-Solomon QR Code, Data Matrix, PDF417 Burst errors, up to 30% damage recovery

Key Barcode Standards

Standard Organization Scope
ISO/IEC 15420 ISO EAN/UPC symbology specification
ISO/IEC 15417 ISO Code 128 and GS1-128
ISO/IEC 16022 ISO Data Matrix symbology
ISO/IEC 18004 ISO QR Code specification
ISO/IEC 15438 ISO PDF417 symbology
ISO/IEC 24778 ISO Aztec Code specification
ISO/IEC 24724 ISO GS1 DataBar symbology
GS1 General Specifications GS1 Global supply chain standards
AIM DPM AIM Direct Part Marking quality standard

Learn more: Standards Reference | Industry Applications

API Endpoints

Free, no authentication required. JSON responses with CORS enabled.

Method Endpoint Description
GET /api/symbology/{slug}/ Barcode symbology detail with specs
GET /api/family/{slug}/ Symbology family with evolution story
GET /api/standard/{slug}/ Standard detail with linked symbologies
GET /api/component/{slug}/ Anatomy component detail
GET /api/term/{slug}/ Glossary term definition
GET /api/search/?q={query} Search across all content types
GET /api/compare/?a={slug}&b={slug} Compare two symbologies
GET /api/random/ Random symbology discovery
GET /api/industry/{slug}/ Industry barcode usage
GET /api/openapi.json OpenAPI 3.1.0 specification

Example

# Search for UPC barcode formats
curl -s "https://barcodefyi.com/api/search/?q=upc" | python -m json.tool
{
  "results": [
    {
      "slug": "upc-a",
      "name": "UPC-A",
      "type": "symbology",
      "description": "Universal Product Code, 12-digit numeric barcode..."
    }
  ]
}

Full API documentation at barcodefyi.com/api/. OpenAPI 3.1.0 spec: barcodefyi.com/api/openapi.json.

Command-Line Interface

barcodefyi search "code 128"          # Search all content
barcodefyi symbology upc-a            # Symbology detail
barcodefyi compare upc-a ean-13       # Side-by-side comparison
barcodefyi random                     # Discover a random symbology

MCP Server (Claude, Cursor, Windsurf)

{
    "mcpServers": {
        "barcodefyi": {
            "command": "uvx",
            "args": ["--from", "barcodefyi[mcp]", "python", "-m", "barcodefyi.mcp_server"]
        }
    }
}

Tools: barcode_search, barcode_lookup, barcode_compare

REST API Client

from barcodefyi.api import BarcodeFYI

with BarcodeFYI() as api:
    # All 10 endpoints available
    api.search("upc")                      # Full-text search
    api.symbology("upc-a")                 # Symbology detail
    api.family("1d-linear")                # Symbology family
    api.standard("iso-iec-15420")          # Standard detail
    api.component("quiet-zone")            # Anatomy component
    api.glossary_term("symbology")         # Glossary term
    api.compare("upc-a", "ean-13")         # Compare two symbologies
    api.random()                           # Random discovery
    api.industry("retail")                 # Industry application
    api.openapi()                          # OpenAPI 3.1.0 spec

Learn More About Barcodes

Also Available

Platform Install Link
npm npm install barcodefyi npm
Go go get github.com/fyipedia/barcodefyi-go pkg.go.dev
Rust cargo add barcodefyi crates.io
Ruby gem install barcodefyi rubygems.org
MCP uvx --from "barcodefyi[mcp]" python -m barcodefyi.mcp_server Config

Tag FYI Family

Part of the FYIPedia open-source developer tools ecosystem -- automatic identification and data capture technologies.

Site Domain Focus
BarcodeFYI barcodefyi.com 518 records -- barcode symbologies, standards, GS1 prefixes
QRCodeFYI qrcodefyi.com 425 records -- QR code types, versions, encoding modes
NFCFYI nfcfyi.com 288 records -- NFC chips, NDEF records, standards
BLEFYI blefyi.com 261 records -- BLE chips, GATT profiles, beacons
RFIDFYI rfidfyi.com 318 records -- RFID tags, frequency bands, EPC schemes
SmartCardFYI smartcardfyi.com 280 records -- smart cards, EMV, Java Card, platforms

FYIPedia Developer Tools

Package PyPI npm Description
barcodefyi PyPI npm Barcode symbologies, standards -- barcodefyi.com
qrcodefyi PyPI npm QR code types, versions, encoding -- qrcodefyi.com
nfcfyi PyPI npm NFC chips, NDEF, standards -- nfcfyi.com
blefyi PyPI npm BLE profiles, beacons, chips -- blefyi.com
rfidfyi PyPI npm RFID tags, readers, frequencies -- rfidfyi.com
smartcardfyi PyPI npm Smart cards, EMV, platforms -- smartcardfyi.com

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

barcodefyi-0.1.1.tar.gz (746.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

barcodefyi-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file barcodefyi-0.1.1.tar.gz.

File metadata

  • Download URL: barcodefyi-0.1.1.tar.gz
  • Upload date:
  • Size: 746.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for barcodefyi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c842a2047f46b94f7f0daeb35b5a9b5f4ddf1b624afd5785ac3097ba14b3539b
MD5 a8b71fa2a5d226b48972024385599cc6
BLAKE2b-256 855a8ed23d7993e0c960770d973d8dad842e12f9f1ab05aa566c1b986fda3c46

See more details on using hashes here.

File details

Details for the file barcodefyi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: barcodefyi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for barcodefyi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 543a33c8bdb8048b7857c17fecae6781804bf9697ab946958b5cb7e6a275449f
MD5 7c1f87553de8d829c3bdd7b21e164ce7
BLAKE2b-256 9099ed679e3603420cf919775fa9e6115c8aa648e3e30851c36c91c956ed8c4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page