{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon KDP Niche Analyzer - BSR, Competition & Niche Score",
    "description": "Check Amazon KDP book niches before you publish: searches Books or Kindle for each keyword, reads Best Sellers Rank, reviews, price and age of the top books, adds Amazon autocomplete ideas and returns a transparent 0-100 niche score.",
    "version": "0.1",
    "x-build-id": "HLhpAiBk7YRmSKhl0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fabrikit~kdp-niche-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fabrikit-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/fabrikit~kdp-niche-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-fabrikit-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/fabrikit~kdp-niche-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-fabrikit-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": "Niche keywords",
            "type": "array",
            "description": "One niche per line, written the way a buyer would search Amazon, e.g. 'coloring book for adults', 'gratitude journal for women', 'cozy mystery'. Each keyword becomes one niche row with its score plus one row per sampled book.",
            "items": {
              "type": "string"
            }
          },
          "format": {
            "title": "Book format",
            "enum": [
              "paperback",
              "kindle",
              "both"
            ],
            "type": "string",
            "description": "Which Amazon department is searched: print books (Books, i=stripbooks: paperback, hardcover, spiral-bound...), Kindle eBooks (Kindle Store, i=digital-text) or both (two niche rows per keyword).",
            "default": "paperback"
          },
          "booksPerNiche": {
            "title": "Books analysed per niche",
            "minimum": 1,
            "maximum": 48,
            "type": "integer",
            "description": "How many top organic search results are opened per niche to read Best Sellers Rank, publication date, pages and publisher. The score needs at least 5 books (3 of them with a BSR). Page 1 of a print search holds 24 organic books, a Kindle page 16.",
            "default": 10
          },
          "autocompleteExpansion": {
            "title": "Autocomplete lookup",
            "enum": [
              "none",
              "basic",
              "alphabet"
            ],
            "type": "string",
            "description": "Ask Amazon's search box (books or Kindle department) for suggestions. 'basic' sends the keyword and the keyword followed by a space (2 tiny requests); 'alphabet' also sends keyword + a...z (28 requests) for long-tail ideas. The niche row shows the suggestions and whether Amazon suggests the keyword itself.",
            "default": "basic"
          },
          "analyzeSuggestions": {
            "title": "Also analyse the suggestions as niches",
            "type": "boolean",
            "description": "Run the full niche analysis (search + top books + score) on the autocomplete suggestions too. Each analysed suggestion adds its own niche row and book rows.",
            "default": false
          },
          "maxSuggestionsPerKeyword": {
            "title": "Suggestions analysed per keyword",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Cap on how many suggestions per keyword are analysed when the option above is on (in Amazon's order).",
            "default": 5
          },
          "includeSponsored": {
            "title": "Count sponsored results",
            "type": "boolean",
            "description": "Sponsored (ad) cards are skipped by default, so the sample reflects the organic ranking that a new book competes for.",
            "default": false
          },
          "scoreWeights": {
            "title": "Score weights",
            "type": "object",
            "description": "Weights of the four score components (any positive numbers, they are converted to percentages). Default: demand 40, competition 30, freshness 15, price 15. Set a component to 0 to ignore it.",
            "default": {
              "demand": 40,
              "competition": 30,
              "freshness": 15,
              "price": 15
            }
          },
          "maxItems": {
            "title": "Max book rows",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many book rows with product data in total (the billed rows). Niche summary rows are free and do not count.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify datacenter proxies are used first; after repeated bot checks the run switches to US residential proxies on its own.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}