{
  "openapi": "3.0.1",
  "info": {
    "title": "Grocery Cart Price & Deal Finder",
    "description": "Compare grocery searches such as ham, milk, eggs near a ZIP code. Groups local in-stock listings into named-brand, store-brand, organic comparison tiers; normalizes unit prices; compares full and split carts; matches weekly-ad deals when product and chain align; and caps downstream source spending.",
    "version": "0.0",
    "x-build-id": "2eRHxPvjqwK6J03eT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rustic_soybean~grocery-cart-price-deal-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rustic_soybean-grocery-cart-price-deal-finder",
        "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/rustic_soybean~grocery-cart-price-deal-finder/runs": {
      "post": {
        "operationId": "runs-sync-rustic_soybean-grocery-cart-price-deal-finder",
        "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/rustic_soybean~grocery-cart-price-deal-finder/run-sync": {
      "post": {
        "operationId": "run-sync-rustic_soybean-grocery-cart-price-deal-finder",
        "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": [
          "cartItems",
          "zipCode"
        ],
        "properties": {
          "cartItems": {
            "title": "Your grocery list",
            "minItems": 1,
            "maxItems": 25,
            "type": "array",
            "description": "Enter one simple item per line: ham, milk, eggs. Brand and package size are optional. To request multiple packages, start a line with a quantity, such as 2 x milk.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            }
          },
          "zipCode": {
            "title": "ZIP code",
            "pattern": "^\\d{5}$",
            "type": "string",
            "description": "U.S. ZIP code used to find local grocery stores and weekly ads."
          },
          "radiusMiles": {
            "title": "Search radius (miles)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Exact in-radius cart totals use known branch coordinates. ZIP-scoped offers without coordinates may still appear in the split-basket estimate, clearly marked with distance unverified.",
            "default": 25
          },
          "retailers": {
            "title": "Stores to include",
            "type": "array",
            "description": "Optional store or chain names, one per line. Leave blank to search up to the 8 closest recognized grocery chains; unrelated businesses found during store discovery are skipped.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 80
            },
            "default": []
          },
          "includeFlyerDeals": {
            "title": "Include weekly-ad sales and coupon mentions",
            "type": "boolean",
            "description": "Looks for current local flyer prices and flags coupon mentions when the flyer source explicitly includes them.",
            "default": true
          },
          "sourceSpendLimitUsd": {
            "title": "Maximum source charges (USD)",
            "minimum": 0.25,
            "maximum": 20,
            "type": "number",
            "description": "Hard total cap for downstream store, product, and weekly-ad source charges. Defaults to $1; the normal 4-item example still permits up to 100 store records, 300 product records, and 40 flyer records. This does not include this Actor's own run price.",
            "default": 1
          },
          "matchMode": {
            "title": "Product matching",
            "enum": [
              "all_tiers",
              "private_label_equivalent",
              "exact_brand_only"
            ],
            "type": "string",
            "description": "Choose whether to compare all product tiers, store-brand candidates only, or listings with the same reported brand. Generic item names still work.",
            "default": "all_tiers"
          },
          "maxProducts": {
            "title": "Maximum live product listings",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Caps upstream product records to control run size and source charges.",
            "default": 300
          },
          "maxFlyerDealsPerItem": {
            "title": "Maximum flyer deals per item",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Caps weekly-ad deal results returned for each grocery item.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}