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: 18 days 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 (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-18T18:58:13.000Z (about 1 year ago)
- Last Synced: 2024-10-29T01:21:47.833Z (7 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->similarProductSearch('Apple iPod with extra feature');
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, 300, 200);
//header("Content-Type: image/png");
// echo $barcode;$credits = $eanSearch->creditsRemaining();
echo "$credits credits remaining\n";```