{
  "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": "WhiXXtNrAyHZD4NYX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/deepmine~tiktok-shop-affiliate-products/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-deepmine-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/deepmine~tiktok-shop-affiliate-products/runs": {
      "post": {
        "operationId": "runs-sync-deepmine-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/deepmine~tiktok-shop-affiliate-products/run-sync": {
      "post": {
        "operationId": "run-sync-deepmine-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": "Products or niches to search on TikTok Shop, one per line, e.g. \"neck fan\", \"walking pad\", \"lip oil\". Each product gets an affiliate score (0-100) with the reasons behind it.",
            "default": [
              "neck fan",
              "walking pad",
              "ergo chair"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerQuery": {
            "title": "📦 Max products per keyword",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Products to read per keyword, in TikTok Shop's order, before scoring and filters. You pay per product delivered.",
            "default": 300
          },
          "minAffiliateScore": {
            "title": "⭐ Min affiliate score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keep products scoring at least this (0-100): 85+ strong, 70+ good, 55+ moderate. The score weighs price band, rating, reviews and demand. 0 = keep all.",
            "default": 0
          },
          "minRating": {
            "title": "★ Min rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Empty = any rating."
          },
          "minReviewCount": {
            "title": "💬 Min reviews",
            "minimum": 0,
            "type": "integer",
            "description": "0 = any.",
            "default": 0
          },
          "maxPrice": {
            "title": "💵 Max price",
            "minimum": 0,
            "type": "number",
            "description": "Empty = any price."
          },
          "requireReviews": {
            "title": "Only products with reviews",
            "type": "boolean",
            "description": "Leave out products with no public reviews.",
            "default": false
          },
          "requireAllQueryTokens": {
            "title": "Title must contain every keyword word",
            "type": "boolean",
            "description": "Off: every product TikTok Shop shows for the keyword, in its order. On: only products whose title has every word of the keyword.",
            "default": false
          },
          "minimumQueryTokenMatches": {
            "title": "Title must contain at least … keyword words",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "A looser version of the option above (used only when it is off). Empty = keep every product."
          },
          "includeRawProduct": {
            "title": "Add TikTok's raw product object",
            "type": "boolean",
            "description": "Adds rawProduct, TikTok's full product payload, to each row. Large; the regular fields already cover it.",
            "default": false
          },
          "maxPagesPerQuery": {
            "title": "Max pages per keyword",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum search-result pages per query (25-30 products each). Stops early when TikTok Shop has no more.",
            "default": 10
          },
          "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
          },
          "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}