search_daangn
Find items for sale on Daangn Market (당근마켓) using keyword and optional region filter. Returns listings with customizable max count up to 100.
Instructions
Search Daangn Market (당근마켓) listings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | Search keyword in Korean or English | |
| region | No | Optional region filter (e.g. '서울', '강남구') | |
| max_items | No | Maximum number of listings to return (default 30, max 100) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/korean_data_mcp/server.py:116-140 (handler)Handler function for the 'search_daangn' MCP tool. Accepts keyword, optional region, and max_items; caps max_items at 100; delegates to the Apify actor 'oxygenated_quagmire/daangn-market-scraper'.
@mcp.tool() async def search_daangn( keyword: str, region: str = "", max_items: int = 30, ) -> list[dict]: """ Search Daangn Market (당근마켓) listings. Args: keyword: Search keyword in Korean or English region: Optional region filter (e.g. '서울', '강남구') max_items: Maximum number of listings to return (default 30, max 100) Returns: List of listing objects with title, price, location, image, url fields. """ max_items = min(max_items, 100) input_data: dict[str, Any] = {"keyword": keyword, "maxItems": max_items} if region: input_data["region"] = region return await _run_actor( f"{APIFY_ACCOUNT}/daangn-market-scraper", input_data, ) - src/korean_data_mcp/server.py:116-116 (registration)Registration of 'search_daangn' as an MCP tool via the @mcp.tool() decorator from FastMCP.
@mcp.tool() - Input schema: keyword (str, required), region (str, optional, default ''), max_items (int, optional, default 30, max 100). Output: list[dict].
async def search_daangn( keyword: str, region: str = "", max_items: int = 30, ) -> list[dict]: - src/korean_data_mcp/server.py:34-43 (helper)Helper function that runs an Apify actor and returns dataset items. Called by search_daangn to invoke 'daangn-market-scraper'.
async def _run_actor(actor_id: str, input_data: dict, timeout_secs: int = 60) -> list[dict]: """Run an Apify actor synchronously and return dataset items.""" token = _get_token() url = f"{APIFY_BASE}/acts/{actor_id}/run-sync-get-dataset-items" params = {"token": token} async with httpx.AsyncClient(timeout=timeout_secs + 10) as client: resp = await client.post(url, json=input_data, params=params) resp.raise_for_status() return resp.json()