https://github.com/eansearch/python-ean-search
A Python class for EAN and ISBN name lookup and validation using the API on ean-search.org
https://github.com/eansearch/python-ean-search
ean ean13 gtin isbn lookup python python-2 python-3 upc
Last synced: 3 months ago
JSON representation
A Python class for EAN and ISBN name lookup and validation using the API on ean-search.org
- Host: GitHub
- URL: https://github.com/eansearch/python-ean-search
- Owner: eansearch
- License: mit
- Created: 2018-07-04T09:51:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-12T21:23:16.000Z (9 months ago)
- Last Synced: 2025-07-14T17:16:05.323Z (3 months ago)
- Topics: ean, ean13, gtin, isbn, lookup, python, python-2, python-3, upc
- Language: Python
- Homepage: https://www.ean-search.org/ean-database-api.html
- Size: 25.4 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EANSearch
A Python class for EAN and ISBN name lookup and validation using the API on https://www.ean-search.org
Compatible with Python 2.x **and** 3.x
```python
from eansearch import EANSearch# get a token from https://www.ean-search.org/ean-database-api.html
apiToken = "secret"
ean = "5099750442227" # Thrillereansearch = EANSearch(apiToken)
name = eansearch.barcodeLookup(ean)
print(ean, " is ", name)# more detailed result, preferrably in English (1)
product = eansearch.barcodeSearch(ean, 1)
print(ean, " is ", product["name"].encode("utf-8"), " from category ", product["categoryName"], " issued in ", product["issuingCountry"])isbn = "1119578884"
title = eansearch.isbnLookup(isbn)
print(isbn, " is ", title)ok = eansearch.verifyChecksum(ean)
print(ean, " is ", "OK" if ok else "Not OK")eanList = eansearch.productSearch('iPod')
for product in eanList:
print(product["ean"], " is ", product["name"].encode("utf-8"))eanList = eansearch.similarProductSearch('iPod with extra features')
for product in eanList:
print(product["ean"], " is ", product["name"].encode("utf-8"))eanList = eansearch.categorySearch(45, 'thriller')
for product in eanList:
print(product["ean"], " is ", product["name"].encode("utf-8"))eanList = eansearch.barcodePrefixSearch('4007249146')
for product in eanList:
print(product["ean"], " is ", product["name"].encode("utf-8"))country = eansearch.issuingCountryLookup("5099750442227")
print(ean + " was issued in " + country)barcode = eansearch.barcodeImage("5099750442227")
print("Barcode image for " + ean + " (base64 encoded): " + barcode)#import base64
#print (base64.b64decode(barcode))