{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Shop Trending Products to Creative Briefs",
    "description": "Finds trending TikTok Shop products in your categories, filters out tiny-base spikes and restricted items, and writes a ready-to-shoot ad creative brief for each: hooks, angles, formats, shot list, CTA and Meta/TikTok compliance cautions.",
    "version": "0.0",
    "x-build-id": "m2vgMBQFfnBIh6DdY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kingly_contest_7cb~tiktok-shop-creative-briefs/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kingly_contest_7cb-tiktok-shop-creative-briefs",
        "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/kingly_contest_7cb~tiktok-shop-creative-briefs/runs": {
      "post": {
        "operationId": "runs-sync-kingly_contest_7cb-tiktok-shop-creative-briefs",
        "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/kingly_contest_7cb~tiktok-shop-creative-briefs/run-sync": {
      "post": {
        "operationId": "run-sync-kingly_contest_7cb-tiktok-shop-creative-briefs",
        "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": [
          "categories"
        ],
        "properties": {
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "TikTok Shop category names, for example <b>Beauty & Personal Care</b>, <b>Health</b>, <b>Home Supplies</b>. Each category is ranked on its own.",
            "default": [
              "Beauty & Personal Care"
            ],
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "enum": [
              "US",
              "GB",
              "ID",
              "TH",
              "VN",
              "PH",
              "MY",
              "SG",
              "JP",
              "MX",
              "DE",
              "IT",
              "FR",
              "ES",
              "BR"
            ],
            "type": "string",
            "description": "TikTok Shop market. Revenue is in US dollars for every market. Briefs are written in English for a US-style audience.",
            "default": "US"
          },
          "period": {
            "title": "Period",
            "enum": [
              "last7Day",
              "last30Day",
              "lastDay"
            ],
            "type": "string",
            "description": "Sales window for revenue, units sold and growth.",
            "default": "last7Day"
          },
          "maxProductsPerCategory": {
            "title": "Products to screen per category",
            "minimum": 25,
            "maximum": 100,
            "type": "integer",
            "description": "How many top products to pull per category before filtering and ranking. More products = better picks but a higher source-data cost. The TikTok Shop scraper returns at least 25 per category.",
            "default": 25
          },
          "briefsPerCategory": {
            "title": "Briefs per category",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many of the best-ranked products get a full creative brief in each category.",
            "default": 1
          },
          "minRevenueUsd": {
            "title": "Minimum revenue (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip products with less revenue in the period. Stops a $60 product with +70,000% growth from topping the list.",
            "default": 2000
          },
          "minUnitsSold": {
            "title": "Minimum units sold",
            "minimum": 0,
            "type": "integer",
            "description": "Skip products that sold fewer units in the period.",
            "default": 50
          },
          "rankingMode": {
            "title": "Ranking",
            "enum": [
              "balanced",
              "growth",
              "revenue"
            ],
            "type": "string",
            "description": "How qualified products are ordered. Balanced = 45% revenue, 35% growth, 20% units (percentile ranks within the category).",
            "default": "balanced"
          },
          "sourceSortBy": {
            "title": "Source list order",
            "enum": [
              "revenueGrowth",
              "revenue",
              "unitsSold",
              "videoRevenue",
              "newest"
            ],
            "type": "string",
            "description": "Which TikTok Shop top list to screen. Fastest-growing surfaces new trends; top revenue surfaces proven sellers.",
            "default": "revenueGrowth"
          },
          "preFilterMode": {
            "title": "Compliance pre-filter",
            "enum": [
              "standard",
              "strict"
            ],
            "type": "string",
            "description": "Standard: drop products in categories Meta/TikTok ads prohibit (sexual wellness, medical devices, nicotine/cannabis, weapons, Rx drugs) and flag risky claims. Strict: also drop likely off-category and sexual-enhancement-adjacent products.",
            "default": "standard"
          },
          "addAnalytics": {
            "title": "Add creator/video analytics (costs more)",
            "type": "boolean",
            "description": "Adds creator, video and LIVE counts, reviews and price range from the source. The source charges a much higher per-product price for these rows.",
            "default": false
          },
          "dryRun": {
            "title": "Dry run (no LLM, no charge)",
            "type": "boolean",
            "description": "Uses placeholder briefs instead of the AI model and charges no brief events. Needs a fixture or an existing dataset; it never starts the paid source scraper.",
            "default": false
          },
          "sourceDatasetId": {
            "title": "Re-use an existing source dataset",
            "type": "string",
            "description": "ID of a dataset from an earlier lergassy/tiktok-shop-top-products-scraper run. Skips the new source run."
          },
          "fixtureFile": {
            "title": "Fixture file (local testing)",
            "type": "string",
            "description": "Path inside the Actor's fixtures/ folder, e.g. fixtures/test_run_raw.json. For development only."
          },
          "fixtureRunId": {
            "title": "Fixture run ID",
            "type": "string",
            "description": "Source run ID to record in meta.sourceRunId when using a fixture."
          },
          "sourceMemoryMbytes": {
            "title": "Source run memory (MB)",
            "minimum": 128,
            "maximum": 4096,
            "type": "integer",
            "description": "Memory for the source scraper run. 128 MB was enough for 60 products in testing.",
            "default": 128
          },
          "sourceMaxTotalChargeUsd": {
            "title": "Source run spending cap (USD)",
            "minimum": 0.01,
            "type": "number",
            "description": "Hard cap on what the source scraper run may charge.",
            "default": 0.5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}