{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Matcha & Tea Stock & Price Monitor",
    "description": "Monitor official Japanese tea-shop online stores (d:matcha Kyoto, Horii Shichimeien, Yamamotoyama): matcha and Japanese tea stock, sell-outs, price changes, purchase-limit notices and new products per size.",
    "version": "0.0",
    "x-build-id": "6u4yvJL8dqCafdQF2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datalab-jp~japan-matcha-tea-stock-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datalab-jp-japan-matcha-tea-stock-monitor",
        "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-matcha-tea-stock-monitor/runs": {
      "post": {
        "operationId": "runs-sync-datalab-jp-japan-matcha-tea-stock-monitor",
        "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-matcha-tea-stock-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-datalab-jp-japan-matcha-tea-stock-monitor",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "changes",
              "snapshot"
            ],
            "type": "string",
            "description": "What to return: 'changes' = only what changed since the previous run (restocked, sold_out, price_up, price_down, new_product, purchase_limit_changed, removed); 'snapshot' = every matching variant with current price and stock. In 'changes' mode the first run per store returns everything as 'first_run' (baseline); schedule later runs to get alerts. Defaults to 'snapshot' when omitted. Both modes compare with and update the state in `stateStoreName`.",
            "default": "snapshot"
          },
          "stores": {
            "title": "Tea shops",
            "uniqueItems": true,
            "type": "array",
            "description": "Official Japanese tea-shop online stores to read, e.g. ['dmatcha'] or ['dmatcha', 'horii-shichimeien']. Only stores whose terms of use do not restrict this use are supported (d:matcha Kyoto, Horii Shichimeien, Yamamotoyama). Defaults to all 3 supported stores when omitted. Each store's whole public catalogue is read once per run (1–2 requests), and the filters below are applied afterwards.",
            "items": {
              "type": "string",
              "enum": [
                "dmatcha",
                "horii-shichimeien",
                "yamamotoyama"
              ],
              "enumTitles": [
                "d:matcha Kyoto",
                "Horii Shichimeien 堀井七茗園",
                "Yamamotoyama 山本山"
              ]
            },
            "default": [
              "dmatcha",
              "horii-shichimeien",
              "yamamotoyama"
            ]
          },
          "categories": {
            "title": "Tea categories",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only these product types, e.g. ['matcha'] or ['matcha', 'gyokuro', 'hojicha']. The category is assigned from the product title/type in Japanese and English, so English category names work on Japanese-titled stores. Defaults to ['matcha'] when omitted; pass an empty list [] to get every product including sweets, teaware and gifts. Sweets made with matcha are 'sweets', not 'matcha'; tea bags are 'teabag'.",
            "items": {
              "type": "string",
              "enum": [
                "matcha",
                "gyokuro",
                "kabusecha",
                "sencha",
                "hojicha",
                "genmaicha",
                "bancha",
                "black_tea",
                "other_tea",
                "teabag",
                "gift_set",
                "sweets",
                "teaware",
                "event",
                "other"
              ],
              "enumTitles": [
                "Matcha 抹茶",
                "Gyokuro 玉露",
                "Kabusecha かぶせ茶",
                "Sencha 煎茶",
                "Hojicha ほうじ茶",
                "Genmaicha 玄米茶",
                "Bancha 番茶",
                "Japanese black tea 和紅茶",
                "Other tea",
                "Tea bags",
                "Gift sets",
                "Tea sweets",
                "Teaware & utensils",
                "Events / classes",
                "Other (non-tea items)"
              ]
            },
            "default": [
              "matcha"
            ]
          },
          "keywords": {
            "title": "Keywords (optional)",
            "type": "array",
            "description": "Keep only products whose title, size, type, tags or SKU contain any of these words, e.g. ['奥ノ山'] or ['宇治', '玉露']. Store titles are Japanese; English or Chinese tea-type words (matcha→抹茶, sencha→煎茶, hojicha→ほうじ茶, 焙茶→ほうじ茶) are retried with a verified alias when they match nothing in a store. Defaults to no keyword filter. Combined with `categories` (both must match).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "changeTypes": {
            "title": "Change types to return",
            "uniqueItems": true,
            "type": "array",
            "description": "In 'changes' mode, return only these kinds of change, e.g. ['restocked'] for back-in-stock alerts or ['price_up', 'price_down'] for price tracking. A row matches if any of its changes is listed (a variant can be restocked and repriced at once). Defaults to all change types when empty. Ignored in 'snapshot' mode; changes filtered out here are still recorded in the state and are not reported again.",
            "items": {
              "type": "string",
              "enum": [
                "new_product",
                "new_variant",
                "restocked",
                "sold_out",
                "price_up",
                "price_down",
                "purchase_limit_changed",
                "removed",
                "first_run"
              ],
              "enumTitles": [
                "New product",
                "New size/variant",
                "Back in stock",
                "Sold out",
                "Price increase",
                "Price decrease",
                "Purchase-limit notice changed",
                "Removed from store",
                "First run (baseline)"
              ]
            },
            "default": []
          },
          "onlyAvailable": {
            "title": "Only in-stock items (snapshot)",
            "type": "boolean",
            "description": "In 'snapshot' mode, drop variants that are currently sold out, e.g. to list only what can be ordered right now. Availability is the store's own in-stock flag for each size/variant. Defaults to false (sold-out variants are included with available=false). Ignored in 'changes' mode, where sell-outs are reported as 'sold_out' events.",
            "default": false
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum rows for the whole run, e.g. 100 for a quick check or 1000 for every product in every store (about 510 variants in October 2026). Each row is one billable result, so this is your cost cap. Defaults to 1000 when omitted; accepts 1–20000. If a store's output is cut off, its state is not updated, so the missing changes are reported on the next run.",
            "default": 1000
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Name of the key-value store in YOUR Apify account that keeps the previous run's prices and stock, e.g. 'japan-matcha-tea-monitor' or 'matcha-restock-alerts'. Letters, digits and hyphens only (max 63). Defaults to 'japan-matcha-tea-monitor'. Use a different name for each schedule with different filters so one monitor does not consume another's changes; a new name starts a new baseline.",
            "default": "japan-matcha-tea-monitor"
          },
          "autoRetryKeywordMapping": {
            "title": "Retry zero-hit keywords with aliases",
            "type": "boolean",
            "description": "When a keyword matches nothing in a store, retry it once with a verified alias, e.g. 'matcha' → '抹茶' or 'hojicha' → 'ほうじ茶'. Only aliases checked against real store titles are used. Defaults to true. The run log and the RUN_REPORT record show which word was actually used for each store.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy for reading the stores' public product feeds, e.g. {'useApifyProxy': true} (Apify datacenter proxy) or {'useApifyProxy': false} (direct). Shopify rate-limits per IP and has answered HTTP 429 to a bare cloud IP while allowing the datacenter proxy, so it is on by default. Defaults to Apify datacenter proxy; residential proxy is not needed. Requests go one at a time with pauses and automatic retries on 429.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}