{
  "openapi": "3.0.1",
  "info": {
    "title": "Target Scraper: Store Inventory, Clearance & Stock Checker",
    "description": "Scrape Target products with price, clearance and the units on hand in each store near a ZIP code. Check stock of any TCIN, UPC or DPCI in all nearby stores (a BrickSeek alternative), list clearance in stock at your store, get only-changes alerts.",
    "version": "0.1",
    "x-build-id": "4weQ2JvPJ23AKb00P"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s_actors~target-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s_actors-target-scraper",
        "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~target-scraper/runs": {
      "post": {
        "operationId": "runs-sync-s_actors-target-scraper",
        "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~target-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-s_actors-target-scraper",
        "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",
              "stock_check",
              "stores"
            ],
            "type": "string",
            "description": "Search products: keywords or category links, with price and units in each store (turn on \"Only clearance\" to list clearance). Check stock: specific products in all Target stores near a ZIP code, like BrickSeek. Find stores: Target stores near a ZIP code with their numbers.",
            "default": "search"
          },
          "keywords": {
            "title": "🔎 Keywords",
            "type": "array",
            "description": "Search mode: what to search on target.com, one per line (e.g. \"lego\", \"air fryer\", \"pokemon cards\").",
            "items": {
              "type": "string"
            }
          },
          "categoryUrls": {
            "title": "🗂️ Category links",
            "type": "array",
            "description": "Search mode: target.com category or brand page links (they end with \"/N-\" and an ID), e.g. https://www.target.com/c/clearance/-/N-5q0ga.",
            "items": {
              "type": "string"
            }
          },
          "products": {
            "title": "🏷️ Products",
            "type": "array",
            "description": "Check stock mode: TCINs (the number after \"A-\" in a target.com link), product links, UPC barcodes or DPCIs (e.g. 204-00-0505), one per line. A product with sizes or colors is checked for each variant.",
            "items": {
              "type": "string"
            }
          },
          "zipCode": {
            "title": "📍 ZIP code",
            "type": "string",
            "description": "US ZIP code. The nearest Target stores are used (see \"Stores to check\")."
          },
          "maxStores": {
            "title": "🏬 Stores to check",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many of the nearest stores to the ZIP code to check (1-20). Each product is returned once per store.",
            "default": 5
          },
          "radiusMiles": {
            "title": "📏 Search radius (miles)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Only stores within this distance from the ZIP code.",
            "default": 30
          },
          "storeIds": {
            "title": "#️⃣ Store numbers",
            "type": "array",
            "description": "Optional: exact Target store numbers (e.g. 3412) instead of the nearest stores, any state. Find them with \"Find stores near a ZIP code\".",
            "items": {
              "type": "string"
            }
          },
          "maxProductsPerSearch": {
            "title": "🔢 Max products per search",
            "minimum": 1,
            "maximum": 1200,
            "type": "integer",
            "description": "Search mode: how many products to take from each keyword or category (24 per page, Target shows up to 1,200).",
            "default": 48
          },
          "sortBy": {
            "title": "↕️ Sort",
            "enum": [
              "relevance",
              "price_low",
              "price_high",
              "newest",
              "bestselling"
            ],
            "type": "string",
            "description": "Search mode: order of the products, as on target.com.",
            "default": "relevance"
          },
          "onlyClearance": {
            "title": "🏷️ Only clearance",
            "type": "boolean",
            "description": "Search inside Target's clearance department. With no keywords, lists all clearance items.",
            "default": false
          },
          "onlyInStock": {
            "title": "✅ Only in stock at the store",
            "type": "boolean",
            "description": "Return only products the store has on the shelf. In search mode the list itself is limited to products sold in the first store.",
            "default": false
          },
          "minDiscountPercent": {
            "title": "💸 Minimum discount %",
            "minimum": 0,
            "maximum": 99,
            "type": "integer",
            "description": "Return only products at least this much off the regular price (clearance or sale). 0 = all.",
            "default": 0
          },
          "maxPrice": {
            "title": "💲 Maximum price ($)",
            "minimum": 0,
            "type": "integer",
            "description": "Return only products at or below this price. Empty = any price."
          },
          "onlyChanges": {
            "title": "🔔 Only report changes",
            "type": "boolean",
            "description": "For scheduled runs. The first run saves prices and stock; later runs return only products whose price dropped or rose, went on clearance, came back in stock or sold out (in your stores or online), or came back in any US store, and products new to the search. You pay only for the changes returned.",
            "default": false
          },
          "minQuantityChange": {
            "title": "📦 Report stock count changes of at least",
            "minimum": 0,
            "type": "integer",
            "description": "Also report when the number of units in a store changes by at least this many. 0 = only in stock / sold out.",
            "default": 0
          },
          "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": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}