{
  "openapi": "3.0.1",
  "info": {
    "title": "A-Z Scraper",
    "description": "This Amazon Product Scraper extracts best-selling products, ranks them with AI, and filters results based on niche relevance. It scans categories, fetches product details, generates affiliate links based on your associates ID and exports item details. Ideal for affiliates",
    "version": "0.0",
    "x-build-id": "k2y9iYjnffDHXLyaJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kyleyounker1~a-z-scraper-final/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kyleyounker1-a-z-scraper-final",
        "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/kyleyounker1~a-z-scraper-final/runs": {
      "post": {
        "operationId": "runs-sync-kyleyounker1-a-z-scraper-final",
        "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/kyleyounker1~a-z-scraper-final/run-sync": {
      "post": {
        "operationId": "run-sync-kyleyounker1-a-z-scraper-final",
        "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",
        "required": [
          "openaiApiKey",
          "associatesId",
          "niche",
          "keywords"
        ],
        "properties": {
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "Your OpenAI API key for accessing the LLM."
          },
          "niche": {
            "title": "Chatbot Niche",
            "type": "string",
            "description": "The broad niche of the AI chatbot (e.g., 'Cooking', 'Fitness & Nutrition', 'PC Building')."
          },
          "keywords": {
            "title": "Relevant Product Keywords",
            "type": "string",
            "description": "A comma-separated list of specific keywords that serve as examples of products to consider (e.g., 'recipe books, utensils, kitchen aid')."
          },
          "llmPrompt": {
            "title": "LLM Prompt (Optional)",
            "type": "string",
            "description": "If empty, a default prompt will be generated based on 'niche' and 'keywords'."
          },
          "associatesId": {
            "title": "Amazon Associates ID",
            "type": "string",
            "description": "Your Amazon Associates ID for generating affiliate links."
          },
          "amazonDomain": {
            "title": "Amazon Domain",
            "enum": [
              ".com",
              ".ca",
              ".co.uk",
              ".au"
            ],
            "type": "string",
            "description": "The Amazon marketplace domain to target. Options are '.com','.ca', '.co.uk', and '.au'. Defaults to '.com'.",
            "default": "com"
          },
          "maxProductsPerPage": {
            "title": "Max Products Per Catalogue Page",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of products to collect per catalogue page.",
            "default": 10
          },
          "cataloguePageGroupSize": {
            "title": "Catalogue Page Group Size",
            "minimum": 1,
            "type": "integer",
            "description": "Number of catalogue pages to process in a single batch for LLM relevancy analysis.",
            "default": 1
          },
          "maxProductsOverall": {
            "title": "Max Products Overall",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of unique products to collect before stopping.",
            "default": 25
          },
          "departmentRelevanceThreshold": {
            "title": "Department Relevance Threshold",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum LLM relevance score for a category to be processed (e.g., 75).",
            "default": 75
          },
          "productRelevanceThreshold": {
            "title": "Product Relevance Threshold",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum LLM confidence score for a product to be kept (e.g., 30).",
            "default": 30
          },
          "proxies": {
            "title": "Proxies",
            "type": "object",
            "description": "Optional proxy configuration. If not provided, the script runs without proxies."
          },
          "startUrl": {
            "title": "Start URL(s)",
            "type": "string",
            "description": "Optional: One or more Amazon catalogue page URLs (separated by commas). If provided, department scraping is skipped."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}