EANSearch
Search for products by EAN barcode or product name / keywords
Features
- Search by EAN code
- Search by name or keyords
- restrict search by product category
- get the issuing country for the barcode
- verify barcode checksum
- get PNG image for the EAN barcode
How to use
// search by EAN barcode, product name in English
let eansearch = new;
let product = eansearch.barcode_lookup;
let product = product.unwrap; // unwrap result
let product = product.unwrap;
println!;
// now find all products with the keyword 'bananaboat'
let product_list = eansearch.product_search;
for p in &product_list.unwrap
// only find 'bananaboat' products from the 'Music' category
let product_list = eansearch.category_search;
// download a EANs that start with 509975044xxx
let product_list = eansearch.barcode_prefix_search;
// find the country where a barcode was issued
let country_lookup = eansearch.issuing_country;
// check if this is really a valid barcode
let checksum_ok = eansearch.verify_checksum;
// get A PNG image of the barcode to display eg. on a website
let img = eansearch.barcode_image;
To use the library, you need an account and obtain an API token.