{
  "openapi": "3.0.1",
  "info": {
    "title": "Dollar General Stock Checker: Inventory, Pokemon & Restocks",
    "description": "Dollar General stock checker and inventory scraper: exact units of any product at every DG store near a ZIP code, with address, phone, hours and distance, plus price, sale price and rating. Search by keyword, product link or UPC. Scheduled runs = restock alerts.",
    "version": "0.1",
    "x-build-id": "AQoBqscvyfnrUYaVZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s_actors~dollar-general-stock-checker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s_actors-dollar-general-stock-checker",
        "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/s_actors~dollar-general-stock-checker/runs": {
      "post": {
        "operationId": "runs-sync-s_actors-dollar-general-stock-checker",
        "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/s_actors~dollar-general-stock-checker/run-sync": {
      "post": {
        "operationId": "run-sync-s_actors-dollar-general-stock-checker",
        "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": "📋 What to do",
            "enum": [
              "search",
              "products"
            ],
            "type": "string",
            "description": "Search: keywords, every product found with its units at the stores near your ZIP codes. Check products: exact products by link or UPC (best for a back-in-stock watchlist).",
            "default": "search"
          },
          "keywords": {
            "title": "🔎 Keywords",
            "type": "array",
            "description": "Search mode: what to search on Dollar General, one per line (e.g. \"pokemon\", \"hot wheels\", \"stanley cup\", \"laundry detergent\"). Searched in the catalog of the nearest store.",
            "items": {
              "type": "string"
            }
          },
          "products": {
            "title": "🏷️ Product links or UPCs",
            "type": "array",
            "description": "Check products mode: dollargeneral.com product links (…/p/<name>/<UPC>) or UPC barcodes, one per line. A link also gives the name, price and rating; a bare UPC gives the units.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "📍 ZIP codes",
            "type": "array",
            "description": "US ZIP codes to check stores around, one per line (or \"latitude, longitude\"): the nearest stores within \"Radius\" (up to \"Stores per ZIP code\").",
            "items": {
              "type": "string"
            }
          },
          "storeNumbers": {
            "title": "🏬 Store numbers",
            "type": "array",
            "description": "Exact Dollar General stores to check, one per line: the store number (e.g. 13141, on the receipt or in the DG store locator).",
            "items": {
              "type": "string"
            }
          },
          "radiusMiles": {
            "title": "📏 Radius (miles)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How far from each ZIP code to look for stores.",
            "default": 15
          },
          "maxStoresPerZip": {
            "title": "🔢 Stores per ZIP code",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "For each ZIP code: how many of the nearest stores to check (up to 100).",
            "default": 10
          },
          "maxProductsPerSearch": {
            "title": "🔢 Max products per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Search mode: how many products to take from each keyword (24 per Dollar General page).",
            "default": 40
          },
          "sortBy": {
            "title": "↕️ Sort search by",
            "enum": [
              "relevance",
              "price_low"
            ],
            "type": "string",
            "description": "Search mode: the order of dollargeneral.com, which decides the products taken.",
            "default": "relevance"
          },
          "onlyInStock": {
            "title": "✅ Only in stock",
            "type": "boolean",
            "description": "Return only rows where the store has the product now.",
            "default": false
          },
          "minUnits": {
            "title": "📦 Minimum units",
            "minimum": 0,
            "type": "integer",
            "description": "Return only stores with at least this many units (e.g. 3 to skip \"last one on the shelf\"). Empty = any."
          },
          "maxPrice": {
            "title": "💲 Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "Return only products at or below this price in USD. Empty = any price."
          },
          "onlyChanges": {
            "title": "🔔 Only report changes",
            "type": "boolean",
            "description": "For scheduled runs. The first run saves units and prices; later runs return only what changed: back in stock at a store, restocked (units went up: a delivery), sold out, price drops and increases, and new products or stores in your searches (e.g. a new Pokemon release). Each row also carries the restocks this monitor has seen and the usual restock weekday. You pay only for the changes returned.",
            "default": false
          },
          "monitorName": {
            "title": "🏷️ Monitor name",
            "type": "string",
            "description": "Separate monitors keep separate memory. Use a different name for each scheduled task.",
            "default": "default"
          },
          "maxConcurrency": {
            "title": "⚡ Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many requests run at the same time.",
            "default": 6
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}