{
  "openapi": "3.0.1",
  "info": {
    "title": "Best Buy Canada Store Stock & Clearance Tracker",
    "description": "Best Buy Canada stock at each store near a postal code: units on hand per store, address, distance, regular and sale price, discount and clearance flags. Search, category, clearance or SKU list; rank by discount, distance or stock; track restocks, sell-outs and markdowns.",
    "version": "0.3",
    "x-build-id": "Tlarmrpq5bH3d5TDt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automatic~bestbuy-ca-store-stock/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automatic-bestbuy-ca-store-stock",
        "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/automatic~bestbuy-ca-store-stock/runs": {
      "post": {
        "operationId": "runs-sync-automatic-bestbuy-ca-store-stock",
        "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/automatic~bestbuy-ca-store-stock/run-sync": {
      "post": {
        "operationId": "run-sync-automatic-bestbuy-ca-store-stock",
        "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": [
          "postalCode"
        ],
        "properties": {
          "postalCode": {
            "title": "Postal code",
            "type": "string",
            "description": "Canadian postal code to search around, for example M5V 3L9. Stores are found near this code."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Keep stores within this straight-line distance, from 1 to 50 km.",
            "default": 25
          },
          "maxStores": {
            "title": "Maximum stores",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many of the nearest stores to check, from 1 to 30.",
            "default": 10
          },
          "latitude": {
            "title": "Latitude (optional)",
            "type": "number",
            "description": "Optional exact starting point for distances, for example your home. Stores are still found near the postal code; distances and the radius are then measured from this point. Give longitude too."
          },
          "longitude": {
            "title": "Longitude (optional)",
            "type": "number",
            "description": "Optional exact starting point for distances, used together with latitude."
          },
          "storeTypes": {
            "title": "Store types",
            "uniqueItems": true,
            "type": "array",
            "description": "Which kinds of Best Buy store to include. Regular Best Buy stores by default; add Best Buy Express and Best Buy Mobile for small items such as accessories and phones.",
            "items": {
              "type": "string",
              "enum": [
                "regular",
                "express",
                "mobile",
                "kiosk"
              ],
              "enumTitles": [
                "Regular stores",
                "Best Buy Express",
                "Best Buy Mobile",
                "Express kiosks"
              ]
            },
            "default": [
              "regular"
            ]
          },
          "products": {
            "title": "Products (SKUs or product links)",
            "type": "array",
            "description": "Best Buy Canada SKUs (for example 19860982) or product page links to check. Every listed product is checked.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search",
            "type": "string",
            "description": "Words to search Best Buy Canada for, for example \"oled tv\". Combine with Clearance only or a minimum discount to find deals."
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "Optional Best Buy Canada category link (for example https://www.bestbuy.ca/en-ca/category/laptops-macbooks/20352) or category number."
          },
          "clearanceOnly": {
            "title": "Clearance only",
            "type": "boolean",
            "description": "Only products Best Buy lists as On Clearance.",
            "default": false
          },
          "minDiscount": {
            "title": "Minimum discount",
            "enum": [
              "",
              "20",
              "30",
              "40",
              "50",
              "60"
            ],
            "type": "string",
            "description": "Only products Best Buy lists at this discount or more.",
            "default": ""
          },
          "maxProducts": {
            "title": "Maximum products from the search",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many products to take from the search, category, clearance or discount listing, from 1 to 200. Listed SKUs are always checked on top.",
            "default": 20
          },
          "targetInStockProducts": {
            "title": "Target distinct in-stock products (optional)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Find this many different SKUs with an observed positive unit count at one or more selected local stores (1 to 200). Stores and online units do not count as separate products. Maximum products remains the separate discovery scan budget; row, time and spending limits may yield fewer. Explicitly listed SKUs are checked first and may exceed the target. Leave empty for the existing full scan."
          },
          "includeOutOfStock": {
            "title": "Include out-of-stock stores",
            "type": "boolean",
            "description": "Also return stores that list the product with zero units. Off by default, so you only see stores that have it.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "discount",
              "distance",
              "stock"
            ],
            "type": "string",
            "description": "Biggest discount first, nearest store first, or most units first.",
            "default": "discount"
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many product-store rows to save, from 1 to 5000.",
            "default": 200
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "full",
              "changes"
            ],
            "type": "string",
            "description": "Full saves every product-store row. Changes saves only what moved since the last run with the same state: new rows, stock changes, back in stock, out of stock, price changes and products no longer listed at a store.",
            "default": "full"
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "In Changes mode, a name for this watch list's saved state. Use the same key on every scheduled run. Leave empty to derive it from the place and products."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Connection settings. Apify Proxy is used by default.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}