# Barcode Lookup (`tanatasa.sg/barcode-lookup`) Actor

Scan barcode to get cosmetics product data

- **URL**: https://apify.com/tanatasa.sg/barcode-lookup.md
- **Developed by:** [tanatasa.SG](https://apify.com/tanatasa.sg) (community)
- **Categories:** E-commerce
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Barcode Lookup by tanatasa.SG

Turn a barcode into a product name.

This Actor is built by **tanatasa.SG**, a Singapore beauty and personal care store that combines curated retail with practical product data technology. It is designed for sellers, catalog teams, e-commerce operators, developers, and automation workflows that need a simple way to identify a product from a barcode.

### What this Actor does

Provide a barcode, and the Actor returns a clean JSON result with the product name and any available product metadata.

It supports common numeric barcode formats such as:

- UPC
- EAN
- GTIN
- ISBN-style product codes

Example barcode:

```json
{
  "barcode": "4002293401102"
}
````

Example result:

```json
{
  "barcode": "4002293401102",
  "productName": "Product name from barcode lookup",
  "brand": "Brand name if available",
  "category": "Category if available",
  "ean": "4002293401102",
  "upc": "4002293401102",
  "gtin": "04002293401102",
  "source": "barcode-database"
}
```

### Use cases

This Actor is useful for:

- Product name lookup from barcode
- Beauty product catalog enrichment
- Marketplace listing preparation
- Barcode scanner backends
- Inventory and stock workflows
- Product matching across channels
- E-commerce data cleaning
- Retail automation
- Simple API workflows for product identification

Although tanatasa.SG focuses on beauty, skincare, wellness, and personal care products, this Actor can be used for general product barcode lookup when data is available.

### Input

| Field | Type | Required | Description |
|---|---|---:|---|
| `barcode` | string | Yes | UPC, EAN, GTIN, or ISBN-style barcode. Use digits only. |

The barcode should be sent as a string, not a number, so leading zeroes are preserved.

#### Example input

```json
{
  "barcode": "4002293401102"
}
```

### Output

The Actor returns and stores a structured result.

| Field | Description |
|---|---|
| `barcode` | The barcode submitted for lookup |
| `productName` | Product name found from the barcode |
| `brand` | Brand name, if available |
| `category` | Product category, if available |
| `ean` | EAN, if available |
| `upc` | UPC, if available |
| `gtin` | GTIN, if available |
| `source` | Data source identifier |

Not every barcode has complete metadata. In many cases, only the product name may be available.

### How to use this Actor

You can use this Actor in two ways:

1. Run it normally from Apify Console
2. Call it as a Standby API endpoint

### Option 1: Run from Apify Console

Open the Actor input form and enter:

```json
{
  "barcode": "4002293401102"
}
```

Run the Actor.

After the run finishes, open the default dataset to view the result.

### Option 2: Use the Standby API

This Actor supports Apify Standby mode. That means it can respond like a web API.

You need an Apify API token to call the endpoint. You can find it in:

```text
Apify Console > Settings > Integrations
```

The base Standby URL is:

```text
https://tanatasa-sg--barcode-lookup.apify.actor
```

#### GET endpoint

```text
GET /lookup?barcode=YOUR_BARCODE
```

Full example using the token query parameter shown by Apify:

```bash
curl "https://tanatasa-sg--barcode-lookup.apify.actor/lookup?barcode=4002293401102&token=<YOUR_API_TOKEN>"
```

You can also place the token first:

```bash
curl "https://tanatasa-sg--barcode-lookup.apify.actor/lookup?token=<YOUR_API_TOKEN>&barcode=4002293401102"
```

#### GET example response

```json
{
  "barcode": "4002293401102",
  "productName": "Product name from barcode lookup",
  "brand": "Brand name if available",
  "category": "Category if available",
  "ean": "4002293401102",
  "upc": "4002293401102",
  "gtin": "04002293401102",
  "source": "barcode-database"
}
```

#### POST endpoint

```text
POST /lookup
```

Example:

```bash
curl -X POST "https://tanatasa-sg--barcode-lookup.apify.actor/lookup?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"barcode":"4002293401102"}'
```

#### Alternative authorization header

Instead of putting the token in the URL, you can send it as an authorization header:

```bash
curl -H "Authorization: Bearer <YOUR_API_TOKEN>" \
  "https://tanatasa-sg--barcode-lookup.apify.actor/lookup?barcode=4002293401102"
```

### Important: Apify token vs lookup key

The Apify token is required to call this Actor through Apify.

It is not the same as a barcode data provider API key.

Most users only need their Apify token. If a future version of this Actor supports user-provided lookup keys for higher limits, that key will be entered separately as a secret input.

### Error responses

If no barcode is provided:

```json
{
  "error": "Missing barcode. Use barcode, upc, ean, gtin, or isbn."
}
```

If the barcode format is invalid:

```json
{
  "error": "Barcode must be 8 to 14 digits."
}
```

If no product is found:

```json
{
  "error": "No product name found for this barcode."
}
```

### Notes and limitations

This Actor depends on external product data availability. Some barcodes may not have a match. Some matched products may have incomplete brand, category, UPC, EAN, or GTIN information.

For best results:

- Use numeric barcodes only
- Send the barcode as a string
- Preserve leading zeroes
- Use UPC, EAN, GTIN, or ISBN-style barcodes
- Expect occasional missing or incomplete records

### About tanatasa.SG

tanatasa.SG is a Singapore beauty and personal care store focused on trustworthy products, practical recommendations, and everyday skincare needs.

Alongside retail, we build simple technology tools that help improve beauty product discovery, product catalog quality, barcode lookup, and e-commerce operations.

Our Apify tools are shaped by real seller-side problems: identifying products, cleaning product data, matching listings, and making beauty retail workflows faster and more reliable.

### Data source

Product lookup data is provided by UPCitemdb.

# Actor input Schema

## `barcode` (type: `string`):

UPC, EAN, GTIN, or ISBN barcode. Use digits only.

## Actor input object example

```json
{
  "barcode": "4002293401102"
}
```

# Actor output Schema

## `results` (type: `string`):

Barcode lookup results.

# 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 = {
    "barcode": "4002293401102"
};

// Run the Actor and wait for it to finish
const run = await client.actor("tanatasa.sg/barcode-lookup").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 = { "barcode": "4002293401102" }

# Run the Actor and wait for it to finish
run = client.actor("tanatasa.sg/barcode-lookup").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 '{
  "barcode": "4002293401102"
}' |
apify call tanatasa.sg/barcode-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=tanatasa.sg/barcode-lookup",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Barcode Lookup",
        "description": "Scan barcode to get cosmetics product data",
        "version": "0.0",
        "x-build-id": "0X86DSnvXypUNqjdo"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tanatasa.sg~barcode-lookup/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tanatasa.sg-barcode-lookup",
                "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/tanatasa.sg~barcode-lookup/runs": {
            "post": {
                "operationId": "runs-sync-tanatasa.sg-barcode-lookup",
                "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/tanatasa.sg~barcode-lookup/run-sync": {
            "post": {
                "operationId": "run-sync-tanatasa.sg-barcode-lookup",
                "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",
                "required": [
                    "barcode"
                ],
                "properties": {
                    "barcode": {
                        "title": "Barcode",
                        "type": "string",
                        "description": "UPC, EAN, GTIN, or ISBN barcode. Use digits only."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
