{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon KDP Niche Analyzer: BSR, Sales, Royalties & Scores",
    "description": "Research Amazon KDP book niches by keyword: top organic books with Best Sellers Rank, price, reviews, publisher, page count, estimated sales and royalties, plus a scored niche summary. Paperback, hardcover and Kindle across 14 Amazon stores.",
    "version": "0.0",
    "x-build-id": "vPf2tdSNDx8qviGZ4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~kdp-niche-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-kdp-niche-analyzer",
        "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/memo23~kdp-niche-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-memo23-kdp-niche-analyzer",
        "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/memo23~kdp-niche-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-kdp-niche-analyzer",
        "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": {
          "keywords": {
            "title": "Keywords / niches",
            "type": "array",
            "description": "Book niche ideas to research, one per line, e.g. gratitude journal, nurse planner, dog mom notebook. Each keyword is searched in every store and department you pick below, and gets its own niche summary row.",
            "items": {
              "type": "string"
            }
          },
          "bookUrls": {
            "title": "Book URLs or ASINs",
            "type": "array",
            "description": "Optional competitor books to read directly: Amazon product links (https://www.amazon.com/dp/1961355221) or bare ASINs. The store comes from the link; bare ASINs use the first store below.",
            "items": {
              "type": "string"
            }
          },
          "marketplaces": {
            "title": "Amazon stores",
            "type": "array",
            "description": "KDP storefronts to research. Every keyword runs once per store, so pick only the markets you publish to.",
            "items": {
              "type": "string",
              "enum": [
                "com",
                "co.uk",
                "de",
                "fr",
                "it",
                "es",
                "nl",
                "pl",
                "ca",
                "com.au",
                "co.jp",
                "in",
                "com.br",
                "com.mx"
              ],
              "enumTitles": [
                "amazon.com (US)",
                "amazon.co.uk (UK)",
                "amazon.de (Germany)",
                "amazon.fr (France)",
                "amazon.it (Italy)",
                "amazon.es (Spain)",
                "amazon.nl (Netherlands)",
                "amazon.pl (Poland)",
                "amazon.ca (Canada)",
                "amazon.com.au (Australia)",
                "amazon.co.jp (Japan)",
                "amazon.in (India)",
                "amazon.com.br (Brazil)",
                "amazon.com.mx (Mexico)"
              ]
            },
            "default": [
              "com"
            ]
          },
          "departments": {
            "title": "Departments",
            "type": "array",
            "description": "Books = paperbacks and hardcovers (where low-content journals, planners and notebooks sell). Kindle = the Kindle Store (ebooks, Kindle Unlimited). Pick both to compare print against ebook for the same keyword.",
            "items": {
              "type": "string",
              "enum": [
                "books",
                "kindle"
              ],
              "enumTitles": [
                "Books (paperback + hardcover)",
                "Kindle Store (ebooks)"
              ]
            },
            "default": [
              "books"
            ]
          },
          "maxBooksPerKeyword": {
            "title": "Books per keyword",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many top organic search results to analyze for each keyword in each store and department (1-100). 20 is a good balance; more books give steadier medians and cost more.",
            "default": 20
          },
          "fetchBookDetails": {
            "title": "Read each book's product page",
            "type": "boolean",
            "description": "On: every book gets its Best Sellers Rank, category ranks, publisher, publication date, page count, ISBNs and the sales and royalty estimates built on them. Off: search-card fields only (title, price, rating, reviews, format), billed at the lower Book (search only) price, and niche demand scores stay empty.",
            "default": true
          },
          "includeSponsored": {
            "title": "Include sponsored books as rows",
            "type": "boolean",
            "description": "Also return the sponsored (ad) books from the search, flagged isSponsored. They are never counted in the niche summary, which describes organic competition only. The share of ads on page one is reported either way.",
            "default": false
          },
          "includeAutocompleteSuggestions": {
            "title": "Collect autocomplete suggestions",
            "type": "boolean",
            "description": "Add the phrases Amazon suggests as shoppers type each keyword (scoped to the department) to its niche summary. Free.",
            "default": true
          },
          "analyzeAutocompleteSuggestions": {
            "title": "Analyze the suggestions as niches too",
            "type": "boolean",
            "description": "Treat each collected suggestion as its own keyword and analyze it fully: books plus a niche summary. A fast way to find sub-niches, and it multiplies the books analyzed by up to the number of suggestions.",
            "default": false
          },
          "maxSuggestionsPerKeyword": {
            "title": "Suggestions per keyword",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many autocomplete suggestions to keep (and analyze, if that is on) per keyword (0-10).",
            "default": 5
          },
          "maxNiches": {
            "title": "Maximum niches per run",
            "minimum": 1,
            "type": "integer",
            "description": "Upper limit on niche analyses in one run (keywords × stores × departments, plus analyzed suggestions). Protects you from an accidental huge run.",
            "default": 50
          },
          "monitorChanges": {
            "title": "Track changes between runs",
            "type": "boolean",
            "description": "For scheduled runs: each niche summary gets a changes block comparing it with the previous run of the same keyword, store and department (result count, median BSR, median reviews, median price, opportunity score, new and dropped books).",
            "default": false
          },
          "proxy": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. The actor ships with residential proxies matched to each store's country, so you do not need to set anything. Paste your own proxy URLs here only if you want to use them instead."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}