{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Used Camera Market — Multi-shop Search, Stats & Alerts",
    "description": "Search, benchmark and monitor Japan's used camera shops (Fujiya Camera, more coming) with a unified schema: normalized condition grades, JPY/USD prices, stock status. Monitor mode emits only new/price-drop/sold-out events and can POST them to Slack/Discord/n8n.",
    "version": "0.4",
    "x-build-id": "koCl3etxttJgHfiAI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/keiya_dev~japan-used-camera-market/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-keiya_dev-japan-used-camera-market",
        "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/keiya_dev~japan-used-camera-market/runs": {
      "post": {
        "operationId": "runs-sync-keiya_dev-japan-used-camera-market",
        "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/keiya_dev~japan-used-camera-market/run-sync": {
      "post": {
        "operationId": "run-sync-keiya_dev-japan-used-camera-market",
        "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",
        "required": [
          "mode",
          "sources"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "stats",
              "monitor",
              "history"
            ],
            "type": "string",
            "description": "search = return listings. stats = model stats of in-stock listings (count, min / median / max by shop & condition grade). monitor = compare against the last run and emit only NEW / PRICE_DROP / PRICE_UP / SOLD_OUT events (use with a Schedule). history = daily min / median / count per model, by shop and condition grade, from stored daily snapshots (no crawling; needs keywords, brands or models). History is collected since 2026-11-05 — treat the first 30 days as indicative.",
            "default": "search"
          },
          "sources": {
            "title": "Shops",
            "type": "array",
            "description": "Which shops to search. Naniwa only exposes its new-arrivals list (~200–300 listings) to crawlers, so it is best for monitor mode; Fujiya, Sanpou and Hard Off (cameras + lenses on sale, ~16,000) are searched in full.",
            "items": {
              "type": "string",
              "enum": [
                "fujiya",
                "sanpou",
                "naniwa",
                "hardoff"
              ],
              "enumTitles": [
                "Fujiya Camera (フジヤカメラ, Nakano Tokyo) — full used stock",
                "Sanpou Camera (三宝カメラ, Jiyugaoka Tokyo) — full used stock",
                "Naniwa / Lemon-sha / Takachiho (カメラのナニワ・レモン社) — new arrivals only",
                "Hard Off Off Mall (ハードオフ オフモール, nationwide) — cameras & lenses on sale"
              ]
            },
            "default": [
              "fujiya",
              "sanpou",
              "naniwa",
              "hardoff"
            ]
          },
          "keywords": {
            "title": "Keywords (OR)",
            "type": "array",
            "description": "Only keep listings whose title/brand contains any of these (case-insensitive, matches Japanese or English). Leave empty to get everything. Examples: \"Leica M6\", \"Voigtlander\", \"X100\", \"Noctilux\".",
            "items": {
              "type": "string"
            }
          },
          "brands": {
            "title": "Brands",
            "type": "array",
            "description": "Optional brand filter (English brand name as the shop prints it, e.g. Leica, Nikon, Canon, SONY, Voigtlander, HASSELBLAD).",
            "items": {
              "type": "string"
            }
          },
          "models": {
            "title": "Model keys (history mode)",
            "type": "array",
            "description": "History mode: only these exact model keys, as shown in the \"model\" field of stats mode (e.g. \"leica m6\", \"fujifilm x100vi\", \"nikon zf\"). Combine with or use instead of keywords.",
            "items": {
              "type": "string"
            }
          },
          "days": {
            "title": "Days of history (history mode)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "History mode: how many days back to return, counting today (JST).",
            "default": 90
          },
          "minPriceJpy": {
            "title": "Min price (JPY)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop listings cheaper than this."
          },
          "maxPriceJpy": {
            "title": "Max price (JPY)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop listings more expensive than this."
          },
          "grades": {
            "title": "Condition grades",
            "type": "array",
            "description": "Keep only these normalized grades. NEW > A > AB+ > AB > AB- > B > ASIS (as-is, no warranty) > PARTS (collection / parts only).",
            "items": {
              "type": "string",
              "enum": [
                "NEW",
                "A",
                "AB+",
                "AB",
                "AB-",
                "B",
                "ASIS",
                "PARTS"
              ]
            }
          },
          "includeSoldOut": {
            "title": "Include sold-out listings",
            "type": "boolean",
            "description": "Search mode: also return listings marked sold out (売り切れ) — the shop keeps them on its listing pages for a while. Stats mode always aggregates in-stock listings only. Monitor mode always tracks sold-out listings internally to detect SOLD_OUT.",
            "default": false
          },
          "fullScan": {
            "title": "Full scan (monitor mode)",
            "type": "boolean",
            "description": "Monitor mode only. Off (default): pages are read newest-first and the crawl stops after 20 already-known listings in a row (normally 1 request per hourly run; each page = 50 listings) — catches NEW listings, but price changes / sell-outs of older listings are missed. On: scan every listing page (Fujiya ≈ 70, Sanpou ≈ 50, Naniwa ≈ 8, Hard Off ≈ 540 requests — about 25 minutes with all four) to catch every PRICE_DROP / PRICE_UP / SOLD_OUT. Tip: schedule a frequent light run plus a daily full scan.",
            "default": false
          },
          "monitorId": {
            "title": "Monitor ID (monitor mode)",
            "type": "string",
            "description": "Optional. Each monitor keeps its own snapshot, keyed by its filters (keywords, brands, grades, price range, includeSoldOut). Set a monitorId to separate several schedules that use the same filters, or to keep the snapshot when you edit the filters. Letters, digits and - _ . only."
          },
          "maxItems": {
            "title": "Max listings",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many matching listings across all selected shops (0 = no limit). Fujiya has ~3,500 used listings, Sanpou ~1,300, Naniwa new arrivals ~200–300, Hard Off ~16,000 cameras and lenses. Ignored in monitor mode.",
            "default": 200
          },
          "jpyPerUsd": {
            "title": "JPY per USD",
            "minimum": 1,
            "type": "number",
            "description": "Exchange rate used for priceUsd. Leave empty to fetch the current rate automatically."
          },
          "alertWebhookUrl": {
            "title": "Alert webhook URL (monitor mode)",
            "type": "string",
            "description": "Optional. In monitor mode every batch of monitor events is POSTed as JSON to this URL. Works with Slack/Discord incoming webhooks, n8n, Make, Zapier."
          },
          "alertEvents": {
            "title": "Monitor events to output",
            "type": "array",
            "description": "Monitor mode: only these event types are written to the dataset, charged, and sent to the webhook.",
            "items": {
              "type": "string",
              "enum": [
                "NEW",
                "PRICE_DROP",
                "PRICE_UP",
                "SOLD_OUT"
              ]
            },
            "default": [
              "NEW",
              "PRICE_DROP"
            ]
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Off by default (direct connection). Datacenter proxies are more likely to be challenged by the shop's bot protection; switch to residential proxy only if runs get blocked.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}