# Mercari Japan Public Search Scraper (`w3crawler/mercari-jp-scraper`) Actor

Extracts public Mercari Japan search listings through the same official public API used by the web search page.

- **URL**: https://apify.com/w3crawler/mercari-jp-scraper.md
- **Developed by:** [w3crawler](https://apify.com/w3crawler) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 listings

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Public Search Scraper

Query the **anonymous public Mercari Japan search API** used by the web search page and save normalized public listings. The Actor returns item identity, JPY price, sale and item status, seller, condition, shipping, category and brand identifiers, images, timestamps, and source provenance when Mercari publishes them. A DPoP proof is generated per run as the normal anonymous web-client proof; no account token, login, proxy credential, private endpoint, or CAPTCHA bypass is used.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/mercari-jp-scraper) and select **Try for free** or open the **Input** tab.
2. Set `query` to the Mercari Japan keyword you need, or supply one or more `startUrls`.
3. Lower `maxItems` for a first test and keep `maxPages` at 1 while checking result quality.
4. Start the Actor, open the dataset, and export the saved records as JSON, CSV, or Excel. Open **Run summary** (`OUTPUT`) to check the outcome and counts.

### Input

All fields are optional; the defaults below are ready to use. Unsupported field names and out-of-range values are rejected before requests start.

| Field | Type | Required? | Default | Meaning |
| --- | --- | --- | --- | --- |
| `query` | string | Optional | `iphone` | Mercari Japan keyword used when `startUrls` is empty, up to 300 characters. |
| `startUrls` | object array | Optional | Not supplied | Optional HTTPS `jp.mercari.com/search` URLs, up to 20 entries. |
| `maxItems` | integer | Optional | `20` | Maximum unique listing records to emit, 1–100. |
| `maxPages` | integer | Optional | `1` | Maximum public API pages per search URL, 1–5. |
| `sort` | string | Optional | `recommended` | `recommended`, `score`, `created_time`, `num_likes`, or `price`. |
| `order` | string | Optional | `desc` | `asc` or `desc`. |
| `status` | string array | Optional | Not supplied | Optional filters: `on_sale`, `trading`, or `sold_out`. |
| `excludeKeyword` | string | Optional | Not supplied | Optional title exclusion, up to 200 characters. |
| `priceMin` | number | Optional | `0` | Only return items at or above this JPY price. |
| `priceMax` | number | Optional | `0` | Only return items at or below this JPY price; `0` leaves the upper bound open. |
| `hasCoupon` | boolean | Optional | `false` | Only return public coupon items. |
| `countryCode` | string | Optional | `JP` | Two-letter public web-client country header; not an account credential. |
| `timeoutSecs` | integer | Optional | `30` | Timeout for each public API request, 5–120 seconds. |
| `maxBytes` | integer | Optional | `5000000` | Maximum API response size accepted for parsing, 1,000–15,000,000 bytes. |
| `userAgent` | string | Optional | Not supplied | Optional transparent user-agent string, up to 300 characters. |

Example input matching the saved `iphone` run:

```json
{
  "query": "iphone",
  "maxItems": 3,
  "maxPages": 1,
  "sort": "recommended",
  "order": "desc",
  "priceMin": 0,
  "priceMax": 0,
  "hasCoupon": false,
  "countryCode": "JP",
  "timeoutSecs": 30,
  "maxBytes": 5000000
}
```

The Actor reads the official public Mercari Japan search API used by the web page. It does not log in or use an account token.

### Output

The dataset contains one row per saved listing. Optional values are omitted when Mercari does not publish them; they are not inferred. No diagnostic or placeholder rows are written.

