{"id":19986084,"url":"https://github.com/eansearch/gtin-lookup","last_synced_at":"2025-06-19T04:38:43.302Z","repository":{"id":235785299,"uuid":"791255025","full_name":"eansearch/gtin-lookup","owner":"eansearch","description":"A Javascript modult to lookup GTIN, EAN or ISBN codes","archived":false,"fork":false,"pushed_at":"2025-02-24T23:28:59.000Z","size":30,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-08T21:56:02.142Z","etag":null,"topics":["barcode","ean","ean-13","ean-code","ean13","gtin","isbn","isbn-10","isbn-13","upc"],"latest_commit_sha":null,"homepage":"https://www.ean-search.org/ean-database-api.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eansearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-24T11:37:06.000Z","updated_at":"2025-02-24T23:28:55.000Z","dependencies_parsed_at":"2024-04-24T16:03:31.802Z","dependency_job_id":null,"html_url":"https://github.com/eansearch/gtin-lookup","commit_stats":null,"previous_names":["eansearch/gtin-lookup"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/eansearch/gtin-lookup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eansearch%2Fgtin-lookup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eansearch%2Fgtin-lookup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eansearch%2Fgtin-lookup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eansearch%2Fgtin-lookup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eansearch","download_url":"https://codeload.github.com/eansearch/gtin-lookup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eansearch%2Fgtin-lookup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260689613,"owners_count":23047043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode","ean","ean-13","ean-code","ean13","gtin","isbn","isbn-10","isbn-13","upc"],"created_at":"2024-11-13T04:27:45.803Z","updated_at":"2025-06-19T04:38:38.285Z","avatar_url":"https://github.com/eansearch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gtin-lookup\n\nA Javascript module to lookup GTIN, EAN or ISBN codes using the API on https://www.ean-search.org\n\n## Install\n\n`npm install gtin-lookup`\n\n## Obtain an API key\n\nTo use the module, you need an API access token from\nhttps://www.ean-search.org/ean-database-api.html\n\n## Usage\n\n```javascript\n\nvar GTINLookup = require(\"gtin-lookup\");\n\nconst apiToken = \"abcdef\";\nvar gtinLookup = new GTINLookup(apiToken);\n\n// lookup GTIN, prefer English (1) name\nconst gtin = \"5099750442227\";\ngtinLookup.gtinLookup(gtin, 1, function(response){\n  if (!response.serverError) {\n    console.log(\"gtinLookup()\");\n    if (response.product != undefined) {\n        console.log(\"GTIN \" + gtin + \" is \" + response.product[0].name + \" category: \" + response.product[0].categoryName);\n    } else {\n        console.log(\"GTIN \" + gtin + \" not found in database\");\n    }\n  } else {\n      console.log('Server error: ' + resp.statusCode); \n  }\n});\n\n// lookup book data using ISBN-10 or ISBN-13\nconst isbn = \"1119578884\";\ngtinLookup.isbnLookup(isbn, function(response){\n  if (!response.serverError) {\n    console.log(\"isbnLookup()\");\n    if (response.product != undefined) {\n        console.log(\"ISBN \" + isbn + \" is \" + response.product[0].name);\n    } else {\n        console.log(\"ISBN \" + isbn + \" not found in database\");\n    }\n    } else {\n      console.log('Server error: ' + resp.statusCode); \n    }\n});\n\n// search for product name (exact match), prefer English (1)\nlet name = \"Bananaboat\";\ngtinLookup.gtinSearch(name, 1, function(response){\n  if (!response.serverError) {\n    console.log(\"gtinSearch()\");\n    if (response.product.productlist != undefined) {\n      for (let i = 0; i \u003c response.product.productlist.length; i++) {\n        console.log(response.product.productlist[i].ean + \" is \" + response.product.productlist[i].name);\n      }\n    } else {\n        console.log(\"Name \" + name + \" not found in database\");\n    }\n    } else {\n      console.log('Server error: ' + resp.statusCode); \n    }\n});\n\n// search for product with a similar name\ngtinLookup.gtinSimilarSearch(\"Apple iPhone 16GB robust\", 1, function(response){\n  if (!response.serverError) {\n    console.log(\"gtinSimilarSearch()\");\n    if (response.product.productlist != undefined) {\n      for (let i = 0; i \u003c response.product.productlist.length; i++) {\n        console.log(response.product.productlist[i].ean + \" is \" + response.product.productlist[i].name);\n      }\n    } else {\n        console.log(\"Name \" + name + \" not found in database\");\n    }\n    } else {\n      console.log('Server error: ' + resp.statusCode); \n    }\n});\n\n// search for name, but restrict to Fashion category (20), prefer English (1)\ngtinLookup.gtinCategorySearch(name, 20, 1, function(response){\n  if (!response.serverError) {\n    console.log(\"gtinCategorySearch()\");\n    if (response.product.productlist != undefined) {\n      for (let i = 0; i \u003c response.product.productlist.length; i++) {\n        console.log(\"Fashion: \" + response.product.productlist[i].ean + \" is \" + response.product.productlist[i].name);\n      }\n    } else {\n        console.log(\"Name \" + name + \" not found in database\");\n    }\n    } else {\n      console.log('Server error: ' + resp.statusCode); \n    }\n});\n\n// find all GTINs starting with \"5099750442\", prefer English (1), just fetch page 0\ngtinLookup.gtinPrefixSearch(\"5099750442\", 1, 0, function(response){\n  if (!response.serverError) {\n    console.log(\"gtinPrefixSearch()\");\n    if (response.product.productlist != undefined) {\n      for (let i = 0; i \u003c response.product.productlist.length; i++) {\n        console.log(response.product.productlist[i].ean + \" is \" + response.product.productlist[i].name);\n      }\n    } else {\n        console.log(\"Name \" + name + \" not found in database\");\n    }\n    } else {\n      console.log('Server error: ' + resp.statusCode); \n    }\n});\n\n// lookup the country where a GTIN barcode was registered\ngtinLookup.gtinIssuingCountryLookup(gtin, function(response){\n  if (!response.serverError) {\n    console.log(\"gtinIssuingCountryLookup()\");\n      console.log(\"GTIN \" + gtin + \" was issued in \" + response.product[0].issuingCountry);\n  } else {\n      console.log('Server error: ' + resp.statusCode); \n  }\n});\n\n// verify the checksum of a GTIN\ngtinLookup.gtinVerifyChecksum(gtin, function(response){\n  if (!response.serverError) {\n    console.log(\"gtinVerifyChecksum()\");\n      console.log(\"Checksum of GTIN \" + gtin + \" is \" + (response.product[0].valid ? \"OK\" : \"Invalid\"));\n  } else {\n      console.log('Server error: ' + resp.statusCode); \n  }\n});\n\n// generate a PNG barcode image for a GTIN\nvar width = 200; // PNG width\nvar height = 100; // PNG height\ngtinLookup.gtinBarcodeImage(gtin, width, height, function(response){\n  if (!response.serverError) {\n    console.log(\"gtinBarcode()\");\n      console.log(\"Base64 encoded PNG image of GTIN \" + gtin + \" barcode: \" + response.product[0].barcode);\n  } else {\n      console.log('Server error: ' + resp.statusCode); \n  }\n});\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feansearch%2Fgtin-lookup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feansearch%2Fgtin-lookup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feansearch%2Fgtin-lookup/lists"}