{
  "openapi": "3.0.1",
  "info": {
    "title": "Target Scraper: Products, Prices & Store Stock",
    "description": "Target scraper for searches, categories, product URLs, TCINs and UPCs: price, sale price, UPC, DPCI, ratings and variants, plus units in stock at each store near a ZIP code. Changes-only alerts for price drops and restocks.",
    "version": "0.1",
    "x-build-id": "E8AoBaCWt2JjESRWb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cleanpull~target-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cleanpull-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/cleanpull~target-scraper/runs": {
      "post": {
        "operationId": "runs-sync-cleanpull-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/cleanpull~target-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-cleanpull-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Words to search on Target, one per line, as you would type them on target.com. The products come in Target's order, up to the limit per search below.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Target URLs",
            "type": "array",
            "description": "Optional. target.com addresses: a search (/s?searchTerm=…), a category (/c/…/-/N-…) or a product (/p/…/A-12345678). A search or category address may carry the site's sort (sortBy=PriceLow).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "tcins": {
            "title": "TCINs",
            "type": "array",
            "description": "Optional. Target item numbers (TCIN, the digits after A- in a product address), one per line. Each product is read with its UPC, variants, star breakdown and description.",
            "items": {
              "type": "string"
            }
          },
          "upcs": {
            "title": "UPCs",
            "type": "array",
            "description": "Optional. UPC or EAN barcodes, one per line. Each is looked up on Target and delivered only when Target's product states that barcode.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSearch": {
            "title": "Products per search",
            "minimum": 1,
            "maximum": 1200,
            "type": "integer",
            "description": "How many products to deliver from each search or category (Target shows 24 per page; the actor follows the pages).",
            "default": 24
          },
          "maxResults": {
            "title": "Max products in total",
            "minimum": 1,
            "type": "integer",
            "description": "Optional. The most product rows the run delivers, over every search and lookup."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "featured",
              "priceLow",
              "priceHigh",
              "rating",
              "bestselling",
              "newest"
            ],
            "type": "string",
            "description": "The order of search and category results, as on target.com. A sort in a Target URL wins for that URL.",
            "default": "relevance"
          },
          "includeStoreStock": {
            "title": "Store stock",
            "type": "boolean",
            "description": "Also read how many units each store has: the stores near the ZIP code (with distance) and the one store id below (with its aisle). Billed per stock lookup: one for the stores near the ZIP code (up to Max stores), one for the store id.",
            "default": false
          },
          "zipCode": {
            "title": "ZIP code",
            "pattern": "^\\d{5}$",
            "type": "string",
            "description": "A US ZIP code: stock is read at the Target stores near it, nearest first."
          },
          "storeId": {
            "title": "Store id",
            "pattern": "^\\d{1,5}$",
            "type": "string",
            "description": "Optional. One Target store's id (as in the store's page address): its units and aisle, and its prices for store-priced items such as groceries. Also adds its in-store assortment to searches."
          },
          "radiusMiles": {
            "title": "Radius (miles)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How far from the ZIP code stores are read.",
            "default": 50
          },
          "maxStores": {
            "title": "Stores per product",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "The most nearby stores read for each product (Target answers about 20).",
            "default": 20
          },
          "inStockOnly": {
            "title": "In stock at a store only",
            "type": "boolean",
            "description": "Keep only products with units at one or more of the stores read (needs store stock). Search results already leave out products Target cannot sell.",
            "default": false
          },
          "onSaleOnly": {
            "title": "On sale only",
            "type": "boolean",
            "description": "Keep only products priced below their regular price.",
            "default": false
          },
          "minPrice": {
            "title": "Min price (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Optional. Keep only products at this price or higher."
          },
          "maxPrice": {
            "title": "Max price (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Optional. Keep only products at this price or lower."
          },
          "onlyChanges": {
            "title": "Only changes since the last run",
            "type": "boolean",
            "description": "Deliver only products that changed since they were last delivered under this monitor: new listings, price drops, back in stock or out of stock at a store, and products a search no longer lists. Unchanged products are not delivered or charged.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Keeps separate memories for different watch lists. Use the same name on every scheduled run of one list.",
            "default": "default"
          },
          "changeTypes": {
            "title": "Changes to report",
            "type": "array",
            "description": "Which changes count. Stock changes compare the same stores (same ZIP code or store id) between runs.",
            "items": {
              "type": "string",
              "enum": [
                "new-listing",
                "price-drop",
                "price-rise",
                "back-in-stock",
                "out-of-stock",
                "removed"
              ],
              "enumTitles": [
                "New listing",
                "Price drop",
                "Price rise",
                "Back in stock at a store",
                "Out of stock at a store",
                "No longer listed by a search"
              ]
            },
            "default": [
              "new-listing",
              "price-drop",
              "back-in-stock",
              "out-of-stock",
              "removed"
            ]
          },
          "fields": {
            "title": "Output fields",
            "type": "array",
            "description": "Optional. Only these fields in each row (dotted paths for nested ones, such as stores.quantity). Empty: every field.",
            "items": {
              "type": "string"
            }
          },
          "stateStoreName": {
            "title": "History store",
            "type": "string",
            "description": "Optional. A key-value store in your account where this actor keeps what it saw in earlier runs, so it can report changes. Empty: its own store, \"cleanpull-target-monitor\". Pick one here when you run it with a scoped API token in Restricted access mode, so the run may use it. Without access to a history store, a run still completes and compares within itself."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}