# PAL | Japanese Product Catalog Validation (`practical_ai_lab_jp/pal-jp-catalog-audit`) Actor

Normalize Japanese product SKUs, yen prices, inventory counts and detect duplicate catalog rows. Returns structured per-item QA results.

- **URL**: https://apify.com/practical_ai_lab_jp/pal-jp-catalog-audit.md
- **Developed by:** [Practical AI Lab](https://apify.com/practical_ai_lab_jp) (community)
- **Categories:** E-commerce, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## PAL | Japanese Product Catalog Validation

A deterministic Japanese ecommerce data checker for merchants, catalog migration teams and inventory managers.

### What it does

- Normalizes SKU and product titles with Unicode NFKC and safe whitespace cleanup
- Validates JPY integer prices and optional stock counts
- Detects duplicate normalized SKUs within the same uploaded batch
- Emits one auditable dataset record per input item, including errors
- Preserves the input, does not scrape websites, does not require external credentials or browser sessions
- Fails safely for malformed input or over 1,000 rows

### Input

```json
{"items":[{"sku":"Ｐ００１","title":"  商品Ａ  ","price_jpy":"￥1,280","stock":"20"},{"sku":"P001","title":"別の商品","price_jpy":"1980","stock":0}]}
```

### Output

One structured record per row: `index`, `valid`, `errors`, and `normalized` with SKU, title, integer JPY price, and optional stock count. The example above flags the duplicate normalized SKU.

### Billing and important limitations

This Actor is designed for Apify pay-per-event with the `apify-default-dataset-item` synthetic event. The creator must explicitly enable pricing before claiming payment. No custom per-row `Actor.charge()` calls are used, to prevent double billing. A result item can be billable even if validation reports an error; disclose that to customers. Apify infra and the 20% marketplace commission reduce profit.

No guarantees of revenue or sales. Do not include personal/sensitive customer data; uploaded content and output are processed by Apify infrastructure according to its privacy and retention settings. This is a catalog input preflight, **not** a full Shopify import validator or accounting calculator.

### Release gate

Private build and test first; official live cloud smoke, billing setup, unique approved PAL icon, competitor differentiation, and actual platform publication evidence required before marking release-ready.

# Actor input Schema

## `items` (type: `array`):

Use sku/title/price_jpy/stock or Japanese 商品コード/商品名/価格/在庫数.

## Actor input object example

```json
{
  "items": [
    {
      "sku": "SKU-001",
      "title": "サンプル商品",
      "price_jpy": "￥1,280",
      "stock": 10
    }
  ]
}
```

# Actor output Schema

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

No description

# 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 = {
    "items": [
        {
            "sku": "SKU-001",
            "title": "サンプル商品",
            "price_jpy": "￥1,280",
            "stock": 10
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("practical_ai_lab_jp/pal-jp-catalog-audit").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 = { "items": [{
            "sku": "SKU-001",
            "title": "サンプル商品",
            "price_jpy": "￥1,280",
            "stock": 10,
        }] }

# Run the Actor and wait for it to finish
run = client.actor("practical_ai_lab_jp/pal-jp-catalog-audit").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "items": [
    {
      "sku": "SKU-001",
      "title": "サンプル商品",
      "price_jpy": "￥1,280",
      "stock": 10
    }
  ]
}' |
apify call practical_ai_lab_jp/pal-jp-catalog-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,practical_ai_lab_jp/pal-jp-catalog-audit"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/yO0RJXbZysd48Gd5f/builds/TEwMvABanjrx0aN5I/openapi.json
