{
  "openapi": "3.0.1",
  "info": {
    "title": "Wattpad Story Scraper",
    "description": "Scrape Wattpad stories - search by keyword, browse by genre or tag, fetch full story metadata and chapter lists by ID, list a user's stories, or pull full chapter text.",
    "version": "1.0",
    "x-build-id": "UHNSrNr5OQRfHprqB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~wattpad-story-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-wattpad-story-scraper",
        "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/crawlerbros~wattpad-story-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-wattpad-story-scraper",
        "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/crawlerbros~wattpad-story-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-wattpad-story-scraper",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byCategory",
              "byTag",
              "byIds",
              "byUser",
              "chapterText"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query (mode=search)",
            "type": "string",
            "description": "Free-text query, e.g. a title, keyword, or theme.",
            "default": "romance"
          },
          "category": {
            "title": "Genre / category",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10",
              "11",
              "12",
              "13",
              "14",
              "16",
              "17",
              "18",
              "19",
              "21",
              "22",
              "23",
              "24"
            ],
            "type": "string",
            "description": "Filter to a single Wattpad genre. Required for mode=byCategory; optional narrowing filter for mode=search.",
            "default": ""
          },
          "language": {
            "title": "Language",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "11",
              "13",
              "14",
              "15",
              "16",
              "17",
              "18",
              "19",
              "20",
              "21",
              "22",
              "23",
              "24",
              "28",
              "30",
              "31",
              "40",
              "44",
              "46"
            ],
            "type": "string",
            "description": "Filter stories to a single language. Leave blank for any language.",
            "default": ""
          },
          "tags": {
            "title": "Tags (mode=byTag)",
            "type": "array",
            "description": "One or more Wattpad tags, without the `#` (e.g. `werewolf`, `slowburn`). Results from each tag are merged and de-duplicated.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "storyIds": {
            "title": "Story IDs or URLs (mode=byIds)",
            "type": "array",
            "description": "Numeric Wattpad story IDs (e.g. `358371807`) or full story URLs (e.g. `https://www.wattpad.com/story/358371807-whispers-of-romance`).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "username": {
            "title": "Username (mode=byUser)",
            "type": "string",
            "description": "Wattpad username or profile URL. Each returned story is enriched with the author's public profile (bio, location, follower/following counts, votes received, join date)."
          },
          "feed": {
            "title": "Feed (mode=byCategory)",
            "enum": [
              "",
              "new"
            ],
            "type": "string",
            "description": "Narrows a genre browse to a specific curated feed. `new` returns the most recently updated stories in the genre; leaving this blank returns Wattpad's default (most-popular) ordering.",
            "default": ""
          },
          "partIds": {
            "title": "Chapter/part IDs or URLs (mode=chapterText)",
            "type": "array",
            "description": "Numeric Wattpad chapter (\"part\") IDs or chapter URLs, e.g. `1406121589` or `https://www.wattpad.com/1406121589-whispers-of-romance-character-sketch`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "completedOnly": {
            "title": "Completed stories only",
            "type": "boolean",
            "description": "Only emit stories the author has marked as complete.",
            "default": false
          },
          "freeOnly": {
            "title": "Free stories only",
            "type": "boolean",
            "description": "Exclude stories that use Wattpad's paid-story (coins) model.",
            "default": false
          },
          "includeMatureContent": {
            "title": "Include mature-flagged content",
            "type": "boolean",
            "description": "If disabled, drop stories the author has self-flagged as mature. Wattpad's own maturity flag is self-reported and not exhaustive.",
            "default": true
          },
          "minVotes": {
            "title": "Minimum vote count",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Drop stories with fewer votes than this."
          },
          "minReads": {
            "title": "Minimum read count",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Drop stories with fewer reads than this."
          },
          "sortBy": {
            "title": "Sort results by",
            "enum": [
              "relevance",
              "mostVotes",
              "mostReads",
              "mostCommented",
              "newest"
            ],
            "type": "string",
            "description": "Re-orders the fetched batch of results (applied client-side after fetching, since Wattpad's own sort parameter is not consistently honored).",
            "default": "relevance"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}