| Field | Type | Availability | Meaning |
| --- | --- | --- | --- |
| `recordType` | string enum | Always | Record type; always `mercari-jp-listing`. |
| `recordId` | string | Always | Stable record identifier. |
| `sourceUrl` | string | Always | Public search URL that produced the row. |
| `position` | integer | Always | One-based position in the saved result set. |
| `itemId` | string | Always | Mercari item identifier with the `m` prefix. |
| `itemUrl` | string | Always | Canonical public Mercari item URL. |
| `title` | string | Always | Public listing title. |
| `price` | number | Always | Public listing price in JPY. |
| `currency` | string | Always | Currency reported by Mercari. |
| `itemStatus` | string | Always | Public sale status, such as `on_sale`. |
| `itemType` | string | Always | Mercari item type, such as `ITEM_TYPE_MERCARI`. |
| `sellerId` | string | Always | Public seller identifier. |
| `conditionId` | integer | Always | Published condition identifier; the label is not invented. |
| `shippingPayerId` | integer | Always | Published shipping-payer identifier. |
| `shippingMethodId` | integer | Always | Published shipping-method identifier. |
| `categoryId` | integer | Always | Published category identifier. |
| `brandId` | string | When published | Brand identifier when Mercari exposes one. |
| `brandName` | string | When published | Brand name when Mercari exposes one. |
| `brandSubName` | string | When published | Brand sub-name when Mercari exposes one. |
| `shopName` | string | When published | Shop name when the listing belongs to a shop. |
| `imageUrl` | string | Always | Primary public item image URL. |
| `imageUrls` | string array | Always | Bounded public item image URLs. |
| `createdAt` | string | Always | Listing creation timestamp. |
| `updatedAt` | string | Always | Last listing update timestamp. |
| `isLiked` | boolean | Always | Whether the anonymous web-client state marks the item as liked. |
| `promotions` | array | When published | Promotions exposed for the listing. |
| `auction` | object | When published | Auction deadline, bid count, highest bid, and initial price when applicable. |
| `attributes` | object | When published | Additional structured attributes exposed by Mercari. |
| `scrapedAt` | string | Always | Time the record was saved, in ISO UTC. |

The example below is a real saved row from the 2026-10-25 run. Every value is unchanged.

```json
{
  "recordType": "mercari-jp-listing",
  "recordId": "listing:f84ccb2354c0a71ece188835",
  "sourceUrl": "https://jp.mercari.com/search?keyword=iphone",
  "position": 2,
  "itemId": "m90523833212",
  "itemUrl": "https://jp.mercari.com/item/m90523833212",
  "title": "【ジャンク品】 Apple iPhone15 本体",
  "price": 400,
  "currency": "JPY",
  "itemStatus": "on_sale",
  "itemType": "ITEM_TYPE_MERCARI",
  "sellerId": "813968375",
  "conditionId": 4,
  "shippingPayerId": 2,
  "shippingMethodId": 14,
  "categoryId": 859,
  "brandId": "3272",
  "brandName": "Apple",
  "brandSubName": "Apple",
  "imageUrl": "https://static.mercdn.net/item/detail/webp/photos/m90523833212_1.jpg?1792939349",
  "imageUrls": [
    "https://static.mercdn.net/item/detail/webp/photos/m90523833212_1.jpg?1792939349",
    "https://static.mercdn.net/thumb/item/webp/m90523833212_1.jpg?1792939349"
  ],
  "createdAt": "2026-10-25T14:42:29.000Z",
  "updatedAt": "2026-10-25T20:22:37.000Z",
  "isLiked": false,
  "auction": {
    "bidDeadline": "2026-10-27T11:16:00Z",
    "totalBid": "2",
    "highestBid": "400",
    "initialPrice": "300"
  },
  "scrapedAt": "2026-10-25T20:48:08.239Z"
}
```

### Run summary

**Run summary** is stored separately from the dataset in the run's key-value store under `OUTPUT`.

| Field | Meaning |
| --- | --- |
| `status` | Run outcome: `SUCCEEDED` or `FAILED`. |
| `runStatus` | Canonical run status; matches `status`. |
| `dataStatus` | Dataset completeness: `COMPLETE`, `PARTIAL`, `NO_RESULTS`, or `FAILED`. |
| `actorName` | Actor display name. |
| `actorSlug` | Actor store slug. |
| `inventoryRank` | Catalog inventory rank recorded for provenance. |
| `recordCount` | Listing rows saved to the dataset. |
| `resultCount` | Alias of `recordCount`. |
| `listingCount` | Alias of `recordCount`. |
| `diagnosticCount` | Request or extraction issues recorded outside the dataset. |
| `diagnosticCodes` | Diagnostic codes collected during the run. |
| `queryCount` | Search queries represented by the source URLs. |
| `uniqueRecordCount` | Distinct listing keys after deduplication. |
| `duplicateCount` | Rows discarded as duplicate listing keys. |
| `sourceTransport` | Transport used for the run, usually `direct`. |
| `fixtureMode` | Whether a repository-local fixture was used. |
| `generatedBy` | Generator metadata. |
| `generatedAt` | UTC summary creation time. |
| `apiEndpoint` | Public API endpoint used for live requests. |

