{
  "openapi": "3.0.1",
  "info": {
    "title": "Target Deal & Clearance Tracker",
    "description": "Track Target.com clearance, sale and weekly-ad markdowns. Filter by deal type or minimum discount, rank by biggest price drop, and export the results.",
    "version": "0.1",
    "x-build-id": "n5gsX11cmF0y4230w"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/famous_iron~target-deal-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-famous_iron-target-deal-tracker",
        "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/famous_iron~target-deal-tracker/runs": {
      "post": {
        "operationId": "runs-sync-famous_iron-target-deal-tracker",
        "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/famous_iron~target-deal-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-famous_iron-target-deal-tracker",
        "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": {
          "startUrl": {
            "title": "Start URL",
            "pattern": "^$|^https?://(www\\.)?target\\.com/",
            "type": "string",
            "description": "Optional. Paste a Target search URL instead of a keyword — the search term and sort order are read from it. Clear the Search keyword field when using this, otherwise the keyword takes precedence."
          },
          "keyword": {
            "title": "Search keyword",
            "type": "string",
            "description": "Search term used to collect products, for example \"womens tops\". Used instead of Start URL. If both are filled in, this wins."
          },
          "item_type": {
            "title": "Only these product types",
            "type": "string",
            "description": "Keep only products of these types, comma separated — for example \"cell phones\" to exclude cases and chargers from a phone search. Matching is a case-insensitive substring, so \"phone\" matches \"Cell Phones\". Leave blank to keep everything."
          },
          "exclude_item_type": {
            "title": "Exclude these product types",
            "type": "string",
            "description": "Drop products of these types, comma separated — for example \"case, screen protector, charger\" to strip accessories out of an electronics search."
          },
          "deal_type": {
            "title": "Deal type",
            "enum": [
              "any",
              "clearance",
              "sale",
              "weekly_ad",
              "bogo",
              "circle_deals",
              "new_lower_price",
              "buy_and_save",
              "value_bundles",
              "gift_card",
              "all_deals"
            ],
            "type": "string",
            "description": "Filter to Target's own deal categories. Target does not offer every deal filter for every keyword — when the chosen one is unavailable the run falls back to the minimum discount setting and says so in the log.",
            "default": "any"
          },
          "min_discount_percent": {
            "title": "Minimum discount %",
            "minimum": 0,
            "maximum": 99,
            "type": "integer",
            "description": "Only save products marked down by at least this much, calculated from the current and regular price. Works for every keyword, including those with no deal filter. Leave at 0 to keep everything.",
            "default": 0
          },
          "rank_by_discount": {
            "title": "Rank by biggest discount",
            "type": "boolean",
            "description": "Scan every allowed page first, then save only the deepest markdowns. Slower, because it reads the full page budget before writing, but it surfaces the best deals rather than the first ones found.",
            "default": false
          },
          "track_changes": {
            "title": "Only changes since last run (returns nothing if prices held steady)",
            "type": "boolean",
            "description": "⚠️ Leave this OFF for normal searches. When on, the run compares against the previous run of the same search and saves ONLY price drops, new arrivals and items back in stock — so a second run minutes later correctly returns zero products. That is the feature working, not a failure. Built for scheduled daily runs; the first run saves a baseline and returns everything.",
            "default": false
          },
          "include_unchanged": {
            "title": "…and also keep products that didn't change",
            "type": "boolean",
            "description": "Only applies when the setting above is on. Keeps products whose price and availability held steady, turning a change feed back into a full listing. Useful if you want every product but still want the change_type labels.",
            "default": false
          },
          "sort_by": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "bestselling",
              "PriceLow",
              "PriceHigh",
              "RatingHigh",
              "Featured"
            ],
            "type": "string",
            "description": "Order of the search results. \"relevance\" and \"newest\" are the primary options; the remaining values mirror the sort choices offered on target.com.",
            "default": "relevance"
          },
          "results_wanted": {
            "title": "Number of results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of products to save to the dataset. Target serves at most 1,200 products per search regardless of how many matches it reports, so very large values return everything available rather than failing.",
            "default": 20
          },
          "max_pages": {
            "title": "Maximum pages",
            "minimum": 1,
            "type": "integer",
            "description": "Safety cap on how many listing pages are requested. The run stops at whichever limit is reached first — this one or the number of results.",
            "default": 10
          },
          "include_sponsored": {
            "title": "Include sponsored products",
            "type": "boolean",
            "description": "Include sponsored placements in the dataset. Turn this off to collect organic search results only.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional Apify Proxy settings. Target tolerates datacenter traffic in most cases; enable residential proxies if a run starts returning empty pages.",
            "default": {
              "useApifyProxy": false
            }
          },
          "storeId": {
            "title": "Target store ID",
            "type": "string",
            "description": "Store used for pricing and pickup context. Availability fields are only populated when a valid store is supplied. Leave the default unless you need a specific store's data.",
            "default": "1771"
          },
          "zipCode": {
            "title": "ZIP code",
            "pattern": "^$|^[0-9]{5}$",
            "type": "string",
            "description": "ZIP code used for shipping and scheduled delivery estimates.",
            "default": "10001"
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}