{
  "openapi": "3.0.1",
  "info": {
    "title": "Mercari Japan Scraper",
    "description": "Scrapes Mercari Japan search results and returns structured listing records with titles, condition, sale status, seller ratings, categories, shipping details and photo links. Supports private-seller listings and Mercari Shops, with optional per-listing details.",
    "version": "0.1",
    "x-build-id": "HvAifeGfHXgolPgm8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/axiomworks~mercari-japan-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-axiomworks-mercari-japan-scraper",
        "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/axiomworks~mercari-japan-scraper/runs": {
      "post": {
        "operationId": "runs-sync-axiomworks-mercari-japan-scraper",
        "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/axiomworks~mercari-japan-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-axiomworks-mercari-japan-scraper",
        "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": {
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keywords to search on Mercari Japan, Japanese or English, e.g. ['nintendo switch', 'ポケモンカード']. Each keyword runs as a separate search. Leave empty if you use startUrls. Missing or blocked targets return no rows; other targets continue.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Mercari URLs",
            "type": "array",
            "description": "Mercari Japan URLs, e.g. [\"https://jp.mercari.com/search?keyword=zelda\"] or [{\"url\":\"https://jp.mercari.com/user/profile/123456789\"}]. Accepts /search?keyword=..., /en/ variants, /user/profile/{sellerId}, /item/{id}, /shops/product/{id}. URL filters override the filter fields. Optional alternative to searchQueries/itemIds; dead or blocked URLs return no rows, other targets continue."
          },
          "itemIds": {
            "title": "Item IDs",
            "type": "array",
            "description": "Mercari listing IDs to refresh directly, e.g. m13418530363. IDs starting with m followed by digits use private-seller details; other alphanumeric IDs use Mercari Shops. Optional alternative to searchQueries/startUrls. Missing or blocked items return no rows.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum listings returned per search query or URL (not shared across targets), 1-5000, default 50. Use 1-5 for a quick test. Item IDs are always one row each.",
            "default": 50
          },
          "includeDetails": {
            "title": "Include listing details",
            "type": "boolean",
            "description": "Fetch each listing detail page data: seller rating, description, category, shipping and likes. Slower; set false for fast search-only fields. Default true.",
            "default": true
          },
          "status": {
            "title": "Listing status",
            "enum": [
              "all",
              "on_sale",
              "sold_out"
            ],
            "type": "string",
            "description": "Which listings to return: 'all' (default), 'on_sale' (still available) or 'sold_out' (already sold, includes in-transaction items; useful for sold price history).",
            "default": "all"
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "price",
              "likes"
            ],
            "type": "string",
            "description": "Sort order: 'relevance' (default), 'newest', 'price' or 'likes'. Direction comes from sortOrder, e.g. sort 'price' with sortOrder 'asc' gives cheapest first.",
            "default": "relevance"
          },
          "sortOrder": {
            "title": "Sort direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "'desc' (default, highest or newest first) or 'asc'.",
            "default": "desc"
          },
          "priceMin": {
            "title": "Minimum price (JPY)",
            "minimum": 0,
            "type": "integer",
            "description": "Only listings priced at least this many yen, e.g. 1000. Leave empty for no minimum."
          },
          "priceMax": {
            "title": "Maximum price (JPY)",
            "minimum": 0,
            "type": "integer",
            "description": "Only listings priced at most this many yen, e.g. 5000. Leave empty for no maximum."
          },
          "conditions": {
            "title": "Item conditions",
            "type": "array",
            "description": "Restrict to these conditions. Allowed: new_unused, like_new, no_noticeable_damage, some_damage, damaged, poor. Empty means all conditions.",
            "items": {
              "type": "string",
              "enum": [
                "new_unused",
                "like_new",
                "no_noticeable_damage",
                "some_damage",
                "damaged",
                "poor"
              ]
            }
          },
          "categoryIds": {
            "title": "Category IDs",
            "type": "array",
            "description": "Mercari category IDs to restrict to, as numbers (the category_id value in a jp.mercari.com search URL), e.g. [7002]. Empty means all categories."
          },
          "excludeKeyword": {
            "title": "Exclude keywords",
            "type": "string",
            "description": "Space-separated words that listings must not contain, e.g. 'junk case'. Optional."
          },
          "brandIds": {
            "title": "Brand IDs",
            "type": "array",
            "description": "Mercari brand IDs to restrict to, as numbers (the brand_id value in a jp.mercari.com search URL), e.g. [1019]. Empty means all brands."
          },
          "sellerIds": {
            "title": "Seller IDs",
            "type": "array",
            "description": "Only listings from these seller IDs (the number in /user/profile/{id}), e.g. ['123456789']. Combine with keywords to search within a seller. Empty means all sellers."
          },
          "freeShippingOnly": {
            "title": "Free shipping only",
            "type": "boolean",
            "description": "If true, only listings where the seller pays shipping (shipping included in the price). Default false.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy settings. Direct requests are used by default; HTTP 403/429 responses trigger proxy fallback and retries on fresh sessions.",
            "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}