{
  "openapi": "3.0.1",
  "info": {
    "title": "Social Commerce Product Trend Detector",
    "version": "2.0",
    "x-build-id": "Gtxk6CIK9DANv3H63"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kayhermes~social-commerce-product-trend-detector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kayhermes-social-commerce-product-trend-detector",
        "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/kayhermes~social-commerce-product-trend-detector/runs": {
      "post": {
        "operationId": "runs-sync-kayhermes-social-commerce-product-trend-detector",
        "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/kayhermes~social-commerce-product-trend-detector/run-sync": {
      "post": {
        "operationId": "run-sync-kayhermes-social-commerce-product-trend-detector",
        "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": {
          "observations": {
            "title": "Observations",
            "type": "array",
            "description": "Detect product momentum, commerce velocity, cross-platform breadth, saturation, trend stage changes, and actionable alerts.",
            "default": [
              {
                "observationId": "a1",
                "productId": "portable-blender",
                "productName": "Portable Blender",
                "timestamp": "2026-07-01T00:00:00Z",
                "platform": "tiktok",
                "creatorId": "c1",
                "views": 1500,
                "likes": 100,
                "shares": 12,
                "orders": 3,
                "revenue": 120
              },
              {
                "observationId": "a2",
                "productId": "portable-blender",
                "productName": "Portable Blender",
                "timestamp": "2026-07-12T00:00:00Z",
                "platform": "tiktok",
                "creatorId": "c2",
                "views": 35000,
                "likes": 4200,
                "shares": 850,
                "saves": 600,
                "orders": 170,
                "revenue": 6800,
                "mentionCount": 18
              },
              {
                "observationId": "a3",
                "productId": "portable-blender",
                "timestamp": "2026-07-13T00:00:00Z",
                "platform": "instagram",
                "creatorId": "c3",
                "views": 24000,
                "likes": 2600,
                "shares": 500,
                "orders": 90,
                "revenue": 3600,
                "mentionCount": 12
              },
              {
                "observationId": "b1",
                "productId": "sunset-lamp",
                "productName": "Sunset Lamp",
                "timestamp": "2026-07-02T00:00:00Z",
                "platform": "tiktok",
                "creatorId": "c4",
                "views": 12000,
                "likes": 1000,
                "orders": 25,
                "mentionCount": 10
              },
              {
                "observationId": "b2",
                "productId": "sunset-lamp",
                "timestamp": "2026-07-13T00:00:00Z",
                "platform": "tiktok",
                "creatorId": "c4",
                "views": 900,
                "likes": 40,
                "orders": 1,
                "mentionCount": 1
              }
            ]
          },
          "datasetId": {
            "title": "Source Dataset ID",
            "type": "string",
            "description": "Provide Source Dataset ID."
          },
          "sourceUrls": {
            "title": "CSV or JSON source URLs",
            "type": "array",
            "description": "Provide CSV or JSON source URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "options": {
            "title": "Analysis options",
            "type": "object",
            "description": "Provide Analysis options.",
            "default": {
              "asOfDate": "2026-07-14T00:00:00Z",
              "recentWindowDays": 7,
              "previousWindowDays": 7,
              "alertScoreDelta": 12
            }
          },
          "stateStoreName": {
            "title": "Optional named state store",
            "type": "string",
            "description": "Provide Optional named state store."
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Provide Maximum records.",
            "default": 10000
          },
          "webhookUrl": {
            "title": "Alert or completion webhook",
            "type": "string",
            "description": "Provide Alert or completion webhook."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}