Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eansearch/ean-search
A PHP class for EAN and ISBN name lookup and validation using the API on ean-search.org
https://github.com/eansearch/ean-search
barcode ean gtin gtin-codes isbn isbn-10 isbn-13 lookup php search upc
Last synced: about 1 month ago
JSON representation
A PHP class for EAN and ISBN name lookup and validation using the API on ean-search.org
- Host: GitHub
- URL: https://github.com/eansearch/ean-search
- Owner: eansearch
- License: mit
- Created: 2017-05-04T19:29:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-18T18:58:13.000Z (8 months ago)
- Last Synced: 2024-10-29T01:21:47.833Z (about 2 months ago)
- Topics: barcode, ean, gtin, gtin-codes, isbn, isbn-10, isbn-13, lookup, php, search, upc
- Language: PHP
- Homepage: https://www.ean-search.org/ean-database-api.html
- Size: 7.81 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# relaxed/ean-search
A PHP class for EAN and ISBN name lookup and validation using the API on ean-search.org.To use it, you need an API access token from
https://www.ean-search.org/ean-database-api.html## Initialization
```php
include "EANSearch.php";// your access token from ean-search.org
$accessToken = 'abcdef';$eanSearch = new EANSearch($accessToken);
```## Usage
```php
$ean = '5099750442227';
$name = $eanSearch->barcodeLookup($ean);
echo "$ean is $name\n";// more detailed response, preferably in English
$product = $eanSearch->barcodeSearch($ean, 1);
echo "$ean is $product->name from category $product->categoryName issued in $product->issuingCountry\n";$isbn = '1119578884';
$title = $eanSearch->isbnLookup($isbn);
echo "$isbn is $title\n";$ok = $eanSearch->verifyChecksum($ean);
echo "$ean is " . ($ok ? 'valid' : 'invalid') . "\n";$eanList = $eanSearch->productSearch('Apple iPod');
foreach ($eanList as $product) {
echo "$product->ean is $product->name\n";
}$eanList = $eanSearch->categorySearch(45, 'Thriller');
foreach ($eanList as $product) {
echo "$product->ean from Music category is $product->name\n";
}$eanList = $eanSearch->barcodePrefixSearch(4007249146);
foreach ($eanList as $product) {
echo "$product->ean is $product->name\n";
}$ean = '5099750442227';
$country = $eanSearch->issuingCountryLookup($ean);
echo "$ean was issued in $country\n";//$ean = '5099750442227';
//$barcode = $eanSearch->barcodeImage($ean);
//header("Content-Type: image/png");
// echo $barcode;
```