Skip to content

barcode limit: 13 digits or more? #49

@CharlesNepote

Description

@CharlesNepote

Folksonomy API currently recognize products with the following regexp: [0-9]{1,13} which means barcodes containing 1 to 13 digits.

More than 12,000 products have barcodes bigger than that. Eg. https://world.openfoodfacts.org/product/70238541220839/ikea (even if it's not a food product, it is a real barcode).

This topic is relevant because Folksonomy Engine could be use for other kind of products, nit just food. And these other kind of products sometimes have different barcodes than classical EAN13 barcodes.

To extract the barcodes with more than 13 digits:
zcat openfoodfacts-products.jsonl.gz | jq -r '. | select(.code|test("^[0-9]{1,13}$") | not) | .code'

See also:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions