{
  "openapi": "3.0.1",
  "info": {
    "title": "Malaysia Grocery Prices & Promo Tracker",
    "description": "One normalised Malaysian grocery price feed from 99 Bulksales, Jaya Grocer and KPDN PriceCatcher, with pack-size parsing, RM per kg / litre / piece unit prices and run-to-run change tracking.",
    "version": "0.1",
    "x-build-id": "2R5zX0tPI1l89jBvg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/subimpact~my-grocery-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-subimpact-my-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/subimpact~my-grocery-prices/runs": {
      "post": {
        "operationId": "runs-sync-subimpact-my-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/subimpact~my-grocery-prices/run-sync": {
      "post": {
        "operationId": "run-sync-subimpact-my-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": {
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Retailer and open-data sources to collect. 99 Bulksales is a wholesale catalogue (sitemap discovery, product pages), Jaya Grocer is a Shopify storefront (/products.json), PriceCatcher is the KPDN open dataset on data.gov.my.",
            "items": {
              "type": "string",
              "enum": [
                "99bulksales",
                "jayagrocer",
                "pricecatcher"
              ],
              "enumTitles": [
                "99 Bulksales (99 Speedmart wholesale)",
                "Jaya Grocer",
                "KPDN PriceCatcher (open data)"
              ]
            },
            "default": [
              "99bulksales",
              "jayagrocer",
              "pricecatcher"
            ]
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Optional. Every word of a term must appear in the product name or slug (case-insensitive). Leave empty to collect the catalogue in source order. The prefill [\"maggi\"] is a small example run.",
            "items": {
              "type": "string"
            }
          },
          "maxItemsPerSource": {
            "title": "Max rows per source",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Cap on delivered rows for each source. 99 Bulksales and PriceCatcher stop fetching once the cap is reached; Jaya Grocer stops paging. Default 15 per source = up to 45 rows.",
            "default": 15
          },
          "jayaProductTypes": {
            "title": "Jaya Grocer product types",
            "type": "array",
            "description": "Optional. Keep only Jaya Grocer products whose product_type equals one of these values (case-insensitive), e.g. Beverages, Frozen.",
            "items": {
              "type": "string"
            }
          },
          "pcRetailers": {
            "title": "PriceCatcher retailers",
            "type": "array",
            "description": "Premise-name patterns used to keep PriceCatcher outlets. Food courts and restaurants are always excluded.",
            "items": {
              "type": "string",
              "enum": [
                "lotuss",
                "aeon",
                "mydin",
                "econsave",
                "99speedmart",
                "giant",
                "tfvalue",
                "nsk",
                "jayagrocer",
                "villagegrocer"
              ],
              "enumTitles": [
                "Lotus's",
                "AEON / AEON BIG",
                "Mydin",
                "Econsave",
                "99 Speedmart",
                "Giant",
                "TF Value-Mart",
                "NSK",
                "Jaya Grocer",
                "Village Grocer"
              ]
            },
            "default": [
              "lotuss",
              "aeon",
              "mydin",
              "econsave",
              "99speedmart"
            ]
          },
          "pcStates": {
            "title": "PriceCatcher states",
            "type": "array",
            "description": "Optional. Keep only outlets in these states, matched case-insensitively (e.g. Selangor, Johor, W.P. Kuala Lumpur).",
            "items": {
              "type": "string"
            }
          },
          "pcItemCategories": {
            "title": "PriceCatcher item categories",
            "type": "array",
            "description": "Optional. Keep only these PriceCatcher item categories, matched case-insensitively (e.g. AYAM, BERAS, MINYAK DAN LEMAK).",
            "items": {
              "type": "string"
            }
          },
          "pcLookbackDays": {
            "title": "PriceCatcher lookback (days)",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "Window ending at the newest date in the data. The latest observation per outlet and item inside the window is returned.",
            "default": 7
          },
          "pcIncludeCookedFood": {
            "title": "Include cooked food",
            "type": "boolean",
            "description": "PriceCatcher also prices cooked dishes (item group MAKANAN SIAP MASAK). Off by default so the feed stays comparable grocery items.",
            "default": false
          },
          "trackChanges": {
            "title": "Track changes between runs",
            "type": "boolean",
            "description": "Compare each row with the last run stored under stateKey and add changeType (new, price_down, price_up, promo_start, promo_end, unchanged), previousPriceRm and previousIsPromo.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Separate change-tracking history per key, e.g. one per product list or region. Sanitised to A-Z, a-z, 0-9, _ and - (max 50 characters).",
            "default": "default"
          },
          "onlyChanges": {
            "title": "Only push changes",
            "type": "boolean",
            "description": "When trackChanges is on, deliver and charge only rows whose changeType is not unchanged. Requires trackChanges.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}