| Status | Data status | Meaning |
| --- | --- | --- |
| `SUCCEEDED` | `COMPLETE` | Listings were saved without an extraction problem. |
| `SUCCEEDED` | `PARTIAL` | Listings were saved, but a later problem prevented a complete run. Saved rows remain available. |
| `SUCCEEDED` | `NO_RESULTS` | The source completed cleanly and returned no matching listings. |
| `FAILED` | `FAILED` | A fatal error occurred before any usable listing was saved. |

Example `OUTPUT` from the 2026-10-25 run:

```json
{
  "status": "SUCCEEDED",
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "actorName": "Mercari Japan Public Search Scraper",
  "actorSlug": "mercari-jp-scraper",
  "inventoryRank": 658,
  "recordCount": 3,
  "resultCount": 3,
  "listingCount": 3,
  "diagnosticCount": 0,
  "diagnosticCodes": [],
  "queryCount": 1,
  "uniqueRecordCount": 3,
  "duplicateCount": 0,
  "sourceTransport": "direct",
  "fixtureMode": false,
  "generatedBy": "Codex with GPT-5.6 Luna",
  "generatedAt": "2026-10-25T20:48:08.463Z",
  "apiEndpoint": "https://api.mercari.jp/v2/entities:search"
}
```

### Coverage and limitations

The Actor uses the anonymous public Mercari Japan search API that backs the web search page. The DPoP header is generated locally as the ordinary anonymous client proof; it is not an account credential. Requests are bounded by `maxItems`, `maxPages`, `timeoutSecs`, and `maxBytes`. Numeric condition, shipping, and category identifiers are retained as published; labels are not guessed and no extra private request is made. Prices are point-in-time JPY values. Optional fields are omitted when the source does not publish them, and blocked, empty, or partial responses are reported in the run summary rather than written as data rows.

### Usage and support

Apify charges standard Actor compute, network, and storage usage. Start with a small `maxItems` and one query, inspect the dataset and `OUTPUT`, then scale pages gradually. See the Actor's Pricing tab for current account rates. Use the [Actor Issues page](https://apify.com/w3crawler/mercari-jp-scraper/issues) to report a problem. Include the run ID, the input used, and the run summary; do not include tokens, cookies, or private data. This Actor is not affiliated with or endorsed by Mercari. Use it only for public data and in accordance with Mercari's terms, robots guidance, and applicable law.

# Actor input Schema

## `query` (type: `string`):

Mercari Japan keyword used when startUrls is empty.

## `startUrls` (type: `array`):

Optional HTTPS jp.mercari.com/search URLs.

## `maxItems` (type: `integer`):

Maximum unique listing records to emit.

## `maxPages` (type: `integer`):

Maximum public API pages per search URL.

## `sort` (type: `string`):

recommended, score, created_time, num_likes, or price.

## `order` (type: `string`):

asc or desc.

## `status` (type: `array`):

Optional values: on_sale, trading, or sold_out.

## `excludeKeyword` (type: `string`):

Optional title exclusion.

## `priceMin` (type: `number`):

Only return items at or above this price.

## `priceMax` (type: `number`):

Only return items at or below this price.

## `hasCoupon` (type: `boolean`):

Only return public coupon items.

## `countryCode` (type: `string`):

Two-letter public web-client country header; not an account credential.

## `timeoutSecs` (type: `integer`):

Timeout for each official public API request.

## `maxBytes` (type: `integer`):

Maximum API response size accepted for parsing.

## `userAgent` (type: `string`):

Optional transparent user-agent string.

## Actor input object example

```json
{
  "query": "iphone",
  "maxItems": 20,
  "maxPages": 1,
  "sort": "recommended",
  "order": "desc",
  "priceMin": 0,
  "priceMax": 0,
  "hasCoupon": false,
  "countryCode": "JP",
  "timeoutSecs": 30,
  "maxBytes": 5000000
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (type: `string`):

Run status and counters stored by the Actor.

# 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("w3crawler/mercari-jp-scraper").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("w3crawler/mercari-jp-scraper").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 '{}' |
apify call w3crawler/mercari-jp-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/mercari-jp-scraper"
        }
    }
}
```

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/SIjj3UXYpYZGiR4QD/builds/dteBawsi4vXQ6gULe/openapi.json
