{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon KDP Niche Analyzer",
    "description": "Analyze Amazon KDP niches by keyword or book link: Kindle and paperback competitors with BSR, price, ratings, estimated sales and royalties, plus a 0-100 opportunity score. 13 stores.",
    "version": "0.1",
    "x-build-id": "KarY9K567vICs5udS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~amazon-kdp-niche-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-amazon-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/khadinakbar~amazon-kdp-niche-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-amazon-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/khadinakbar~amazon-kdp-niche-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-amazon-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": "List of book niche keywords to analyze, one per line, e.g. 'cozy mystery', 'keto cookbook', 'dragon romance'. Each keyword runs one Amazon Kindle Store (or Books) search and returns competing books plus one niche report. Use short buyer-style phrases; do not paste Amazon URLs here (use Book links for that).",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Single keyword (alternative)",
            "type": "string",
            "description": "One niche keyword as plain text, e.g. 'cozy mystery'. Use this instead of the list when an agent or API caller passes a single string. Combined and de-duplicated with Niche keywords when both are set."
          },
          "marketplace": {
            "title": "Amazon marketplace",
            "enum": [
              "US",
              "UK",
              "DE",
              "FR",
              "CA",
              "ES",
              "IT",
              "JP",
              "AU",
              "MX",
              "BR",
              "PL",
              "IN"
            ],
            "type": "string",
            "description": "Which Amazon store to analyze (13 supported). Controls domain, currency and country. Defaults to US (amazon.com).",
            "default": "US"
          },
          "department": {
            "title": "Department",
            "enum": [
              "kindle",
              "paperback",
              "both"
            ],
            "type": "string",
            "description": "Search the Kindle Store (e-books, default), the Books department (paperback/print), or both in one run. 'both' analyzes every keyword in each department, so it returns about twice as many rows and costs about twice as much.",
            "default": "kindle"
          },
          "maxBooksPerKeyword": {
            "title": "Max books per keyword",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many competing books to analyze per keyword and department (organic results first, sponsored only to fill). Accepts 1-30. Defaults to 10. This is the main cost cap: you pay per book saved.",
            "default": 10
          },
          "fetchDetails": {
            "title": "Fetch detail pages (BSR)",
            "type": "boolean",
            "description": "When true (default), opens each book's Amazon page to read Best Sellers Rank, publisher, publish date, page count, and the independently-published flag. Demand scoring relies on BSR, so keep this on for niche decisions. Set false for a faster search-only scan.",
            "default": true
          },
          "includeNicheSummary": {
            "title": "Include niche report",
            "type": "boolean",
            "description": "When true (default), adds one niche-report row per keyword with median BSR, price and reviews, estimated monthly sales and revenue, new-book and sponsored shares, a confidence level and a 0-100 opportunity score. Only produced when at least one book was saved.",
            "default": true
          },
          "maxKeywords": {
            "title": "Max keywords per run",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Safety cap on how many keywords are processed in one run. Accepts 1-20. Defaults to 5. Extra keywords are ignored and listed in OUTPUT warnings.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Amazon blocks many datacenter IPs. Leave the default (Apify Proxy on): the Actor tries residential in the marketplace country first, then other Apify proxy groups. Override only for your own proxy groups or URLs.",
            "default": {
              "useApifyProxy": true
            }
          },
          "bookUrls": {
            "title": "Book links (optional)",
            "type": "array",
            "description": "Amazon book links or ASINs to analyze directly, one per line, e.g. https://www.amazon.com/dp/B0FQFB8FMG. Each book is billed like a keyword-search book. Use this to check specific competitors without a search. Up to 100.",
            "items": {
              "type": "string"
            }
          },
          "includeAutocomplete": {
            "title": "Include search ideas",
            "type": "boolean",
            "description": "When true (default), each niche report lists up to 10 related Amazon search suggestions you can try as your next keywords. No extra charge.",
            "default": true
          },
          "trackChanges": {
            "title": "Track changes between runs",
            "type": "boolean",
            "description": "When true, saves each niche's book list to a named storage in your account and, on your next run, lists the books that are new or dropped in the niche report. Off by default.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}