{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Shop Product & Trend Tracker — Authorized Feed (MVP)",
    "description": "Compare authorized TikTok Shop product datasets over time. Live public marketplace search is not included.",
    "version": "0.3",
    "x-build-id": "aNfxk8uH7het8xm2c"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/optirefine~tiktok-shop-trend-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-optirefine-tiktok-shop-trend-tracker",
        "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/optirefine~tiktok-shop-trend-tracker/runs": {
      "post": {
        "operationId": "runs-sync-optirefine-tiktok-shop-trend-tracker",
        "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/optirefine~tiktok-shop-trend-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-optirefine-tiktok-shop-trend-tracker",
        "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": [
          "sourceMode",
          "mode",
          "market",
          "maxProducts",
          "watchKey"
        ],
        "properties": {
          "sourceMode": {
            "title": "Product data source",
            "enum": [
              "sandbase",
              "externalActor",
              "authorizedDataset",
              "syntheticFixture"
            ],
            "type": "string",
            "description": "Choose the actual data provider. SandBase requires a secure API key and permission to use its results.",
            "default": "sandbase"
          },
          "mode": {
            "title": "Operation",
            "enum": [
              "discover",
              "products",
              "monitor"
            ],
            "type": "string",
            "description": "Discover by keyword or monitor the same search across multiple runs. Product ID lookup is currently supported through external Actor only.",
            "default": "discover"
          },
          "market": {
            "title": "Market",
            "enum": [
              "US"
            ],
            "type": "string",
            "description": "Only US input feed semantics are configured for the MVP. Does not imply universal US TikTok Shop coverage.",
            "default": "US"
          },
          "sourceDatasetId": {
            "title": "Authorized product source dataset",
            "type": "string",
            "description": "For authorizedDataset source only. Select a dataset you have permission to read; do not enter the Actor ID."
          },
          "dataRightsConfirmed": {
            "title": "I have rights to use this data",
            "type": "boolean",
            "description": "Required for any real feed. Confirm data rights for your use; paid redistribution additionally requires provider authorization.",
            "default": false
          },
          "sourceRightsReference": {
            "title": "Permission / license reference (optional)",
            "type": "string",
            "description": "Short internal identifier only. Do not paste API secrets, access tokens or private legal documents."
          },
          "productIds": {
            "title": "Product IDs (optional)",
            "type": "array",
            "description": "For external source products mode use numeric TikTok Shop product IDs. For authorized datasets filters rows by exact ID; leave empty to include all records.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxProducts": {
            "title": "Max products",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum normalized products output, shared across all keywords. Up to 100. Upstream charges may still apply to non-product rows.",
            "default": 20
          },
          "watchKey": {
            "title": "Watch identifier",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$",
            "type": "string",
            "description": "Keep this stable across comparisons. Allowed characters: letters, digits, dash and underscore.",
            "default": "default-watch"
          },
          "previousDatasetId": {
            "title": "Previous tracker dataset (optional)",
            "type": "string",
            "description": "For monitor mode, select the output dataset from your previous tracker run; keep watchKey and source the same."
          },
          "keywords": {
            "title": "Product search keywords",
            "type": "array",
            "description": "Enter one or more keywords (e.g., skincare). SandBase uses one API request per keyword, limited by sandbaseMaxRequests.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "upstreamMaxCostUsd": {
            "title": "Maximum upstream charge in USD",
            "minimum": 0.01,
            "maximum": 5,
            "type": "number",
            "description": "Maximum upstream charge for external Apify Actor mode only. NOT a SandBase spending limit.",
            "default": 0.25
          },
          "upstreamReuseConfirmed": {
            "title": "I have permission to use the upstream Actor results",
            "type": "boolean",
            "description": "Required for live source. You are responsible for TikTok terms, upstream Actor terms, and any commercial redistribution authorization. Checkbox is not a license.",
            "default": false
          },
          "sandbaseMaxRequests": {
            "title": "SandBase requests per run",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Hard cap of 1–5 SandBase calls per run. Limits this Actor only; it does not guarantee zero SandBase charges or enforce account-wide daily quotas.",
            "default": 1
          },
          "sandbaseReuseConfirmed": {
            "title": "I have permission to use SandBase results",
            "type": "boolean",
            "description": "Confirm source terms permit your intended use. Commercial redistribution may require separate written permission. Checking does not grant rights.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}