# Mercari Japan & Yahoo! Auctions — Clean Sold Comps & Deals (`ajisai-labs/japan-resale-intel-api`) Actor

Scrape Mercari Japan and Yahoo! Auctions (sold comps & live listings) in one run. Filters junk, box-only & irrelevant items, normalizes conditions to English, converts JPY to USD, and flags underpriced resale deals.

- **URL**: https://apify.com/ajisai-labs/japan-resale-intel-api.md
- **Developed by:** [Ajisai-Labs](https://apify.com/ajisai-labs) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 clean listing items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Mercari Japan & Yahoo! Auctions — Clean Sold Comps, Noise Filter & Deals

Scrape **Mercari Japan** (`jp.mercari.com`) and **Yahoo! Auctions Japan** (`auctions.yahoo.co.jp`, including Yahoo! Flea Market closed sales) in a single lightweight run. Built for **international resellers, sourcing teams, price researchers, and AI agents (MCP)** that need clean Japanese resale benchmarks and underpriced deals — without raw Japanese noise or broken numeric IDs.

### Why Use This Actor Instead of Generic Scrapers?

Raw Japanese marketplace search results are noisy. Generic scrapers return empty boxes (`箱のみ`), untested junk (`ジャンク`), reserved listings (`〇〇様専用`), magazine prize tickets (`応募券`), and unrelated keyword matches alongside raw numeric condition IDs.

- **Dual-Marketplace Coverage in One Call:** Fetch both **sold comps** and **live listings** across Mercari Japan and Yahoo! Auctions simultaneously (~8–11 seconds per run on 512 MB memory).
- **Domain-Native Japanese Noise Filter:** Automatically detects and filters `junk`, `box_or_parts_only`, `reserved_listing`, `bundle_or_lot`, and `irrelevant_match` listings (with negation masking so valid items like `"箱あり"` or `"ジャンクではありません"` are preserved).
- **Outlier-Cleaned Price Benchmarks (JPY & USD):** Computes median, P25, P75, min, max, and mean prices per marketplace and `combined` after removing noise and IQR statistical outliers, converted to USD using live exchange rates.
- **Underpriced Deal Detection:** Compares live fixed-price / buy-now listings against clean sold medians and flags items discounted within your target range (`discount_vs_median_pct`).
- **English-Normalized Flat Schema:** Maps marketplace-specific condition codes (`1`–`6`, `NEW`, `USED20`–`USED60`) and shipping flags into consistent English values (`new`, `like_new`, `good`, `fair`, `poor`, `junk`) ready for JSON, CSV, Excel, n8n, Make, and LLM workflows.
- **No Login or Cookies Required:** Reads public marketplace data using lightweight HTTP requests with automatic proxy escalation only if needed.

***

### Pricing (Pay-Per-Event)

You only pay for clean, filtered results saved to your dataset and summary rows generated:

- **Clean listing item (`clean-listing-item`):** `$2.50 / 1,000` clean listings on Free tier (discounted to **`$2.00 / 1,000`** on Starter and **`$1.50 / 1,000`** on Scale/Business tiers). Noise-filtered items are not billed.
- **Market comps summary (`market-comps-summary`):** `$0.015` per summary row (`mercari`, `yahoo_auctions`, and `combined` — up to `$0.045` per keyword across both markets).
- **Actor start (`apify-actor-start`):** `$0.00005` per run (first 5 seconds of compute waived).

> **Tip:** Set `outputMode` to `"summary_only"` when you only need price benchmarks across dozens of keywords, or `"listings_only"` when you only want clean product feeds.

***

### Input Parameters

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `keywords` | `string[]` | `["Nintendo Switch"]` | One or more search keywords (English or Japanese). |
| `marketplaces` | `string[]` | `["mercari", "yahoo_auctions"]` | Target Japanese marketplaces (`mercari`, `yahoo_auctions`). |
| `includeSold` | `boolean` | `true` | Collect completed/sold listings for price benchmarks. |
| `includeLive` | `boolean` | `true` | Collect active listings and flag underpriced deals. |
| `maxItemsPerMarket` | `integer` | `60` | Maximum raw listings scanned per keyword, marketplace, and status (`10`–`500`). |
| `priceMinJpy` / `priceMaxJpy` | `integer` | – | Optional JPY price bounds. |
| `excludeKeywords` | `string[]` | `[]` | Additional keywords to exclude from results. |
| `excludeNoise` | `boolean` | `true` | Exclude detected noise items (`junk`, `box_or_parts_only`, `reserved_listing`, `irrelevant_match`) from output and stats. |
| `excludeBundles` | `boolean` | `false` | Also exclude multi-item lot/bundle listings (`まとめ売り`). |
| `underpricedThresholdPct` | `number` | `20.0` | Minimum discount (%) below sold median to flag a live listing as `is_underpriced_deal`. |
| `maxUnderpricedDiscountPct` | `number` | `70.0` | Maximum discount (%) cap to prevent cheap accessories from triggering false deals. |
| `outputMode` | `string` | `"both"` | `"both"`, `"listings_only"`, or `"summary_only"`. |
| `usdJpyRate` | `number` | – | Optional manual USD/JPY rate override (uses live FX rate if omitted). |

***

### Output Examples

Results are written to the **Default Dataset** (`record_type: "summary"` and `record_type: "listing"`), and the aggregated report is also saved to the **Key-Value Store** under key `SUMMARY`.

#### 1. Market Comps Summary (`record_type: "summary"`)

```json
{
  "record_type": "summary",
  "keyword": "Nintendo Switch 有機EL 本体",
  "marketplace": "combined",
  "raw_scanned_count": 40,
  "excluded_noise_count": 5,
  "excluded_outlier_count": 4,
  "excluded_breakdown": {
    "irrelevant_match": 3,
    "junk": 2,
    "outlier": 4
  },
  "clean_sample_count": 31,
  "median_jpy": 21300.0,
  "p25_jpy": 19599.0,
  "p75_jpy": 24204.5,
  "min_jpy": 17000,
  "max_jpy": 30000,
  "mean_jpy": 21961.8,
  "median_usd": 134.26,
  "p25_usd": 123.54,
  "p75_usd": 152.57,
  "fx_rate_jpy_to_usd": 0.0063034,
  "fx_status": "live",
  "low_sample_warning": false,
  "live_scanned_count": 40,
  "live_clean_count": 35,
  "underpriced_deals_count": 5
}
```

#### 2. Normalized Listing (`record_type: "listing"`)

```json
{
  "record_type": "listing",
  "keyword": "Nintendo Switch 有機EL 本体",
  "marketplace": "yahoo_auctions",
  "item_id": "z727254690",
  "status": "live",
  "title": "Nintendo Switch ニンテンドースイッチ本体 有機ELモデル",
  "url": "[https://auctions.yahoo.co.jp/jp/auction/z727254690](https://auctions.yahoo.co.jp/jp/auction/z727254690)",
  "price_jpy": 16000,
  "price_usd": 100.85,
  "shipping_included": true,
  "shipping_fee_jpy": 0,
  "buy_now_price_jpy": 16000,
  "is_fixed_price": true,
  "condition_normalized": "poor",
  "raw_condition": "USED60",
  "reference_sold_median_jpy": 21300.0,
  "discount_vs_median_pct": 24.9,
  "is_underpriced_deal": true,
  "is_noise": false,
  "noise_reasons": []
}
```

***

### Use with AI Agents (Apify MCP Server)

This Actor works out-of-the-box with Claude, Cursor, ChatGPT, and n8n via the Apify MCP Server (`https://mcp.apify.com`).

**Prompt template for your AI assistant:**

```text
Use the Apify Actor `ajisai-labs/japan-resale-intel-api` to check Japanese sold prices and live underpriced deals on Mercari Japan and Yahoo! Auctions. Pass `keywords` (Japanese product names give the highest accuracy, e.g. ["ポケモンカード 151 BOX"]), `maxItemsPerMarket: 40`, and `excludeNoise: true`. Summarize the median JPY/USD prices across marketplaces and list any deals with `is_underpriced_deal: true`.
```

***

### Legal & Ethical Notice

This Actor accesses publicly available listing pages without bypassing authentication or paywalls. Users are responsible for complying with applicable laws and the terms of service of target websites.

# Actor input Schema

## `keywords` (type: `array`):

Keywords (English or Japanese) to analyze across Japanese resale marketplaces.

## `marketplaces` (type: `array`):

Target Japanese marketplaces ('mercari', 'yahoo_auctions').

## `includeSold` (type: `boolean`):

Fetch sold/completed listings to compute clean market price benchmarks.

## `includeLive` (type: `boolean`):

Fetch currently active listings and score them against the clean sold median.

## `maxItemsPerMarket` (type: `integer`):

Maximum listings to scan per keyword, marketplace, and status (sold/live).

## `priceMinJpy` (type: `integer`):

Optional lower price bound in JPY.

## `priceMaxJpy` (type: `integer`):

Optional upper price bound in JPY.

## `excludeKeywords` (type: `array`):

Optional negative keywords forwarded to Mercari searchCondition.excludeKeyword.

## `excludeNoise` (type: `boolean`):

Filter out junk, box/parts/guidebook-only, reserved listings, and irrelevant matches from comps and dataset output.

## `excludeBundles` (type: `boolean`):

Also exclude multi-item bundles and lot listings (まとめ売り / ○点セット) from comps and output.

## `underpricedThresholdPct` (type: `number`):

Minimum discount percentage below the clean sold median to flag a live listing as an underpriced deal.

## `maxUnderpricedDiscountPct` (type: `number`):

Upper discount percentage cap to avoid flagging extreme low-price accessories (e.g. 95% off covers/cables) as false deals.

## `outputMode` (type: `string`):

Choose whether to push summaries, listings, or both to the default Dataset. SUMMARY is always saved to Key-Value Store.

## `usdJpyRate` (type: `number`):

Optional fixed JPY per 1 USD exchange rate (e.g. 158.0). If omitted, fetches live rate from Frankfurter API with safe fallback.

## `autoEscalateProxy` (type: `boolean`):

Start requests without a proxy and automatically escalate to JP Residential Proxy only if a marketplace blocks (HTTP 401/403/429).

## `proxyConfiguration` (type: `object`):

Optional Apify Proxy configuration. Leave disabled to use direct requests first with automatic JP Residential escalation.

## Actor input object example

```json
{
  "keywords": [
    "Nintendo Switch"
  ],
  "marketplaces": [
    "mercari",
    "yahoo_auctions"
  ],
  "includeSold": true,
  "includeLive": true,
  "maxItemsPerMarket": 60,
  "excludeKeywords": [],
  "excludeNoise": true,
  "excludeBundles": false,
  "underpricedThresholdPct": 20,
  "maxUnderpricedDiscountPct": 70,
  "outputMode": "both",
  "autoEscalateProxy": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `summary` (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 = {
    "keywords": [
        "Nintendo Switch"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ajisai-labs/japan-resale-intel-api").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 = { "keywords": ["Nintendo Switch"] }

# Run the Actor and wait for it to finish
run = client.actor("ajisai-labs/japan-resale-intel-api").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 '{
  "keywords": [
    "Nintendo Switch"
  ]
}' |
apify call ajisai-labs/japan-resale-intel-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ajisai-labs/japan-resale-intel-api"
        }
    }
}
```

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/mpy5K9pRlNFzF2NSk/builds/LTGvCaIIDeuLB8r8C/openapi.json
