{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon Price History API - Sales Rank, Buy Box, Offers, Sellers",
    "description": "Amazon price history API: decoded Keepa price and sales rank history per ASIN, UPC or EAN, daily price rows, buy box and live seller offers, 30/90/180 day averages, best sellers, Product Finder, seller profiles and categories for 11 Amazon marketplaces. Read only. Bring your own key.",
    "version": "0.1",
    "x-build-id": "hNtPn9kK8leTRTWvq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~amazon-price-history-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-amazon-price-history-api",
        "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/nabeelbaghoor~amazon-price-history-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-amazon-price-history-api",
        "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/nabeelbaghoor~amazon-price-history-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-amazon-price-history-api",
        "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": {
          "service": {
            "title": "What to read",
            "enum": [
              "product",
              "productSearch",
              "productFinder",
              "bestsellers",
              "seller",
              "topSellers",
              "category",
              "categorySearch"
            ],
            "type": "string",
            "description": "Amazon price history reads each ASIN or product code you give: current prices, averages, extremes and the decoded price and sales rank history, as one row per product, per day, or per live offer. Product search, Product Finder and best sellers find ASINs and can read their details too. Seller profile, most rated sellers, category lookup and category search read the rest.",
            "default": "product"
          },
          "domain": {
            "title": "Amazon marketplace",
            "enum": [
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "8",
              "9",
              "10",
              "11",
              "12"
            ],
            "type": "string",
            "description": "The Amazon marketplace to read. Prices are returned in its currency.",
            "default": "1"
          },
          "identifiers": {
            "title": "ASINs, product codes, seller ids or category ids",
            "type": "array",
            "description": "One per line. For Amazon price history, ASINs (Amazon product URLs work too) or, with the identifier type set to product code, UPC, EAN or ISBN-13 codes. For seller profile, Amazon seller ids such as A2L77EE7U53NWQ. For category lookup, category node ids; leave empty to list the root categories.",
            "items": {
              "type": "string"
            }
          },
          "identifierType": {
            "title": "Identifier type",
            "enum": [
              "asin",
              "code"
            ],
            "type": "string",
            "description": "Amazon price history only: whether the identifiers are ASINs or product codes (UPC, EAN, ISBN-13). One code can match several ASINs, and each becomes its own row.",
            "default": "asin"
          },
          "rowPer": {
            "title": "One row per",
            "enum": [
              "product",
              "day",
              "offer"
            ],
            "type": "string",
            "description": "For every service that reads products. Product gives one row per product with current values, averages, extremes and the history as nested time series. Day gives one row per product per calendar day (UTC) with each chosen price and rank as it stood at the end of that day, which is easy to chart or load into a spreadsheet. Offer gives one row per marketplace offer with seller, condition, price, shipping and fulfilment, and asks the provider for at least 20 offers.",
            "default": "product"
          },
          "historyDays": {
            "title": "History window in days",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "How far back the price and rank history reaches, and the window the lowest and highest in window values cover. 0 reads the full history the provider holds, which for day rows can mean thousands of rows per product.",
            "default": 90
          },
          "series": {
            "title": "History types",
            "type": "array",
            "description": "Which histories go into the nested history and the day rows. Leave empty for Amazon, new, used, buy box and list price, sales rank, new offer count, rating and review count. The buy box history needs the buy box data or offers input, and rating and review count histories need the rating history input.",
            "items": {
              "type": "string",
              "enum": [
                "amazon",
                "new",
                "used",
                "salesRank",
                "listPrice",
                "collectible",
                "refurbished",
                "newFbm",
                "lightningDeal",
                "warehouse",
                "newFba",
                "newOfferCount",
                "usedOfferCount",
                "refurbishedOfferCount",
                "collectibleOfferCount",
                "rating",
                "reviewCount",
                "buyBox",
                "ebayNew",
                "ebayUsed",
                "tradeIn",
                "usedBuyBox",
                "primeExclusive",
                "newFbaOfferCount",
                "newFbmOfferCount"
              ],
              "enumTitles": [
                "Amazon price",
                "Lowest new price, marketplace",
                "Lowest used price",
                "Sales rank",
                "List price",
                "Lowest collectible price",
                "Lowest refurbished price",
                "Lowest new price, merchant fulfilled, with shipping",
                "Lightning deal price",
                "Warehouse deals price",
                "Lowest new price, fulfilled by Amazon",
                "New offer count",
                "Used offer count",
                "Refurbished offer count",
                "Collectible offer count",
                "Rating",
                "Review count",
                "Buy box price with shipping",
                "Lowest new price on eBay with shipping",
                "Lowest used price on eBay with shipping",
                "Trade-in price",
                "Used buy box price with shipping",
                "Lowest Prime exclusive new price",
                "New offer count, fulfilled by Amazon",
                "New offer count, merchant fulfilled"
              ]
            }
          },
          "includeHistory": {
            "title": "Include nested history",
            "type": "boolean",
            "description": "Product rows only: add the chosen history types as time series under history. Turn off for a lighter row with current values, averages and extremes only.",
            "default": true
          },
          "offers": {
            "title": "Marketplace offers to read",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Ask the provider for this many marketplace offers per product, from 20 to 100, which also fills the buy box fields. 0 reads none. A request with offers reads at most 20 products at a time. One row per offer sets 20 when this is 0.",
            "default": 0
          },
          "liveOffersOnly": {
            "title": "Live offers only",
            "type": "boolean",
            "description": "With offers: keep only offers listed now, leaving out offers the provider saw in the past.",
            "default": true
          },
          "offerStock": {
            "title": "Collect offer stock",
            "type": "boolean",
            "description": "With offers: ask the provider to collect the stock of each live offer (it can see up to 10 units). Takes longer.",
            "default": false
          },
          "buyBox": {
            "title": "Buy box data",
            "type": "boolean",
            "description": "Without offers: add the buy box price history and buy box fields from data the provider already holds. The provider charges extra tokens for it; offers include it anyway.",
            "default": false
          },
          "includeRating": {
            "title": "Rating history",
            "type": "boolean",
            "description": "Add the rating and review count history the provider already holds.",
            "default": false
          },
          "refreshHours": {
            "title": "Refresh data older than hours",
            "minimum": 0,
            "type": "integer",
            "description": "Ask the provider to collect fresh data from Amazon when its copy is older than this many hours. 0 always collects live data and can cost extra tokens. Leave blank to read the stored data. For seller profile it applies to the storefront."
          },
          "searchTerm": {
            "title": "Search term",
            "type": "string",
            "description": "Product search and category search: the keywords. Category search matches every keyword, each at least 3 characters."
          },
          "finderSelection": {
            "title": "Product Finder selection",
            "type": "object",
            "description": "Product Finder only: the finder query as a JSON object, using the provider's own filter names, such as {\"rootCategory\": [\"172282\"], \"current_SALES_lte\": 5000, \"sort\": [[\"current_SALES\", \"asc\"]]}. Page and page size are set by the actor."
          },
          "category": {
            "title": "Best seller category",
            "type": "string",
            "description": "Best sellers only: the category node id, which category search finds, or a product group name."
          },
          "bestsellerRange": {
            "title": "Rank basis",
            "enum": [
              "0",
              "30",
              "90",
              "180"
            ],
            "type": "string",
            "description": "Best sellers only: rank by the current sales rank, or by its 30, 90 or 180 day average.",
            "default": "0"
          },
          "bestsellerVariations": {
            "title": "All variations",
            "type": "boolean",
            "description": "Best sellers only: list every variation instead of one per parent product.",
            "default": false
          },
          "bestsellerSublist": {
            "title": "Rank by sub-category rank",
            "type": "boolean",
            "description": "Best sellers only: build a sub-category list from the sub-category sales rank instead of the primary sales rank.",
            "default": false
          },
          "fetchProductDetails": {
            "title": "Read product details for found ASINs",
            "type": "boolean",
            "description": "Product Finder and best sellers: instead of one row per ranked ASIN, read each ASIN found (up to maximum results) with the history, offer and row settings above.",
            "default": false
          },
          "sellerStorefront": {
            "title": "Seller storefront ASINs",
            "type": "boolean",
            "description": "Seller profile only: add the ASINs the seller lists (up to 10,000 kept per row). Reads one seller per request.",
            "default": false
          },
          "includeParents": {
            "title": "Include category path",
            "type": "boolean",
            "description": "Category lookup and search: read each category's parent tree and write its full path.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many rows. With one row per day, a product with a 90 day window is up to 90 rows.",
            "default": 100
          },
          "maxTokenWaitMinutes": {
            "title": "Token wait limit in minutes",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "The provider meters requests in tokens that refill every minute. When the balance runs out the run waits for a refill, up to this long for one wait; past that it stops cleanly and keeps the rows collected.",
            "default": 10
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Pacing ceiling for calls to the provider, on top of the token meter.",
            "default": 60
          },
          "apiKey": {
            "title": "API access key",
            "type": "string",
            "description": "Your own API access key, the 64 character code on the API page of your provider account, which needs an active API subscription. This actor is bring-your-own-key and never ships one. Leave blank to use the DATA_API_KEY environment secret instead. It is never written to a row or the log."
          },
          "baseUrl": {
            "title": "API base URL",
            "type": "string",
            "description": "Override the host the actor calls. Only useful for testing against a different environment."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}