{"id":4319,"date":"2020-06-18T13:04:00","date_gmt":"2020-06-18T13:04:00","guid":{"rendered":"https:\/\/uhp.digital\/?p=4319"},"modified":"2020-07-20T08:02:44","modified_gmt":"2020-07-20T08:02:44","slug":"asin-zu-ean-konverter-php","status":"publish","type":"post","link":"https:\/\/uhp.digital\/en\/blog\/asin-zu-ean-konverter-php\/","title":{"rendered":"ASIN to EAN Converter PHP (Amazon ASIN2EAN)"},"content":{"rendered":"<p>Several of our customers have a shop on Amazon or Ebay. Thus a lot of our development services include official web services like the Amazon MWS and AWS API.<\/p>\n\n\n\n<p>Usually products on these platforms have their own identifiers in the respective system. On Amazon, each product's identifier is called the Amazon Standard Identification Number (ASIN). <\/p>\n\n\n\n<p>It is quite often necessary to convert this Amazon based identifier (ASIN) to a global identifier such as EAN (European Article Number or International Article Number) to provide further processing of other applications.<\/p>\n\n\n\n<p>There are several tools out there providing the necessary function to convert a given ASIN to an EAN. These are mainly installable tools like <a href=\"http:\/\/asin-to-ean-converter.software.informer.com\/\">ASIN to EAN Converter<\/a>, free online tools like <a href=\"http:\/\/erwinmayer.com\/emlabs\/asin2ean\/#ASIN-to-EAN\">erwinmayer.com<\/a> or even paid services.<\/p>\n\n\n\n<p>These online tools are lacking an API so they are not easily able to integrate into your web application. The answer to the problem is easier than one might first think. <a href=\"https:\/\/aws.amazon.com\/\">Amazon Web Services AWS<\/a> already provide the functionality to convert an <strong>ASIN to EAN<\/strong> -  even if it is not that obvious.<\/p>\n\n\n\n<p>Using a library like <a href=\"http:\/\/www.ulrichmierendorff.com\/software\/aws_hmac_signer.html\">http:\/\/www.ulrichmierendorff.com\/software\/aws_hmac_signer.html<\/a> you can perform a signed request to the AWS API.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>include<\/code> <code>\"aws_signed_request.php\";<\/code> <\/pre>\n\n\n\n<p>Now you can make an ItemLookup Request to the Amazon AWS API using the <strong>ASIN<\/strong>which you want to convert and extract the respective <strong>EAN<\/strong> from the API response.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>ASIN2EAN function<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>function<\/code> <code>ASINtoEAN($asin,$locale=\"de\") {<\/code><br>    <code>\/\/Amazon AWS data<\/code><br>    <code>$AWSAccessKeyId<\/code> <code>= \"YourKeyID\";<\/code><br>    <code>$AWSSecretKey<\/code> <code>= \"YourSecretKey\";<\/code><br>    <code>$associateTag<\/code> <code>= \"YourAssociateTag\";<\/code><br>&nbsp;<br>&nbsp;<br>    <code>$request<\/code> <code>= array(\"Operation\"=&gt;\"ItemLookup\", \"ItemId\"=&gt;$asin, <\/code><br>    <code>\"ResponseGroup\"=&gt;\"ItemAttributes\");<\/code><br>    <code>$signedRequest<\/code> <code>= aws_signed_request($locale, $request, <\/code><br>    <code>$AWSAccessKeyId, $AWSSecretKey, $associateTag);<\/code><br>&nbsp;<br>&nbsp;<br>    <code>\/\/call curl<\/code><br>    <code>$curl<\/code> <code>= curl_init($signedRequest);<\/code><br>    <code>curl_setopt($curl, CURLOPT_HEADER, false);<\/code><br>    <code>curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);<\/code><br>    <code>$response<\/code> <code>= curl_exec($curl);<\/code><br>    <code>curl_close($curl);<\/code><br>&nbsp;<br>&nbsp;<br>    <code>\/\/handle response<\/code><br>    <code>if<\/code> <code>($response<\/code> <code>=== FALSE){<\/code><br>    <code>return<\/code> <code>null;<\/code><br><code>}<\/code> <code>else {<\/code><br>    <code>$xml<\/code> <code>= simplexml_load_string($response);<\/code><br>    <code>if<\/code> <code>($xml<\/code> <code>=== FALSE)<\/code><br>    <code>return<\/code> <code>null; \/\/no xml<\/code><br>    <code>else {<\/code><br>    <code>if(isset($xml-&gt;Items-&gt;Request-&gt;Errors)) \/\/ASIN was not found or different error<\/code><br>    <code>return<\/code> <code>null;<\/code><br>    <code>else<\/code><br>        <code>return<\/code> <code>$xml-&gt;Items-&gt;Item-&gt;ItemAttributes-&gt;EAN;<\/code><br>    <code>}<\/code><br><code>}<\/code><br><code>}<\/code><br>&nbsp; <\/pre>\n\n\n\n<p>You can get necessary credentials after registering for the <a href=\"https:\/\/aws.amazon.com\/\">Amazon Web Services AWS<\/a> .<\/p>\n\n\n\n<p><em>For any questions or thoughts feel free to contact us through your preferred channel.<\/em><\/p>","protected":false},"excerpt":{"rendered":"<p>Several of our customers have a shop on Amazon or Ebay. Usually, products on these platforms have their own identifiers in the respective system. It is quite often necessary to convert this Amazon based identifier (ASIN) to a global identifier such as EAN (European Article Number or International Article Number). There are several tools out there providing the necessary function to convert a given ASIN to an EAN. Find more about them below! <\/p>","protected":false},"author":1,"featured_media":4216,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"template-parts\/single-post-template.php","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-4319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ASIN-zu-EAN-Konverter PHP (Amazon ASIN2EAN) - UHP<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/uhp.digital\/en\/blog\/asin-zu-ean-konverter-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ASIN-zu-EAN-Konverter PHP (Amazon ASIN2EAN) - UHP\" \/>\n<meta property=\"og:description\" content=\"Mehrere unserer Kunden haben einen Shop bei Amazon oder Ebay. In der Regel haben Produkte auf diesen Plattformen ihre eigene Kennung im jeweiligen System. Es ist oft notwendig, diese auf Amazon basierende Kennung (ASIN) in eine globale Kennung wie die EAN (European Article Number oder International Article Number) umzuwandeln. Es gibt verschiedene Tools, die die notwendige Funktion zur Umwandlung einer ASIN in eine EAN bieten.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/uhp.digital\/en\/blog\/asin-zu-ean-konverter-php\/\" \/>\n<meta property=\"og:site_name\" content=\"UHP\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/uhpdigital\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-18T13:04:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-20T08:02:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/02\/FB-Logo@3x.png\" \/>\n\t<meta property=\"og:image:width\" content=\"540\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"UHP\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"UHP\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/\"},\"author\":{\"name\":\"UHP\",\"@id\":\"https:\/\/uhp.digital\/#\/schema\/person\/82c263f7a03b60653db3cdd2d4301acb\"},\"headline\":\"ASIN-zu-EAN-Konverter PHP (Amazon ASIN2EAN)\",\"datePublished\":\"2020-06-18T13:04:00+00:00\",\"dateModified\":\"2020-07-20T08:02:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/\"},\"wordCount\":272,\"publisher\":{\"@id\":\"https:\/\/uhp.digital\/#organization\"},\"image\":{\"@id\":\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/06\/undraw-convert-2-gjv-1.svg\",\"articleSection\":[\"Tech\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/\",\"url\":\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/\",\"name\":\"ASIN-zu-EAN-Konverter PHP (Amazon ASIN2EAN) - UHP\",\"isPartOf\":{\"@id\":\"https:\/\/uhp.digital\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/06\/undraw-convert-2-gjv-1.svg\",\"datePublished\":\"2020-06-18T13:04:00+00:00\",\"dateModified\":\"2020-07-20T08:02:44+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#primaryimage\",\"url\":\"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/06\/undraw-convert-2-gjv-1.svg\",\"contentUrl\":\"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/06\/undraw-convert-2-gjv-1.svg\",\"width\":609,\"height\":332},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/uhp.digital\/#website\",\"url\":\"https:\/\/uhp.digital\/\",\"name\":\"UHP\",\"description\":\"Delivering digital impact.\",\"publisher\":{\"@id\":\"https:\/\/uhp.digital\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/uhp.digital\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/uhp.digital\/#organization\",\"name\":\"UHP\",\"url\":\"https:\/\/uhp.digital\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/uhp.digital\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/01\/uhp-logo.svg\",\"contentUrl\":\"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/01\/uhp-logo.svg\",\"width\":88,\"height\":40,\"caption\":\"UHP\"},\"image\":{\"@id\":\"https:\/\/uhp.digital\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/uhpdigital\/\",\"https:\/\/www.instagram.com\/uhpdigital\/\",\"https:\/\/www.linkedin.com\/company\/uhp-software\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/uhp.digital\/#\/schema\/person\/82c263f7a03b60653db3cdd2d4301acb\",\"name\":\"UHP\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/uhp.digital\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c1bc770aea92efb4d58edb8d8e86f9eaa06def97a45852ce534799e57534d6c6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c1bc770aea92efb4d58edb8d8e86f9eaa06def97a45852ce534799e57534d6c6?s=96&d=mm&r=g\",\"caption\":\"UHP\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ASIN to EAN Converter PHP (Amazon ASIN2EAN) - UHP","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/uhp.digital\/en\/blog\/asin-zu-ean-konverter-php\/","og_locale":"en_US","og_type":"article","og_title":"ASIN-zu-EAN-Konverter PHP (Amazon ASIN2EAN) - UHP","og_description":"Mehrere unserer Kunden haben einen Shop bei Amazon oder Ebay. In der Regel haben Produkte auf diesen Plattformen ihre eigene Kennung im jeweiligen System. Es ist oft notwendig, diese auf Amazon basierende Kennung (ASIN) in eine globale Kennung wie die EAN (European Article Number oder International Article Number) umzuwandeln. Es gibt verschiedene Tools, die die notwendige Funktion zur Umwandlung einer ASIN in eine EAN bieten.","og_url":"https:\/\/uhp.digital\/en\/blog\/asin-zu-ean-konverter-php\/","og_site_name":"UHP","article_publisher":"https:\/\/www.facebook.com\/uhpdigital\/","article_published_time":"2020-06-18T13:04:00+00:00","article_modified_time":"2020-07-20T08:02:44+00:00","og_image":[{"width":540,"height":540,"url":"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/02\/FB-Logo@3x.png","type":"image\/png"}],"author":"UHP","twitter_card":"summary_large_image","twitter_misc":{"Written by":"UHP","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#article","isPartOf":{"@id":"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/"},"author":{"name":"UHP","@id":"https:\/\/uhp.digital\/#\/schema\/person\/82c263f7a03b60653db3cdd2d4301acb"},"headline":"ASIN-zu-EAN-Konverter PHP (Amazon ASIN2EAN)","datePublished":"2020-06-18T13:04:00+00:00","dateModified":"2020-07-20T08:02:44+00:00","mainEntityOfPage":{"@id":"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/"},"wordCount":272,"publisher":{"@id":"https:\/\/uhp.digital\/#organization"},"image":{"@id":"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#primaryimage"},"thumbnailUrl":"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/06\/undraw-convert-2-gjv-1.svg","articleSection":["Tech"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/","url":"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/","name":"ASIN to EAN Converter PHP (Amazon ASIN2EAN) - UHP","isPartOf":{"@id":"https:\/\/uhp.digital\/#website"},"primaryImageOfPage":{"@id":"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#primaryimage"},"image":{"@id":"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#primaryimage"},"thumbnailUrl":"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/06\/undraw-convert-2-gjv-1.svg","datePublished":"2020-06-18T13:04:00+00:00","dateModified":"2020-07-20T08:02:44+00:00","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/uhp.digital\/blog\/asin-zu-ean-konverter-php\/#primaryimage","url":"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/06\/undraw-convert-2-gjv-1.svg","contentUrl":"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/06\/undraw-convert-2-gjv-1.svg","width":609,"height":332},{"@type":"WebSite","@id":"https:\/\/uhp.digital\/#website","url":"https:\/\/uhp.digital\/","name":"UHP","description":"Delivering digital impact.","publisher":{"@id":"https:\/\/uhp.digital\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/uhp.digital\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/uhp.digital\/#organization","name":"UHP","url":"https:\/\/uhp.digital\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/uhp.digital\/#\/schema\/logo\/image\/","url":"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/01\/uhp-logo.svg","contentUrl":"https:\/\/uhp.digital\/wp-content\/uploads\/2020\/01\/uhp-logo.svg","width":88,"height":40,"caption":"UHP"},"image":{"@id":"https:\/\/uhp.digital\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/uhpdigital\/","https:\/\/www.instagram.com\/uhpdigital\/","https:\/\/www.linkedin.com\/company\/uhp-software\/"]},{"@type":"Person","@id":"https:\/\/uhp.digital\/#\/schema\/person\/82c263f7a03b60653db3cdd2d4301acb","name":"UHP","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/uhp.digital\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c1bc770aea92efb4d58edb8d8e86f9eaa06def97a45852ce534799e57534d6c6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c1bc770aea92efb4d58edb8d8e86f9eaa06def97a45852ce534799e57534d6c6?s=96&d=mm&r=g","caption":"UHP"}}]}},"_links":{"self":[{"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/posts\/4319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/comments?post=4319"}],"version-history":[{"count":16,"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/posts\/4319\/revisions"}],"predecessor-version":[{"id":16630,"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/posts\/4319\/revisions\/16630"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/media\/4216"}],"wp:attachment":[{"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/media?parent=4319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/categories?post=4319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/uhp.digital\/en\/wp-json\/wp\/v2\/tags?post=4319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}