{
  "openapi": "3.0.1",
  "info": {
    "title": "Malaysia Grocery Prices: PriceCatcher Data by State and Shop",
    "description": "Malaysia grocery and food prices from PriceCatcher open data (DOSM and KPDN), collected daily: latest price, price history, price changes and state summaries by item, state, district and shop. Malaysia price data under CC BY 4.0. Not affiliated with DOSM or KPDN.",
    "version": "0.1",
    "x-build-id": "2VUPU75cGCPhatrJt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yappman~malaysia-pricecatcher-grocery-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yappman-malaysia-pricecatcher-grocery-prices",
        "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/yappman~malaysia-pricecatcher-grocery-prices/runs": {
      "post": {
        "operationId": "runs-sync-yappman-malaysia-pricecatcher-grocery-prices",
        "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/yappman~malaysia-pricecatcher-grocery-prices/run-sync": {
      "post": {
        "operationId": "run-sync-yappman-malaysia-pricecatcher-grocery-prices",
        "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": [
              "latest",
              "byItem",
              "byPlace",
              "history",
              "priceChange",
              "stateSummary"
            ],
            "type": "string",
            "description": "What to return. Latest: the last price of each item at each shop in the lookback window. By item and By place: every observation in the lookback window for the items or places you name. History: every observation between two dates. Price change: items whose price moved by at least a percentage. State summary: minimum, median and maximum per item, state and day.",
            "default": "latest"
          },
          "items": {
            "title": "Item words",
            "maxItems": 20,
            "type": "array",
            "description": "Words to find in the item name, group or category (Malay, as the source writes them, such as ayam or beras). An item matches when all the words of one entry are in its text; accents and case are ignored. Up to 20 entries.",
            "items": {
              "type": "string"
            }
          },
          "itemCodes": {
            "title": "Item codes",
            "maxItems": 200,
            "type": "array",
            "description": "PriceCatcher item codes (whole numbers). Up to 200."
          },
          "itemGroup": {
            "title": "Item group",
            "maxLength": 100,
            "type": "string",
            "description": "Words in the item group, such as BARANGAN SEGAR. Accents and case are ignored."
          },
          "itemCategory": {
            "title": "Item category",
            "maxLength": 100,
            "type": "string",
            "description": "Words in the item category, such as SAYUR-SAYURAN. Accents and case are ignored."
          },
          "states": {
            "title": "States",
            "maxItems": 20,
            "type": "array",
            "description": "States as the source writes them (such as Selangor, Pulau Pinang or W.P. Kuala Lumpur); accents and case are ignored. A state that matches no shop gives no rows. Up to 20.",
            "items": {
              "type": "string"
            }
          },
          "districts": {
            "title": "Districts",
            "maxItems": 20,
            "type": "array",
            "description": "Districts as the source writes them. Up to 20.",
            "items": {
              "type": "string"
            }
          },
          "premiseTypes": {
            "title": "Premise types",
            "maxItems": 20,
            "type": "array",
            "description": "Shop types as the source writes them, such as Pasar Basah or Pasar Raya / Supermarket. Up to 20.",
            "items": {
              "type": "string"
            }
          },
          "premiseCodes": {
            "title": "Premise codes",
            "maxItems": 200,
            "type": "array",
            "description": "PriceCatcher premise codes (whole numbers). Up to 200."
          },
          "premiseName": {
            "title": "Words in the shop name",
            "maxLength": 100,
            "type": "string",
            "description": "Words that must all appear in the premise name. Accents and case are ignored."
          },
          "chain": {
            "title": "Chain (guessed)",
            "maxLength": 100,
            "type": "string",
            "description": "The chain guessed from the premise name, such as Mydin or 99 Speedmart. The source has no chain field, so this is a guess from the name."
          },
          "lookbackDays": {
            "title": "Lookback days",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "For latest, by item, by place, price change and state summary (without dates): how many days back from the latest date in the data (1 to 31).",
            "default": 7
          },
          "compareDays": {
            "title": "Compare days (price change)",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "Price change mode: compare the latest price with the price this many days earlier (1 to 31).",
            "default": 7
          },
          "minChangePercent": {
            "title": "Smallest change in percent (price change)",
            "minimum": 0,
            "maximum": 1000,
            "type": "number",
            "description": "Price change mode: keep only moves of at least this many percent, up or down (0 to 1000).",
            "default": 5
          },
          "dateFrom": {
            "title": "Date from (history, state summary)",
            "type": "string",
            "description": "YYYY-MM-DD, not before 2022-01-01 (the oldest month the publisher lists). Needed in history mode; in state summary mode it replaces the lookback window."
          },
          "dateTo": {
            "title": "Date to (history, state summary)",
            "type": "string",
            "description": "YYYY-MM-DD, not after today (Malaysian date), at most 365 days after dateFrom."
          },
          "maxItems": {
            "title": "Most rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows returned (1 to 100,000). Each row is one row event. The default is small so a first run is cheap.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}