# Mercari Japan Scraper - Listings, Prices & Sold Items (`confidential_gnat/mercari-japan-listings-scraper`) Actor

Scrapes Mercari Japan (jp.mercari.com) listings: price in JPY, on-sale or sold status, condition, category, brand, photos, shipping, seller rating and description. Search by keyword with filters, or use search, item, shop product and seller profile URLs.

- **URL**: https://apify.com/confidential_gnat/mercari-japan-listings-scraper.md
- **Developed by:** [ActorFlow](https://apify.com/confidential_gnat) (community)
- **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.
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 Scraper - Listings, Prices & Sold Items

**Scrape listings from Mercari Japan (jp.mercari.com)**, Japan's largest flea-market app: name, **price in yen**, on-sale or **sold status**, condition, category path, brand, photos, shipping details, seller name and rating, likes, comments and the full description. Covers regular Mercari items and Mercari Shops products. Export the results as **JSON, CSV or Excel**, or call the actor as an **API**. Paste a Mercari search URL or type a keyword, press Start, and get clean **Mercari Japan data**.

**Target website:** [jp.mercari.com](https://jp.mercari.com)

### ✨ Features of this Mercari Japan listings scraper

- **Mercari listing extraction** — id, name, price (JPY), status, condition, category, brand, size, thumbnail and photos, listing dates and seller ID from search results.
- **Item details** — optional description, condition name, full category path, shipping payer, method, origin prefecture and handling time, likes, comments, hashtags, seller name, rating and number of listings, and auction bids.
- **Sold listings for price comps** — scrape sold and in-trade items as well as items on sale.
- **Keyword, price, category and condition filtering** — exclude words, sort by newest, best match, price or likes, ascending or descending.
- **Search, item, shop product and seller URLs** — every filter of a jp.mercari.com search URL is kept; a seller profile URL returns all of that seller's listings.
- **Pagination support** — pages through search results (120 per page) until Max items is reached.
- **Cache to avoid scraping the same items twice** — with a cache project name, listings you already scraped in an earlier run are skipped and not charged, so scheduled runs return only new listings.
- **Proxy support** — optional Apify Proxy, off by default.
- **No browser required** — plain HTTP requests keep runs fast and cheap.

### 🚀 How to scrape Mercari Japan listings in 5 steps

1. [Sign up](https://apify.com/sign-up) for a free Apify account — includes **$5 monthly credit**.
2. Open the actor page and click **Try for free**.
3. Fill in the **Input** fields (a Mercari URL or a search keyword is required).
4. Click **Start** and wait for the run to complete.
5. Download results from the **Output** tab in JSON, CSV, or Excel format.

You can also run this actor via the [Apify API](https://docs.apify.com/api/v2) or integrate it directly into your workflows using [Zapier](https://zapier.com/apps/apify), [Make](https://www.make.com/), or [n8n](https://n8n.io/).

### 💰 Mercari Japan scraper pricing

This actor uses **pay-per-result** billing: you pay for each listing saved to the dataset.

- New Apify accounts include **$5 of free monthly credit**.
- The actor uses plain HTTP requests, so it costs significantly less to run than browser-based scrapers.
- The proxy is disabled by default; leaving it off keeps runs cheapest.
- Listings skipped by the cache are not charged.

### 🔧 Mercari Japan scraper input configuration

| Field | Type | Required | Default | Description |
| ----- | ---- | -------- | ------- | ----------- |
| Mercari Japan URLs (`startUrls`) | array | — | `jp.mercari.com/search?keyword=nintendo switch&status=on_sale` (prefill) | Search, item, Mercari Shops product or seller profile URLs. |
| Max items per search (`maxItems`) | integer | — | `5` | Maximum listings saved per search URL, seller or keyword. |
| Cache project name (`cacheProjectName`) | string | — | — | Same name on every run returns only new listings; cached ones are skipped and not charged. Records get `changeType: new`. |
| Search keywords (`keywords`) | array | — | — | Keywords in Japanese or English. Each keyword is a separate search with the filters below. |
| Exclude keyword (`excludeKeyword`) | string | — | — | Skip listings containing this word. |
| Status (`status`) | string | — | `on_sale` | `on_sale`, `sold_out` (sold or in trade) or `all`. Keyword searches only. |
| Sort by (`sort`) | string | — | `created_time` | `created_time`, `score` (best match), `price` or `num_likes`. |
| Order (`order`) | string | — | `desc` | `desc` or `asc`. |
| Min price (JPY) (`priceMin`) | integer | — | — | Lowest price in yen. |
| Max price (JPY) (`priceMax`) | integer | — | — | Highest price in yen. |
| Category IDs (`categoryIds`) | array | — | — | Mercari category IDs (the `category_id` of a search URL). |
| Item condition (`conditionIds`) | array | — | — | 1 New, 2 Like new, 3 No visible damage, 4 Some damage, 5 Damaged, 6 Bad condition. |
| Scrape item details (`scrapeDetails`) | boolean | — | `false` | Adds description, shipping, likes, comments and seller info. One extra request per item. |
| Proxy configuration (`proxyConfiguration`) | object | — | no proxy | Works without a proxy. |
| Max concurrency (`maxConcurrency`) | integer | — | `5` | Parallel requests. |

![Mercari Japan scraper input form with the Mercari Japan URLs, Max items per search, Cache project name, Search keywords and Exclude keyword fields marked 1 to 5](https://i.postimg.cc/ZY9pNkX3/image.png)

The numbered markers in the screenshot show the fields most runs use:

1. **Mercari Japan URLs**: paste a search, item, Mercari Shops product or seller profile URL.
2. **Max items per search**: how many listings to save for each URL, seller or keyword.
3. **Cache project name**: optional; reuse the same name on every run so listings you already scraped are skipped.
4. **Search keywords**: search without a URL; each keyword is a separate search, in Japanese or English.
5. **Exclude keyword**: skip listings that contain this word.

In the Console, keywords and all other filters sit in the collapsible **Search filters and more options** section below the first three fields.

**Supported URL types:**

- Search: `https://jp.mercari.com/search?keyword=nintendo%20switch&status=sold_out&price_min=10000&category_id=702&sort=price&order=asc`
- Item: `https://jp.mercari.com/item/m28859083473`
- Mercari Shops product: `https://jp.mercari.com/shops/product/2JYCRdLoYbxpFaxcy3gN4Y`
- Seller profile: `https://jp.mercari.com/user/profile/793162340`

### 🔁 Scrape only new Mercari listings with the cache

Mercari listings are re-listed, repeated across searches and returned again by every scheduled run. Using the cache stops you scraping and paying for the same items across multiple runs.

- **How to turn it on**: set the same **Cache project name** (for example `switch-deals`) on every run of the same search.
- **Skipped and not charged**: listings already saved under that name are not saved again, not charged, and do not count towards **Max items per search**.
- **Tagged as new**: every saved record gets `changeType: "new"`.
- **Separate projects**: use a different name per search, brand or seller to keep their histories apart.
- **Best with schedules**: combine it with Apify Schedules and a newest-first sort for a daily feed of fresh listings.

### 📦 Mercari Japan scraper output data

Each listing is one dataset item with the fields `id`, `url`, `itemType`, `name`, `price`, `currency`, `status`, `conditionId`, `condition`, `categoryId`, `categoryName`, `categoryPath`, `brandId`, `brand`, `size`, `thumbnail`, `photos`, `description`, `numLikes`, `numComments`, `hashtags`, `shippingPayerId`, `shippingPayer`, `shippingMethodId`, `shippingMethod`, `shippingFromArea`, `shippingDuration`, `sellerId`, `sellerName`, `sellerRating`, `sellerNumRatings`, `sellerNumSellItems`, `sellerUrl`, `shopId`, `shopName`, `auctionDeadline`, `auctionHighestBid`, `auctionTotalBids`, `createdAt`, `updatedAt`, `scrapedAt`, plus `changeType` when caching is on. Names and descriptive values are in Japanese, as on the site; prices are in Japanese yen. Detail-only fields are `null` unless **Scrape item details** is on. The dataset has **1 view**, **Overview**, a table of photo, ID, name, price, status, condition, brand, category, seller, rating, type, listing date and page link.

**Output at a glance:**

| Name | Price (JPY) | Status | Condition | Category | Seller |
| ---- | ----------- | ------ | --------- | -------- | ------ |
| [Nintendo Switch 有機ELマリオレッド](https://jp.mercari.com/item/m58251562034) | 25,000 | on_sale | 目立った傷や汚れなし | 本体(有機ELモデル) | うり |
| [Nintendo Switch レゴ マーベル スーパー・ヒーローズ 2](https://jp.mercari.com/item/m63372039116) | 1,555 | on_sale | 目立った傷や汚れなし | ソフト(パッケージ版) | ふくろう。:°ஐ |
| [太鼓の達人 Nintendo Switchば〜じょん！](https://jp.mercari.com/item/m44564150024) | 1,800 | on_sale | 目立った傷や汚れなし | ソフト(パッケージ版) | py0nty |
| [新品 ソーラーライト ねこ ガーデンライト](https://jp.mercari.com/item/m27311954218) | 2,500 | on_sale | 新品、未使用 | その他 | じゅん358 |
| [Collar×Malice Nintendo Switch ソフト](https://jp.mercari.com/item/m21898620769) | 6,111 | on_sale | 未使用に近い | ソフト(パッケージ版) | ひびくも／挨拶不要 |

**Sample output (raw JSON):**

```json
{
    "id": "m58251562034",
    "url": "https://jp.mercari.com/item/m58251562034",
    "itemType": "mercari",
    "name": "Nintendo Switch 有機ELマリオレッド",
    "price": 25000,
    "currency": "JPY",
    "status": "on_sale",
    "conditionId": 3,
    "condition": "目立った傷や汚れなし",
    "categoryId": 7005,
    "categoryName": "本体(有機ELモデル)",
    "categoryPath": "ゲーム・おもちゃ・グッズ > テレビゲーム > Nintendo Switch > 本体(有機ELモデル)",
    "brandId": 7572,
    "brand": "Nintendo Switch",
    "size": null,
    "thumbnail": "https://static.mercdn.net/thumb/item/webp/m58251562034_1.jpg?1792081852",
    "photos": [
        "https://static.mercdn.net/item/detail/orig/photos/m58251562034_1.jpg?1792081852",
        "https://static.mercdn.net/item/detail/orig/photos/m58251562034_2.jpg?1792081852"
    ],
    "description": "閲覧いただきありがとうございます。\n\n引越しに伴い家の物を整理しなくてはならず、出品いたします。\n\n- モデル: Nintendo Switch 有機ELモデル\n- カラー: マリオレッド\n- 付属品: Joy-Con左右、ドック、ACアダプター、Joy-Conグリップ、Joy-Conストラップ、HDMIケーブル\n\n動作確認済み・初期化済みです。",
    "numLikes": 0,
    "numComments": 0,
    "hashtags": null,
    "shippingPayerId": 2,
    "shippingPayer": "送料込み(出品者負担)",
    "shippingMethodId": 14,
    "shippingMethod": "らくらくメルカリ便",
    "shippingFromArea": "埼玉県",
    "shippingDuration": "2~3日で発送",
    "sellerId": "233301064",
    "sellerName": "うり",
    "sellerRating": 5,
    "sellerNumRatings": 23,
    "sellerNumSellItems": 25,
    "sellerUrl": "https://jp.mercari.com/user/profile/233301064",
    "shopId": null,
    "shopName": null,
    "auctionDeadline": null,
    "auctionHighestBid": null,
    "auctionTotalBids": null,
    "createdAt": "2026-10-15T16:30:52.000Z",
    "updatedAt": "2026-10-15T16:30:52.000Z",
    "scrapedAt": "2026-10-15T16:31:36.598Z"
}
```

### 🐍 How to scrape Mercari Japan with Python, JavaScript or the API

Run the actor programmatically with the official Apify clients. Replace `<YOUR_API_TOKEN>` with the token from your [Apify Console](https://console.apify.com/account/integrations).

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")

run = client.actor("confidential_gnat/mercari-japan-listings-scraper").call(run_input={
    "keywords": ["ポケモンカード"],
    "status": "sold_out",
    "maxItems": 50,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

**JavaScript** (`npm install apify-client`):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });

const run = await client.actor('confidential_gnat/mercari-japan-listings-scraper').call({
    keywords: ['ポケモンカード'],
    status: 'sold_out',
    maxItems: 50,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**cURL** — start a run and wait for the dataset:

```bash
curl -X POST "https://api.apify.com/v2/acts/confidential_gnat~mercari-japan-listings-scraper/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"keywords": ["ポケモンカード"], "status": "sold_out", "maxItems": 50}'
```

### 💡 What you can use Mercari Japan listing data for

- Pricing resale and import inventory from real **sold prices** (price comps)
- Sourcing Japanese collectibles, trading cards, anime goods, games and fashion for export
- Monitoring new listings for a keyword with scheduled runs and the cache
- Tracking competitor sellers and Mercari Shops stores
- Market research on second-hand demand, price trends and brands in Japan

Resellers, proxy-buying services, collectors, e-commerce analysts and market researchers in retail, collectibles and cross-border trade typically use this data.

### ⚠️ Mercari Japan scraper limitations and known issues

- **15,000 results per search** — Mercari stops at 15,000 results for one search; split large searches by price range or category.
- **Japanese text** — names, conditions, categories and shipping values are returned in Japanese, as Mercari shows them.
- **Detail fields need Scrape item details** — description, shipping names, likes, comments and seller name and rating are `null` without it.
- **Mercari Shops products** — have no seller ID, likes or comments; the shop name, shop rating and review count are returned instead.

### ❓ Mercari Japan scraper FAQ

#### Can I scrape Mercari Japan legally?

The actor only collects listings that Mercari shows publicly to every visitor, without logging in or touching any account. Scraping publicly available data is generally considered lawful (see *hiQ Labs v. LinkedIn*), but you are responsible for complying with Mercari's Terms of Service and applicable laws such as Japan's APPI or GDPR if you process seller names.

#### What data does the Mercari Japan scraper return?

Every listing has its ID, name, price in yen, status, condition ID, category ID, brand, photos, dates and seller ID. Turn on **Scrape item details** to add the description, condition and category names, shipping details, likes, comments, hashtags, seller name and rating, and auction bids.

#### How many Mercari listings can I scrape from one search?

`maxItems` limits the number of listings **per search URL, seller or keyword**, not for the whole run. Mercari itself returns at most 15,000 results for one search, so split bigger searches by price range.

#### Do I need a proxy to scrape jp.mercari.com?

No. The actor works without a proxy by default, which keeps runs cheapest. Turn on Apify Proxy only if you get blocked.

#### How do I scrape Mercari Japan with Python?

Use the Python example above: call the actor with `ApifyClient`, then iterate over the dataset items of the finished run.

#### Can I run this Mercari scraper on a schedule?

Yes. Use Apify Schedules with a newest-first search. Set a **Cache project name** to get only new listings: items already saved under that name are skipped, not charged, and new ones get `changeType: new`. See the caching section above.

#### What formats can I export Mercari Japan data in?

JSON, CSV, Excel, XML and RSS, either from the **Output** tab or through the Apify API.

#### How do I get Mercari sold prices?

Set **Status** to Sold, or use a search URL with `status=sold_out`. Sold and in-trade listings are returned with their final listing price, which is what resellers use as price comps.

### 🔗 Other actors you may find useful

| Scraper | Description |
| ------- | ----------- |
| [🛍️ Carousell Products Scraper](https://apify.com/confidential_gnat/carousell-products-scraper) | Marketplace listings from Carousell.sg by category, search or listing URL: title, price, seller rating, condition, photos and likes. |
| [🛒 Tokopedia Product Scraper](https://apify.com/confidential_gnat/tokopedia-products-scraper) | Indonesian marketplace products from Tokopedia: title, shop, price in IDR, stock, category and images, with cross-run deduplication. |
| [🏁 Cheapest Cars & Bids Scraper](https://apify.com/confidential_gnat/cheapest-carsandbids-scraper) | The cheapest vehicle listings from Cars & Bids, to find the best-value auction deals. |
| [🥦 Woolworths Products Scraper](https://apify.com/confidential_gnat/woolworths-products-scraper) | Australian grocery products: name, brand, price, unit price, package size, availability, ingredients and nutrition. |
| [🍷 Total Wine Scraper](https://apify.com/confidential_gnat/totalwine-scraper) | Wine, liquor and beer prices, sizes, ratings, reviews, ABV, origin and taste profile from Total Wine & More. |

### 💬 Support & contact

If you encounter any issues or have questions, please [open an issue](https://apify.com/confidential_gnat/mercari-japan-listings-scraper/issues/open) or reach out via the [Apify Community Forum](https://community.apify.com/).

You can also find more of our actors on the [Actor Flow](https://apify.com/confidential_gnat) page.

***

### 🇯🇵 メルカリ スクレイパー：使い方（日本語）

このActorは **メルカリ（jp.mercari.com）** の出品情報を自動で取得します。商品名、**価格（円）**、販売状態（出品中・売り切れ）、商品の状態、カテゴリ、ブランド、写真、配送情報、出品者の評価、いいね数、コメント、商品説明まで取得でき、結果は **JSON・CSV・Excel** で保存するか、**API** から利用できます。メルカリShopsの商品にも対応しています。

**使い方：**

1. **Mercari Japan URLs** に、メルカリの検索結果ページ、商品ページ、Shops商品ページ、または出品者プロフィールのURLを入力します。
2. URLを使わない場合は、**Search keywords** に日本語または英語のキーワードを入力します（例：`ポケモンカード`）。キーワードごとに別々に検索されます。
3. **Max items per search** で、検索・出品者ごとの最大取得件数を指定します。
4. 価格帯、カテゴリID、商品の状態、並び順、除外キーワードは、**Search filters and more options** を開いて設定します。
5. **Start** を押して、完了後に **Output** タブから結果をダウンロードします。

**売り切れ（SOLD）の価格を調べる：** **Status** を `sold_out` にすると、売り切れ・取引中の商品も取得できます。実際に売れた価格は、せどり・転売の価格調査や相場確認に役立ちます。

**キャッシュで同じ商品の重複取得を防ぐ：** **Cache project name** に毎回同じ名前（例：`switch-deals`）を入力すると、過去の実行で取得済みの商品はスキップされ、課金もされません。定期実行（スケジュール）と組み合わせると、新着出品だけを効率よく取得できます。新しく保存された商品には `changeType: "new"` が付きます。

**商品説明などの詳細：** **Scrape item details** をオンにすると、商品説明、配送方法、発送元の地域、いいね数、コメント、ハッシュタグ、出品者名と評価が追加されます（商品ごとに1リクエスト増えます）。

**注意事項：**

- 商品名・状態・カテゴリなどの値は、サイトと同じく日本語で返されます。価格は日本円です。
- 1つの検索で取得できるのはメルカリの上限である最大15,000件です。大きな検索は価格帯やカテゴリで分けてください。
- このActorは、誰でも閲覧できる公開情報のみを取得します。ログインや非公開情報へのアクセスは行いません。利用にあたっては、メルカリの利用規約および個人情報保護法（APPI）などの関連法令を遵守してください。

# Actor input Schema

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

jp.mercari.com search URLs with any filters (for example https://jp.mercari.com/search?keyword=nintendo%20switch\&status=on_sale), item pages (https://jp.mercari.com/item/m12345678901), Mercari Shops product pages (https://jp.mercari.com/shops/product/...) or seller profiles (https://jp.mercari.com/user/profile/123456789).

## `scrapeDetails` (type: `boolean`):

Open each item to add the description, condition name, category path, shipping details, likes, comments and seller name and rating. One extra request per item.

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

Maximum listings saved for each search URL, seller or keyword. Mercari returns at most 15,000 results per search; narrow it with price ranges for more.

## `cacheProjectName` (type: `string`):

Use the same name on each scheduled run to get only new listings. Items already scraped under this name are skipped and not charged, and they do not count towards Max items. Each record gets changeType: new.

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

Keywords to search, in Japanese or English (for example ポケモンカード or iPhone 15). Each keyword is a separate search that uses the filters below.

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

Skip listings that contain this word (keyword searches only).

## `status` (type: `string`):

On sale, sold (sold or in trade, useful for price comps) or all listings. Applies to keyword searches; URLs keep their own filters.

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

Sort order of keyword searches.

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

Descending or ascending (for example ascending + Price = cheapest first).

## `priceMin` (type: `integer`):

Lowest price in yen.

## `priceMax` (type: `integer`):

Highest price in yen.

## `categoryIds` (type: `array`):

Mercari category IDs (the category_id value in a jp.mercari.com search URL), for example 702 for Nintendo Switch games.

## `conditionIds` (type: `array`):

Only these conditions. Leave empty for all.

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

Mercari Japan works without a proxy. Enable Apify Proxy only if you get blocked.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://jp.mercari.com/search?keyword=nintendo%20switch&status=on_sale"
    }
  ],
  "scrapeDetails": false,
  "maxItems": 5,
  "status": "on_sale",
  "sort": "created_time",
  "order": "desc",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://jp.mercari.com/search?keyword=nintendo%20switch&status=on_sale"
        }
    ],
    "maxItems": 5,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("confidential_gnat/mercari-japan-listings-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 = {
    "startUrls": [{ "url": "https://jp.mercari.com/search?keyword=nintendo%20switch&status=on_sale" }],
    "maxItems": 5,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("confidential_gnat/mercari-japan-listings-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 '{
  "startUrls": [
    {
      "url": "https://jp.mercari.com/search?keyword=nintendo%20switch&status=on_sale"
    }
  ],
  "maxItems": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call confidential_gnat/mercari-japan-listings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,confidential_gnat/mercari-japan-listings-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/HdJ4EhBTHOabCE24S/builds/vBavgLJSecT3Jncbr/openapi.json
