{
  "openapi": "3.0.1",
  "info": {
    "title": "Shrinkflation Detector for Grocery Price Data",
    "description": "Find shrinkflation in grocery and retail product data: smaller packs at the same or higher price. Compare two runs of a supermarket scraper or your own snapshots and get size before and after, price, price per 100 g / ml / item and the hidden price rise per product. No AI.",
    "version": "0.1",
    "x-build-id": "bEkgMaBKSsZFyqx9s"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ultimatemc~shrinkflation-detector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ultimatemc-shrinkflation-detector",
        "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/ultimatemc~shrinkflation-detector/runs": {
      "post": {
        "operationId": "runs-sync-ultimatemc-shrinkflation-detector",
        "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/ultimatemc~shrinkflation-detector/run-sync": {
      "post": {
        "operationId": "run-sync-ultimatemc-shrinkflation-detector",
        "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": {
          "products": {
            "title": "Product snapshots",
            "type": "array",
            "description": "One row per product per date, with \"id\", \"name\", \"size\" (optional if the name contains it, e.g. \"200g\" or \"12 x 12 fl oz\"), \"price\" and \"date\". The prefill is made-up example data showing one shrink; replace it with your own. To compare two runs of a grocery scraper, use the dataset fields below instead."
          },
          "beforeDatasetId": {
            "title": "Older dataset (optional)",
            "type": "string",
            "description": "Dataset from an earlier run of a grocery or e-commerce scraper (Coles, Woolworths, ALDI, Lidl, Tesco, Walmart and others). Product ID, name, size and regular price fields are detected automatically."
          },
          "afterDatasetId": {
            "title": "Newer dataset (optional)",
            "type": "string",
            "description": "Dataset from a later run of the same scraper. Products are matched by ID, then by name without the size if the ID changed."
          },
          "report": {
            "title": "What to report",
            "enum": [
              "shrinkflation",
              "sizeChanges",
              "allChanges",
              "everything"
            ],
            "type": "string",
            "description": "Only matching rows are saved, and you pay per saved row.",
            "default": "sizeChanges"
          },
          "matchByName": {
            "title": "Match by name when the ID changes",
            "type": "boolean",
            "description": "Brands often give a smaller pack a new barcode. When on, a product seen only in the older snapshot is joined to one seen only in the newer snapshot if their names match once the size is removed (same retailer).",
            "default": true
          },
          "reportEveryStep": {
            "title": "Report every change step",
            "type": "boolean",
            "description": "With 3 or more snapshots, report each step separately instead of only the latest size change (or first-to-last).",
            "default": false
          },
          "keyField": {
            "title": "Product ID field (optional)",
            "type": "string",
            "description": "Field that identifies a product across snapshots, e.g. \"sku\" or \"stockcode\". Leave empty to detect it (id, sku, productId, product_id, ean, gtin, url ...)."
          },
          "nameField": {
            "title": "Name field (optional)",
            "type": "string",
            "description": "Leave empty to detect (name, title, productName ...)."
          },
          "sizeField": {
            "title": "Size field (optional)",
            "type": "string",
            "description": "Leave empty to detect (size, packSize, packaging, unitSize, netWeight ...). If no size field has a value, the size is read from the name."
          },
          "sizeUnit": {
            "title": "Unit for numeric sizes (optional)",
            "type": "string",
            "description": "Only if the size field is a bare number, e.g. \"g\", \"ml\" or \"oz\"."
          },
          "priceField": {
            "title": "Price field (optional)",
            "type": "string",
            "description": "Leave empty to use the regular (non-promotional) price when the data has one (regularPrice, original_price, priceNormal, wasPrice ...), else price."
          },
          "dateField": {
            "title": "Date field (optional)",
            "type": "string",
            "description": "Leave empty to detect (date, scrapedAt, scraped_at, timestamp ...)."
          },
          "minUnitPriceRisePct": {
            "title": "Minimum unit-price rise to flag (%)",
            "minimum": 0,
            "type": "integer",
            "description": "For a smaller pack with a lower price, flag it only if the price per 100 g / 100 ml / item rose at least this much.",
            "default": 2
          },
          "maxItems": {
            "title": "Max rows to read",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum rows read from each source.",
            "default": 50000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}