{
  "openapi": "3.0.1",
  "info": {
    "title": "BookTok Trend Intelligence & Goodreads Enrichment",
    "description": "Analyze public BookTok videos and export matched book data, TikTok engagement metrics, trend scores, representative evidence, and Goodreads metadata for publishing, author marketing, and reader-demand research.",
    "version": "1.4",
    "x-build-id": "DfYwgu6wXEEILmcg6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thescrapelab~booktok-trend-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thescrapelab-booktok-trend-intelligence",
        "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/thescrapelab~booktok-trend-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-thescrapelab-booktok-trend-intelligence",
        "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/thescrapelab~booktok-trend-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-thescrapelab-booktok-trend-intelligence",
        "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": {
          "mode": {
            "title": "What do you want to do?",
            "enum": [
              "watchlist",
              "discover",
              "compare"
            ],
            "type": "string",
            "description": "Track named books, discover titles from BookTok topics, or compare two or more named books.",
            "default": "watchlist"
          },
          "targets": {
            "title": "Books or discovery topics",
            "maxItems": 50,
            "type": "array",
            "description": "For Track or Compare, enter one book per line as Title | Author or ISBN. For Discover, enter topics such as fantasy booktok. Compare needs at least two books.",
            "items": {
              "type": "string"
            }
          },
          "searchDepth": {
            "title": "Search depth",
            "enum": [
              "quick",
              "balanced",
              "deep"
            ],
            "type": "string",
            "description": "Quick requests up to 1 video per named book or 5 per discovery topic. Balanced requests up to 3 or 10. Deep requests up to 10 or 25 and can take much longer."
          },
          "enrichWithGoodreads": {
            "title": "Add Goodreads details",
            "type": "boolean",
            "description": "Add the matched Goodreads rating, review counts, genres, cover, description, identifiers, and book URL.",
            "default": true
          },
          "includeVideoEvidence": {
            "title": "Include individual video rows",
            "type": "boolean",
            "description": "Add one separate dataset row for every confidently matched TikTok video. Leave disabled for the simplest book-level output.",
            "default": false
          },
          "dateFrom": {
            "title": "Videos from",
            "type": "string",
            "description": "Optional start date. Older videos and videos without a usable public creation date are excluded."
          },
          "dateTo": {
            "title": "Videos to",
            "type": "string",
            "description": "Optional end date. Videos after this date are excluded."
          },
          "maxBooks": {
            "title": "Maximum books",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Override the search-depth preset's maximum number of named or discovered books. Lower values reduce runtime and cost."
          },
          "maxVideosPerBook": {
            "title": "Videos per named book",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Override the preset's public TikTok video limit for each named book in Track or Compare mode."
          },
          "maxDiscoveryVideosPerQuery": {
            "title": "Videos per discovery topic",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Override the preset's public TikTok video limit for each topic in Discover mode."
          },
          "maxTotalVideos": {
            "title": "Maximum total videos",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Override the preset's hard cap for TikTok dataset items read across the complete run."
          },
          "maxUpstreamChargeUsd": {
            "title": "Maximum charge per source",
            "minimum": 0.05,
            "maximum": 20,
            "type": "number",
            "description": "Maximum total USD event charge allocated across child runs for each pay-per-event source. Item limits remain the main control for other pricing models.",
            "default": 1
          },
          "minimumMatchConfidence": {
            "title": "Book match confidence",
            "minimum": 0.25,
            "maximum": 1,
            "type": "number",
            "description": "Confidence from 0 to 1 required to connect a TikTok video with a book. Higher values favor precision; lower values return broader matches.",
            "default": 0.55
          },
          "useOpenLibraryFallback": {
            "title": "Use Open Library fallback",
            "type": "boolean",
            "description": "Resolve discovery candidates or fill basic book identity when Goodreads has no confident match.",
            "default": true
          },
          "includeUnmatchedVideos": {
            "title": "Include unmatched videos",
            "type": "boolean",
            "description": "Add rows for collected videos that did not meet the book-match confidence threshold.",
            "default": false
          },
          "maxRepresentativeVideos": {
            "title": "Preview videos per book",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Override the preset's number of high-signal videos embedded in each aggregate book result."
          },
          "upstreamTimeoutSecs": {
            "title": "Source timeout",
            "minimum": 60,
            "maximum": 900,
            "type": "integer",
            "description": "Override the preset's maximum seconds for each TikTok batch or Goodreads child run. A timeout returns partial output unless strict mode is enabled."
          },
          "strictMode": {
            "title": "Fail on incomplete source data",
            "type": "boolean",
            "description": "Fail the complete run when an upstream Actor fails. Leave disabled to receive useful partial results with clear warnings.",
            "default": false
          },
          "books": {
            "title": "Books (legacy API field)",
            "maxItems": 50,
            "type": "array",
            "description": "Backward-compatible API field for named books. New integrations should use targets.",
            "items": {
              "type": "string"
            }
          },
          "discoveryQueries": {
            "title": "Discovery topics (legacy API field)",
            "maxItems": 50,
            "type": "array",
            "description": "Backward-compatible API field for discovery keywords. New integrations should use targets.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}