{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Shop Competitor Intelligence — Airtable Sync",
    "description": "Monitor TikTok Shop US competitors in Airtable. Track product and SKU prices, keep observation history, and flag comparable changes. Connect your own Airtable base with an encrypted token. Includes a ready-to-copy dashboard template.",
    "version": "0.1",
    "x-build-id": "6TzGNI7ZEZNQ1zVT5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nexascout~tiktok-shop-intelligence-sync/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nexascout-tiktok-shop-intelligence-sync",
        "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/nexascout~tiktok-shop-intelligence-sync/runs": {
      "post": {
        "operationId": "runs-sync-nexascout-tiktok-shop-intelligence-sync",
        "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/nexascout~tiktok-shop-intelligence-sync/run-sync": {
      "post": {
        "operationId": "run-sync-nexascout-tiktok-shop-intelligence-sync",
        "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": {
          "productUrls": {
            "title": "Product URLs",
            "type": "array",
            "description": "Paste one direct TikTok Shop product page URL per line. US shop.tiktok.com/us/pdp/… and current tiktok.com/shop/pdp/… links are accepted. Current links are normalized to the US storefront; product availability is checked during extraction. Shortened, seller, category and non-US storefront links are refused before product fetching or Airtable writes. A platform start fee may still apply after starting; refused input has no product-check charge.",
            "items": {
              "type": "string"
            }
          },
          "airtableBaseId": {
            "title": "Airtable base",
            "type": "string",
            "description": "Your Airtable base. Paste the app… base ID or the full Airtable URL of your copy of the template (the Actor extracts the base ID automatically). Never use the template's own base ID — use your own copy."
          },
          "airtableToken": {
            "title": "Airtable personal access token (PAT)",
            "type": "string",
            "description": "Your own Airtable personal access token. It must have the data.records:read and data.records:write scopes for your base copy only. Paste it here — it is stored as a secret and never logged or written to the dataset."
          },
          "dataOnly": {
            "title": "Preview only (turn off to sync to Airtable)",
            "type": "boolean",
            "description": "The prefilled Store input (a sample product URL list) runs a paid dataset-only preview without Airtable credentials. Turn this off to sync to your own Airtable base. Product-check pricing applies to previews.",
            "default": false
          },
          "adapter": {
            "title": "Data source",
            "enum": [
              "pdp",
              "apify-monitor",
              "inline"
            ],
            "type": "string",
            "description": "How product data is collected. \"pdp\" (default) fetches each US TikTok Shop product page directly — no extra setup. \"apify-monitor\" and \"inline\" are advanced options.",
            "default": "pdp"
          },
          "watchlist": {
            "title": "Watchlist (legacy JSON, advanced)",
            "type": "array",
            "description": "Advanced alternative to Product URLs. Each entry needs a stable unique watchId, a direct US product URL, and a short label. Optional selectedSkuId tracks one specific SKU of a listing. Do not provide this together with Product URLs."
          },
          "inlineObservations": {
            "title": "Inline observations (advanced)",
            "type": "array",
            "description": "Used only with the inline data source. Advanced/testing only."
          },
          "apifyToken": {
            "title": "Apify API token (advanced)",
            "type": "string",
            "description": "Only needed with the apify-monitor data source. Leave blank — your own Apify token is used automatically. Never logged."
          },
          "monitorActorId": {
            "title": "Monitor Actor ID (advanced)",
            "type": "string",
            "description": "Only used with the apify-monitor data source. Leave as default.",
            "default": "6EAxcKlzd0X1nb63D"
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Storefront region. Only US is currently supported.",
            "default": "US"
          },
          "maxConcurrency": {
            "title": "Max concurrency (advanced)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel workers for the apify-monitor data source only.",
            "default": 1
          },
          "navigationTimeoutSecs": {
            "title": "Navigation timeout in seconds (advanced)",
            "minimum": 10,
            "maximum": 300,
            "type": "integer",
            "description": "Per-page navigation timeout for the apify-monitor data source only.",
            "default": 45
          },
          "maxAttemptsPerProduct": {
            "title": "Max attempts per product (advanced)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum attempts per product for the apify-monitor data source only.",
            "default": 2
          },
          "runTimeoutSecs": {
            "title": "Monitor run timeout in seconds (advanced)",
            "minimum": 60,
            "maximum": 3600,
            "type": "integer",
            "description": "Maximum time to wait for a monitor run to finish (apify-monitor only).",
            "default": 1800
          },
          "dryRun": {
            "title": "Dry run",
            "type": "boolean",
            "description": "Compute results without writing to Airtable. Useful for a first test.",
            "default": false
          },
          "minDeltaGapHours": {
            "title": "Minimum change gap in hours (advanced)",
            "minimum": 0,
            "type": "number",
            "description": "Changes are only computed from repeated observations at least this many hours apart.",
            "default": 6
          },
          "maxDeltaWindowHours": {
            "title": "Maximum change window in hours (advanced)",
            "minimum": 0,
            "type": "number",
            "description": "A baseline older than this many hours is treated as stale and never produces a change. Set to 0 to disable.",
            "default": 720
          },
          "priceDropPercentThreshold": {
            "title": "Price drop threshold in percent (advanced)",
            "type": "number",
            "description": "Raise an alert when a price falls by at least this percent.",
            "default": 5
          },
          "priceRisePercentThreshold": {
            "title": "Price rise threshold in percent (advanced)",
            "type": "number",
            "description": "Raise an alert when a price rises by at least this percent.",
            "default": 5
          },
          "salesSpikePercentThreshold": {
            "title": "Sales spike threshold in percent (advanced)",
            "type": "number",
            "description": "Raise an alert when the sold count rises by at least this percent.",
            "default": 20
          },
          "reviewSpikePercentThreshold": {
            "title": "Review spike threshold in percent (advanced)",
            "type": "number",
            "description": "Raise an alert when the review count rises by at least this percent.",
            "default": 10
          },
          "ratingChangeThreshold": {
            "title": "Rating change threshold in stars (advanced)",
            "type": "number",
            "description": "Raise an alert when a rating moves by at least this many stars.",
            "default": 0.5
          },
          "minVelocityGapHours": {
            "title": "Minimum velocity gap in hours (advanced)",
            "minimum": 0,
            "type": "number",
            "description": "Sales velocity is only derived from two exact sold counts at least this many hours apart.",
            "default": 6
          },
          "minTrendPoints": {
            "title": "Minimum trend points (advanced)",
            "minimum": 3,
            "type": "integer",
            "description": "A trend requires at least this many comparable exact sold counts.",
            "default": 3
          },
          "minTrendSpanHours": {
            "title": "Minimum trend span in hours (advanced)",
            "minimum": 0,
            "type": "number",
            "description": "A trend requires the series to span at least this many hours.",
            "default": 24
          },
          "counterResetPercentThreshold": {
            "title": "Counter reset threshold in percent (advanced)",
            "minimum": 0,
            "type": "number",
            "description": "A sold-count decrease is treated as a counter reset or relisting, never a genuine sales drop.",
            "default": 50
          },
          "newProductFloodThreshold": {
            "title": "New-product summary threshold (advanced)",
            "minimum": 1,
            "type": "integer",
            "description": "When this many or more products are first seen in one run, new-product alerts are combined into a single summary.",
            "default": 5
          },
          "velocityHotUnitsPerDay": {
            "title": "Hot velocity in units per day (advanced)",
            "minimum": 1,
            "type": "number",
            "description": "Sold units per day that maps to a full sales-velocity sub-score.",
            "default": 100
          },
          "maxSeriesPoints": {
            "title": "Max history points per product (advanced)",
            "minimum": 3,
            "type": "integer",
            "description": "Maximum comparable history points kept per product for velocity and trend.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}