# ASIN to EAN, GTIN, UPC Converter for Amazon (`truenorth/amazon-asin-ean-converter`) Actor

Convert Amazon ASINs to EAN, UPC, and GTIN barcodes with cached JSON output for catalog and inventory workflows.

- **URL**: https://apify.com/truenorth/amazon-asin-ean-converter.md
- **Developed by:** [TrueNorth](https://apify.com/truenorth) (community)
- **Categories:** E-commerce, MCP servers, Integrations
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## ASIN to EAN Converter for Amazon Barcodes

#### Hero Section

Convert Amazon ASINs into universal product barcodes without manual lookup. This Actor turns ASIN lists into clean EAN, UPC, and GTIN fields that catalog teams, Amazon sellers, marketplace agencies, and inventory operations can use for matching products across suppliers, ERPs, marketplaces, and internal product databases.

Instead of copying ASINs into one-off web tools, run a repeatable Apify workflow and export structured JSON, CSV, Excel, or API-ready results. Durable caching is built in, so repeated ASIN lookups can return from a named Key-Value Store instead of querying the upstream converter again.

#### Key Features

- Convert single ASINs or ASIN arrays into EAN, UPC, and GTIN identifiers.
- Supports Amazon marketplace codes including US, DE, UK, FR, IT, ES, NL, CA, MX, JP, AU, and more.
- Durable cache support through a named Apify Key-Value Store.
- Positive and not-found results are cached because ASIN-to-barcode mappings are effectively static.
- Minimal one-row-per-ASIN dataset output with only ASIN, EAN, UPC, and GTIN.
- Missing EAN, UPC, or GTIN values are returned as `null` instead of empty arrays or extra status fields.
- If RocketSource returns no GTIN, the Actor calculates GTIN-14 from the first available EAN or UPC by left-padding the identifier with zeros to 14 digits.
- Isolated cookie sessions per worker to avoid converter session collisions.
- Retry handling for expired converter sessions, cookie-required responses, and captcha-triggered session resets.

#### How it Works

1. Enter one ASIN or paste a list of ASINs, then select the Amazon marketplace code.
2. Run the Actor on Apify. The Actor checks the durable cache first, then queries RocketSource only for cache misses.
3. Download the dataset as JSON, CSV, or Excel, or connect the output to your API, enrichment pipeline, ERP import, or automation workflow.

#### Input Example

```json
{
  "asin": "B07ZPC9QD4",
  "asins": ["B07ZPC9QD4", "B08N5WRWNW"],
  "marketplace": "US",
  "maxConcurrency": 1,
  "useCache": true,
  "cacheStoreName": "asin-ean-cache",
  "maxRetries": 2
}
````

#### Output Sample (JSON format)

```json
{
  "ASIN": "B07ZPC9QD4",
  "EAN": ["0190199246850"],
  "UPC": ["190199246850"],
  "GTIN": ["00190199246850", "30190199246851"]
}
```

If a value is unavailable, the field is returned as `null`:

```json
{
  "ASIN": "UNKNOWN",
  "EAN": null,
  "UPC": null,
  "GTIN": null
}
```

If RocketSource returns an EAN or UPC but no GTIN, the Actor derives GTIN-14 automatically:

```json
{
  "ASIN": "EAN_ONLY_EXAMPLE",
  "EAN": ["1234567890128"],
  "UPC": null,
  "GTIN": ["01234567890128"]
}
```

#### AI & LLM Integration (RAG-Ready)

The Actor returns clean structured JSON fields that are easy to use in AI and automation pipelines. You can:

- Enrich product catalog records before feeding them into LLM workflows.
- Store ASIN, EAN, UPC, and GTIN fields in a vector database for retrieval-augmented generation (RAG).
- Use the output as a Model Context Protocol (MCP) data source for catalog matching and product enrichment agents.
- Build automated workflows for marketplace listing validation, supplier matching, product deduplication, or inventory normalization.
- Join the dataset with pricing, availability, or internal SKU tables for downstream analytics.

#### Notes and Limits

This Actor uses RocketSource's public ASIN-to-EAN converter flow. The upstream converter is stateful and can request a captcha after a usage threshold or bot-protection signal. Durable caching reduces repeated live lookups and keeps repeated conversions fast and predictable.

# Actor input Schema

## `asin` (type: `string`):

Single Amazon ASIN to convert.

## `asins` (type: `array`):

Amazon ASINs to convert. You can use this together with the single ASIN field.

## `marketplace` (type: `string`):

Amazon marketplace code.

## `maxConcurrency` (type: `integer`):

Number of isolated converter sessions to run in parallel.

## `useCache` (type: `boolean`):

Read and write successful and not-found results to a named Key-Value Store.

## `cacheStoreName` (type: `string`):

Named Apify Key-Value Store used for durable ASIN mappings.

## `maxRetries` (type: `integer`):

Retries per ASIN after session, captcha, or HTTP failures.

## Actor input object example

```json
{
  "marketplace": "US",
  "maxConcurrency": 1,
  "useCache": true,
  "cacheStoreName": "asin-ean-cache",
  "maxRetries": 2
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("truenorth/amazon-asin-ean-converter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("truenorth/amazon-asin-ean-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call truenorth/amazon-asin-ean-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=truenorth/amazon-asin-ean-converter",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ASIN to EAN, GTIN, UPC Converter for Amazon",
        "description": "Convert Amazon ASINs to EAN, UPC, and GTIN barcodes with cached JSON output for catalog and inventory workflows.",
        "version": "1.0",
        "x-build-id": "jTevnCwmlBMUfu05t"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/truenorth~amazon-asin-ean-converter/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-truenorth-amazon-asin-ean-converter",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/truenorth~amazon-asin-ean-converter/runs": {
            "post": {
                "operationId": "runs-sync-truenorth-amazon-asin-ean-converter",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/truenorth~amazon-asin-ean-converter/run-sync": {
            "post": {
                "operationId": "run-sync-truenorth-amazon-asin-ean-converter",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "asin": {
                        "title": "Single ASIN",
                        "type": "string",
                        "description": "Single Amazon ASIN to convert."
                    },
                    "asins": {
                        "title": "ASINs",
                        "type": "array",
                        "description": "Amazon ASINs to convert. You can use this together with the single ASIN field.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "marketplace": {
                        "title": "Marketplace code",
                        "enum": [
                            "CA",
                            "US",
                            "MX",
                            "BR",
                            "ES",
                            "UK",
                            "FR",
                            "NL",
                            "DE",
                            "IT",
                            "SE",
                            "PL",
                            "EG",
                            "TR",
                            "SA",
                            "AE",
                            "IN",
                            "SG",
                            "AU",
                            "JP"
                        ],
                        "type": "string",
                        "description": "Amazon marketplace code.",
                        "default": "US"
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Number of isolated converter sessions to run in parallel.",
                        "default": 1
                    },
                    "useCache": {
                        "title": "Use durable cache",
                        "type": "boolean",
                        "description": "Read and write successful and not-found results to a named Key-Value Store.",
                        "default": true
                    },
                    "cacheStoreName": {
                        "title": "Cache store name",
                        "type": "string",
                        "description": "Named Apify Key-Value Store used for durable ASIN mappings.",
                        "default": "asin-ean-cache"
                    },
                    "maxRetries": {
                        "title": "Max retries",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Retries per ASIN after session, captcha, or HTTP failures.",
                        "default": 2
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
