# Naver & Coupang CSV Cleaner: Won, Dates, Price Changes (`marktrade/naver-coupang-csv-cleaner`) Actor

Clean Korean won amounts and dates in Naver or Coupang tables, then compare prices over time. $0.001 per cleaned row. Failed rows are free.

- **URL**: https://apify.com/marktrade/naver-coupang-csv-cleaner.md
- **Developed by:** [Marktrade](https://apify.com/marktrade) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 cleaned rows

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

### What it does

Sellers, analysts and agencies often export tables from Naver Smart Store or Coupang, or collect them with other tools. The prices and dates in those tables tend to be messy. Won amounts show up as text like `1,200만원` (12,000,000 won) or `1억2,300만원` (123,000,000 won). Dates come in mixed forms like `2024년 3월 5일` (March 5, 2024) and `24.3.5`.

This Actor reads your table and returns one clean row for each input row. Prices become whole won numbers, and dates become `2024-03-05`. It adds shipping to get a total, and it can show how each price changed since an earlier observation. It doesn't guess at ranges, formulas or other unclear text.

### Example

Input, with `keyColumns` set to `["상품번호"]` and `compareByDateColumn` set to `"날짜"`. The headers mean product number, date, price and shipping fee.

| 상품번호 | 날짜 | 가격 | 배송비 |
|---|---|---|---|
| DEMO-01 | `2024년 3월 5일` | `38,900원` | 3000 |
| DEMO-01 | `2024.03.08` | `36,900원` | 3000 |

Output:

| rowNumber | dateIso | priceKrw | shippingKrw | totalKrw | previousTotalKrw | differenceKrw | differencePct |
|---|---|---|---|---|---|---|---|
| 2 | 2024-03-05 | 38900 | 3000 | 41900 | null | null | null |
| 3 | 2024-03-08 | 36900 | 3000 | 39900 | 41900 | -2000 | -4.7733 |

### Price comparison

Rows are matched by product ID, option ID, seller or URL, never by name alone. There are two ways to compare:

- `previousDatasetId`: compare with an earlier table.
- `compareByDateColumn`: compare each product's rows in date order inside one table.

Use one or the other. The earlier observation may be several days back, and the Actor doesn't fill in missing days. By default the comparison uses the total (price plus shipping). Set `comparisonBasis` to `price` to compare item price only. If a product is missing from the current table, it is not marked as sold out.

### Input options

Give exactly one of the first three. CSV encodings: UTF-8, EUC-KR, CP949.

- `csvText`: pasted CSV or TSV text.
- `csvFile`: key of an uploaded CSV, TSV or XLSX file.
- `datasetId`: an Apify dataset.
- `keyColumns`: columns that identify a product.
- `compareByDateColumn`: date column for one-table comparison.
- `previousDatasetId`: earlier dataset to compare with.
- `comparisonBasis`: `total` (default) or `price`.
- `maxRows`: rows to process. Default 100, up to 10,000.

### Output fields

Every input row produces one item, failed rows included.

- `rowNumber`, `productKey`, `dateIso`
- `priceKrw`, `shippingKrw`, `totalKrw`
- `previousTotalKrw`, `differenceKrw`, `differencePct`, `changeType`
- `status` and `issues`
- `original`: your source columns and values.

Null means missing or unreadable. You can download CSV, Excel or JSON from the dataset.

### Pricing

You pay per cleaned row: $0.001 per row, or $1 per 1,000 rows. Failed rows are free. There is no start fee. Reading a previous table is free.

### Limits

- File size up to 10 MB, up to 10,000 rows.
- XLSX: active sheet only.
- It does not scrape websites or download URLs.
- If shipping is missing, it stays empty.

### FAQ

**Does it scrape Naver or Coupang?**
No. You supply the table.

**What if shipping is missing?**
Shipping stays empty, and total comparison is blocked. Set `comparisonBasis` to `price` to compare item price.

**Can I compare by product name?**
No. Names alone are rejected. Use a product ID, option ID, seller or URL.

# Actor input Schema

## `csvText` (type: `string`):

Exactly one source is required: csvText, csvFile or datasetId.

## `csvFile` (type: `string`):

Key of a CSV, TSV or XLSX file uploaded to Apify key-value storage. No URLs or local paths.

## `fileStoreId` (type: `string`):

Optional; defaults to the run key-value store.

## `datasetId` (type: `string`):

Input Apify dataset ID.

## `encoding` (type: `string`):

Optional override. If omitted, try UTF-8 (including BOM), then CP949 (also covers EUC-KR).

## `delimiter` (type: `string`):

Text delimiter.

## `columns` (type: `object`):

Map roles to exact header names. Duplicate header names receive \_\_2, \_\_3 suffixes.

## `previousDatasetId` (type: `string`):

Compare with an earlier table; mutually exclusive with compareByDateColumn.

## `keyColumns` (type: `array`):

Exact identity headers, such as product ID, option ID and seller. Product names alone are rejected. Safe IDs or URLs are detected if omitted.

## `compareByDateColumn` (type: `string`):

Exact date header; compare each product against its preceding observation date.

## `conditionColumns` (type: `array`):

Compare only equal conditions. Common option, member and coupon headers are detected when omitted.

## `comparisonBasis` (type: `string`):

Total requires a known shipping fee. Choose price explicitly for item-price-only tables; totals stay empty without shipping.

## `twoDigitYearBase` (type: `integer`):

Base for two digit years.

## `referenceDate` (type: `string`):

Required for 11/5, 오늘 and 어제. Yearless dates use this year without rollover guesses.

## `maxRows` (type: `integer`):

Maximum rows to process.

## Actor input object example

```json
{
  "csvText": "상품번호,날짜,가격,배송비\nDEMO-01,2024년 3월 5일,\"38,900원\",3000\nDEMO-01,2024.03.08,\"36,900원\",3000\n",
  "delimiter": "auto",
  "keyColumns": [
    "상품번호"
  ],
  "compareByDateColumn": "날짜",
  "comparisonBasis": "total",
  "twoDigitYearBase": 2000,
  "maxRows": 100
}
```

# Actor output Schema

## `rows` (type: `string`):

One item per input row, with cleaned won amounts, ISO dates, totals and price changes.

## `summary` (type: `string`):

Counts of input, cleaned and failed rows, compared products and charged rows.

# 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 = {
    "csvText": `상품번호,날짜,가격,배송비
DEMO-01,2024년 3월 5일,"38,900원",3000
DEMO-01,2024.03.08,"36,900원",3000`,
    "keyColumns": [
        "상품번호"
    ],
    "compareByDateColumn": "날짜"
};

// Run the Actor and wait for it to finish
const run = await client.actor("marktrade/naver-coupang-csv-cleaner").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 = {
    "csvText": """상품번호,날짜,가격,배송비
DEMO-01,2024년 3월 5일,\"38,900원\",3000
DEMO-01,2024.03.08,\"36,900원\",3000
""",
    "keyColumns": ["상품번호"],
    "compareByDateColumn": "날짜",
}

# Run the Actor and wait for it to finish
run = client.actor("marktrade/naver-coupang-csv-cleaner").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 '{
  "csvText": "상품번호,날짜,가격,배송비\\nDEMO-01,2024년 3월 5일,\\"38,900원\\",3000\\nDEMO-01,2024.03.08,\\"36,900원\\",3000\\n",
  "keyColumns": [
    "상품번호"
  ],
  "compareByDateColumn": "날짜"
}' |
apify call marktrade/naver-coupang-csv-cleaner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,marktrade/naver-coupang-csv-cleaner"
        }
    }
}
```

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/IMsybpBAeuGoFBN12/builds/dJ6cYQRIwCehs1gSK/openapi.json
