# **Mercari.com Search Prompt** (`dtrungtin/mercari-com-search-prompt`) Actor

Scrape Mercari.com listings from a **plain-English prompt** — no URL building required. Describe what you're looking for (for example, *"search apple phone at uk under 500 usd"*), and the Actor uses AI to turn your prompt into multiple targeted Mercari.com search URLs, scrapes the matching listings

- **URL**: https://apify.com/dtrungtin/mercari-com-search-prompt.md
- **Developed by:** [Tin](https://apify.com/dtrungtin) (community)
- **Categories:** AI, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / actor start

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### What does Mercari Search Prompt do?

**Mercari Search Prompt** lets you scrape [Mercari](https://www.mercari.com/) listings from a **plain-English prompt** — no URL building required. Describe what you're looking for (for example, *"iPhone 13 Pro unlocked under 500 USD"*), and the Actor uses AI to turn your prompt into multiple targeted Mercari search URLs, scrapes the matching listings, and stores them as a structured dataset.

Under the hood, it chains two Actors together:

1. [AI Scraper Input Generator](https://apify.com/dtrungtin/ai-scraper-input-generator) converts your prompt into Mercari search URLs.
2. [Mercari.com Scraper](https://apify.com/dtrungtin/mercari-com-scraper) crawls those URLs and extracts the listings.

Because it runs on the Apify platform, you get **API access, scheduling, monitoring, and integrations** (Make, Zapier, webhooks, Google Drive, and more) out of the box.

### Why use Mercari Search Prompt?

- **No manual URL construction** — describe your intent in natural language, and the AI handles Mercari's search URL format, filters, and query variations.
- **Better coverage** — one prompt becomes several targeted search URL variations, surfacing listings a single query would miss.
- **Deal hunting and price monitoring made simple** — schedule a daily run of "used iPhone 13 Pro under $500" and feed the results into a spreadsheet or alerting workflow.
- **Reseller and market research** — track what's listed, at what price, and from which sellers across an entire product category on the secondhand market.
- **Automation-ready** — predictable JSON output that plugs straight into data pipelines and integrations.

### How to use Mercari Search Prompt

1. Open the Actor in Apify Console.
2. In the **Input** tab, enter your search prompt in plain English.
3. Optionally adjust **Max items** to limit how many listings are scraped.
4. Set the Actor's memory to **128 MB or less** in the run options (the Actor enforces this limit, since the heavy lifting happens in the chained Actors).
5. Click **Start** and wait for the run to finish.
6. Open the **Output** tab or the dataset API URL to view and export your results.

### Input

Set the input in the Actor's Input tab. Only the prompt is required.

```json
{
    "prompt": "iPhone 13 Pro unlocked under 500 USD",
    "maxItems": 50
}
```

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| prompt | string | Yes | Plain-English description of what to search for on Mercari. Be specific — brand, condition, budget, and category all improve results. |
| maxItems | integer | No | Maximum number of listings to scrape (default 10). |

### Output

Each scraped Mercari listing is stored as one item in the default dataset. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

Example dataset item:

```json
{
    "url": "https://www.mercari.com/us/item/m1234567890/",
    "name": "iPhone 13 Pro 256GB Unlocked",
    "image": "https://static.mercdn.net/item/detail/orig/photos/m1234567890_1.jpg",
    "priceShow": "$479",
    "price": "479",
    "originalPrice": "599",
    "location": "California",
    "description": ["Excellent condition, unlocked, includes original box and charger."],
    "sellerName": "gadgetdeals",
    "brandName": "Apple",
    "inStock": true,
    "listUrl": "https://www.mercari.com/search/?keyword=iphone%2013%20pro"
}
```

### Data table

| Field | Type | Description |
| --- | --- | --- |
| url | string | Direct link to the Mercari listing |
| name | string | Listing title |
| price | string | Current listing price |
| priceShow | string | Formatted price as displayed on Mercari |
| originalPrice | string | Original price before discount, if any |
| brandName | string | Brand of the item |
| location | string | Item location |
| description | array | Listing description paragraphs |
| sellerName | string | Seller username |
| image | string | Main listing image URL |
| inStock | boolean | Whether the item is still available |
| listUrl | string | The generated search URL the listing was found on |

Exact fields may vary slightly by listing, since not all Mercari listings expose the same attributes.

### How much does it cost to scrape Mercari with a prompt?

A run consists of three parts: this orchestrator Actor (very light — it runs at 128 MB and mostly waits), one short AI Scraper Input Generator run, and the Mercari.com Scraper run whose cost scales with **Max items** (it is priced per Actor start plus a small fee per result). For small runs (tens of items) the total cost is typically a few cents. Use **Max items** to cap the scraping cost of each run. If you are on the Apify free tier, start with a small `maxItems` value to see actual consumption before scaling up.

### Tips

- **Be specific in your prompt.** "Sony WH-1000XM5 headphones, used, under $200" produces much better search URLs than "headphones".
- **Mention condition and budget.** Mercari is a secondhand marketplace — prompts like "like-new Nintendo Switch OLED under $250" map naturally to its listings.
- **US marketplace only.** The scraper targets the US version of Mercari (`www.mercari.com`); Mercari Japan is not supported.
- **Schedule it.** Add the Actor to a Schedule to monitor prices or new listings daily, and connect a webhook or integration to act on the results.
- **Keep memory at 128 MB.** The Actor intentionally refuses to run with more, because the chained Actors do the actual work — extra memory would only add cost.

### FAQ, disclaimers, and support

**Is it legal to scrape Mercari?** This Actor extracts publicly available listing data. You are responsible for reviewing and complying with Mercari's Terms of Service and applicable laws (including data protection regulations) before using the results, especially in automated or commercial workflows.

**Why did my run fail with a memory error?** This Actor requires memory of 128 MB or less. Lower the memory setting in the run options and start it again.

**Why are there no results?** If the AI could not generate valid search URLs from your prompt, the run fails with a clear error — rephrase the prompt with more specific product terms and try again.

Found a bug or need a custom feature? Open an issue in the Actor's **Issues** tab — custom solutions and tailored versions are available on request.

# Actor input Schema

## `prompt` (type: `string`):

Describe what you want to search for on Mercari.com. The Actor will generate search URLs from this prompt and scrape the results.

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

Limit of detail/product pages to be scraped

## Actor input object example

```json
{
  "prompt": "iPhone 13 Pro unlocked under 500 USD",
  "maxItems": 5
}
```

# 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 = {
    "prompt": "iPhone 13 Pro unlocked under 500 USD",
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("dtrungtin/mercari-com-search-prompt").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 = {
    "prompt": "iPhone 13 Pro unlocked under 500 USD",
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("dtrungtin/mercari-com-search-prompt").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "prompt": "iPhone 13 Pro unlocked under 500 USD",
  "maxItems": 5
}' |
apify call dtrungtin/mercari-com-search-prompt --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dtrungtin/mercari-com-search-prompt",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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