{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Shop Affiliate Products",
    "description": "Find TikTok Shop products worth promoting with affiliate opportunity scoring, product demand signals, price bands, ratings, reviews, seller context.",
    "version": "1.0",
    "x-build-id": "Ty526XH6Qe8d4zY0W"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sentry~tiktok-shop-affiliate-products/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sentry-tiktok-shop-affiliate-products",
        "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/sentry~tiktok-shop-affiliate-products/runs": {
      "post": {
        "operationId": "runs-sync-sentry-tiktok-shop-affiliate-products",
        "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/sentry~tiktok-shop-affiliate-products/run-sync": {
      "post": {
        "operationId": "run-sync-sentry-tiktok-shop-affiliate-products",
        "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": {
          "queries": {
            "title": "Product Keywords",
            "type": "array",
            "description": "Keywords or product niches to search on TikTok Shop. The actor ranks discovered products by affiliate promotion opportunity.",
            "default": [
              "neck fan",
              "walking pad",
              "ergo chair"
            ],
            "items": {
              "type": "string"
            }
          },
          "minAffiliateScore": {
            "title": "Minimum Affiliate Score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only return products at or above this 0-100 affiliate opportunity score. Tiers: 85-100 strong, 70-84 good, 55-69 moderate, 0-54 weak. Computed from price band, rating strength, demand signal, and content-fit signal. Each result also includes opportunityReasons and opportunityCautions. Use 0 to keep everything. This alone is usually enough — avoid also stacking minRating/minReviewCount/maxPrice unless you need a hard cutoff, since filters combine as AND and can leave very few results.",
            "default": 0
          },
          "minRating": {
            "title": "Minimum Rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Exclude products below this star rating. Leave blank on the first call — the score already weighs rating strength, and adding this on top of other filters can return very few results."
          },
          "minReviewCount": {
            "title": "Minimum Review Count",
            "minimum": 0,
            "type": "integer",
            "description": "Exclude products with fewer than this many public reviews. Leave at 0 on the first call — the score already weighs review volume, and this combines with other filters as AND, which narrows results fast.",
            "default": 0
          },
          "maxPrice": {
            "title": "Maximum Price ($)",
            "minimum": 0,
            "type": "number",
            "description": "Exclude products above this price. Leave blank on the first call — price is already a scored factor, so set this only if you need a hard ceiling, not as a default alongside other filters."
          },
          "requireReviews": {
            "title": "Require Reviews",
            "type": "boolean",
            "description": "If enabled, products with zero public reviews are excluded. Leave off on the first call — the affiliate score already rewards review volume, so this is rarely needed as an additional filter.",
            "default": false
          },
          "maxPagesPerQuery": {
            "title": "Max Pages Per Keyword",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of TikTok Shop search-result pages to scan per keyword.",
            "default": 5
          },
          "maxResultsPerQuery": {
            "title": "Max Results Per Keyword",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum products collected per keyword before affiliate scoring and filtering.",
            "default": 200
          },
          "trimProductName": {
            "title": "Trim Product Names",
            "type": "boolean",
            "description": "Controls only the nameShort field. When true, nameShort is trimmed to the first 8 words of the product name for easier scanning. When false, nameShort matches the full name. The name field always contains the full product name either way; no data is removed from the result.",
            "default": true
          },
          "includeRawProduct": {
            "title": "Include Raw Product Data",
            "type": "boolean",
            "description": "Attach the full, unprocessed TikTok product object as a rawProduct field on each result. It is the entire raw API payload, so it significantly increases the size of every result. Off by default and rarely useful outside advanced debugging, since the structured fields above already cover normal use. Keep this off when an AI agent is consuming the output: the extra bulk adds tokens without adding usable information.",
            "default": false
          },
          "compactNullFields": {
            "title": "Compact Null Fields",
            "type": "boolean",
            "description": "Remove null or missing fields from each result instead of including them as null. Keeps output smaller and easier to read. Never removes a field that has a real value.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}