{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Resale Price Check – Mercari & Yahoo Sold Prices",
    "description": "What does it sell for in Japan? One row per keyword and marketplace with median, quartiles, sample size, days-to-sell and USD from recent sold listings on Mercari, Yahoo! Auctions and Yahoo! Flea Market. Optional asking-price rows, condition and price filters, exclude keywords. Read-only, MCP-ready.",
    "version": "0.0",
    "x-build-id": "ae5Ko7gRIAbaXfanK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datalab-jp~japan-resale-price-check/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datalab-jp-japan-resale-price-check",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/datalab-jp~japan-resale-price-check/runs": {
      "post": {
        "operationId": "runs-sync-datalab-jp-japan-resale-price-check",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/datalab-jp~japan-resale-price-check/run-sync": {
      "post": {
        "operationId": "run-sync-datalab-jp-japan-resale-price-check",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Products to price, one per entry, e.g. ['ポケモンカード 151', 'MG ガンダム', 'iPhone 15 Pro 256GB']. Japanese product names match best; each keyword produces one row per selected marketplace (and per price type). If omitted, a health-check for 'ポケモンカード 151' runs. Up to `maxKeywords` entries are processed. A zero-result keyword returns a row with n = 0, a hint, and no charge.",
            "default": [
              "ポケモンカード 151"
            ],
            "items": {
              "type": "string"
            }
          },
          "marketplaces": {
            "title": "Marketplaces",
            "uniqueItems": true,
            "type": "array",
            "description": "Which marketplaces to summarise, e.g. ['mercari'] for a single market. Defaults to all three. Each marketplace is a separate row — sold prices are not pooled across markets because auction and fixed-price levels differ. Yahoo! Auctions sold rows count only closed auctions with at least one bid; flea-market items surfaced by the auctions API are excluded from the auctions row.",
            "items": {
              "type": "string",
              "enum": [
                "mercari",
                "yahoo_auctions",
                "yahoo_fleamarket"
              ],
              "enumTitles": [
                "Mercari (メルカリ)",
                "Yahoo! Auctions (ヤフオク)",
                "Yahoo! Flea Market (Yahoo!フリマ)"
              ]
            },
            "default": [
              "mercari",
              "yahoo_auctions",
              "yahoo_fleamarket"
            ]
          },
          "sampleSize": {
            "title": "Sample size per row",
            "minimum": 50,
            "maximum": 500,
            "type": "integer",
            "description": "How many sold listings to collect per keyword and marketplace before computing statistics, e.g. 100 for a quick check or 500 for a stable median. Defaults to 200; accepts 50–500. Yahoo! Flea Market and Yahoo! Auctions samples are the most recently ended sales; Mercari's search order is not strictly chronological (reported in `sampleOrder`). Larger samples cost more requests but the same price.",
            "default": 200
          },
          "includeAsking": {
            "title": "Also summarise asking prices",
            "type": "boolean",
            "description": "When true, a second row per keyword and marketplace summarises listings currently for sale (`priceType: asking`) next to the sold row, so you can see the gap between what sellers ask and what buyers pay. Defaults to false (sold prices only). Asking rows are billed like sold rows. For auctions the asking price is the current bid or buy-now price as Yahoo indexes it.",
            "default": false
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Words that must not appear in a listing title, e.g. ['まとめ売り', 'ジャンク', 'BOX'] to keep bulk lots and boxes out of a single-card price. Sent to each marketplace's search as an exclusion and enforced again on returned titles (case-insensitive substring). Leave empty to exclude nothing. Excluded listings are counted in `excludedByFilter`, not in `n`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "priceMin": {
            "title": "Minimum price (JPY)",
            "type": "integer",
            "description": "Drop listings priced below this many yen before computing statistics, e.g. 500 to remove obvious mis-listings and accessories. Note this makes the result a conditional distribution — the median is the median of listings within your band. Leave empty for no minimum; must not exceed `priceMax`."
          },
          "priceMax": {
            "title": "Maximum price (JPY)",
            "type": "integer",
            "description": "Drop listings priced above this many yen before computing statistics, e.g. 100000 to remove bundles. Same caveat as `priceMin`: the result becomes the distribution within your band. Leave empty for no maximum."
          },
          "conditionFilter": {
            "title": "Condition",
            "uniqueItems": true,
            "type": "array",
            "description": "Restrict the sample to these condition grades on a common five-step scale, e.g. ['new', 'like_new'] for a near-mint price. Mapped to each marketplace's own codes (Mercari 1–6, Yahoo NEW/USED10–60). Leave empty to include all conditions; the condition mix of the sample is always returned as `condition…Share` columns.",
            "items": {
              "type": "string",
              "enum": [
                "new",
                "like_new",
                "good",
                "fair",
                "poor"
              ],
              "enumTitles": [
                "新品、未使用 (new)",
                "未使用に近い (like new)",
                "目立った傷や汚れなし (good)",
                "やや傷や汚れあり (fair)",
                "傷や汚れあり (poor)"
              ]
            },
            "default": []
          },
          "maxKeywords": {
            "title": "Max keywords",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Upper bound on how many keywords are processed, e.g. 20 for a bounded scheduled job. Defaults to 50; accepts 1–500. Extra keywords are skipped with a log warning. Combine with `maxSummaryRows` to cap cost: rows = keywords × marketplaces × price types.",
            "default": 50
          },
          "maxSummaryRows": {
            "title": "Max summary rows",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on statistics rows produced by the run (each billable row is one keyword × marketplace × price type), e.g. 30 for 10 keywords across three markets. Defaults to 150; accepts 1–5000. Once reached, remaining queries are recorded as skipped_limit in SEARCH_REPORT and not fetched.",
            "default": 150
          },
          "autoRetryKeywordMapping": {
            "title": "Retry zero-result Chinese keywords in Japanese",
            "type": "boolean",
            "description": "When true (default), a keyword that returns zero listings and appears in a small verified alias table (e.g. 宝可梦 → ポケモン, 高达 → ガンダム) is retried once with its Japanese equivalent; `keywordUsed` shows the term actually searched and `keywordMapped` is true. The original keyword is always tried first. Set false to get the plain zero-result row with a hint.",
            "default": true
          },
          "usdJpyRate": {
            "title": "USD→JPY rate (yen per dollar)",
            "type": "string",
            "description": "Optional exchange rate in yen per US dollar, e.g. '154.3', used for the USD columns. When empty the Actor fetches the ECB reference rate from frankfurter.dev at run start (previous business day); if that fails, USD columns are null and `fxStatus` says why. JPY statistics never depend on this."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy settings. By default the Actor connects directly from the Apify platform — on 2026-09-09 all three marketplace endpoints answered direct requests without errors. Enable Apify Proxy here if direct access is ever blocked; the same setting applies to all three marketplaces.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}