{
  "openapi": "3.0.1",
  "info": {
    "title": "Threads Brand Monitor",
    "description": "Monitor Threads for brand mentions, competitor posts, keyword activity, and alerts with scheduled Apify runs.",
    "version": "1.1",
    "x-build-id": "aU1LhoW3mvUuYdeuy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/digitalnomadph~threads-brand-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-digitalnomadph-threads-brand-monitor",
        "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/digitalnomadph~threads-brand-monitor/runs": {
      "post": {
        "operationId": "runs-sync-digitalnomadph-threads-brand-monitor",
        "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/digitalnomadph~threads-brand-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-digitalnomadph-threads-brand-monitor",
        "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": [
          "watchlists"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "brand_monitor",
              "monitor_new_posts"
            ],
            "type": "string",
            "description": "Choose the run style. 'brand_monitor' emits posts, profiles, summaries, alerts, and a run summary (default, full behavior). 'monitor_new_posts' is a scheduled-run mode that emits only new post/reply/author rows plus a compact run summary.",
            "default": "brand_monitor"
          },
          "watchlists": {
            "title": "Watchlists",
            "type": "array",
            "description": "Groups of handles, keywords, and hashtags to monitor. Each group produces separate summary rows."
          },
          "searchCoverage": {
            "title": "Search Coverage",
            "enum": [
              "focused",
              "balanced"
            ],
            "type": "string",
            "description": "'focused' searches the most relevant view only (default, fastest). 'balanced' also fetches a recent-oriented view and merges results, improving coverage of newer posts at the cost of extra requests.",
            "default": "focused"
          },
          "maxPostsPerKeyword": {
            "title": "Max Posts Per Keyword",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum posts to collect per keyword search query.",
            "default": 50
          },
          "maxPostsPerHandle": {
            "title": "Max Posts Per Handle",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum posts to collect from each monitored handle's timeline.",
            "default": 25
          },
          "dateFrom": {
            "title": "Date From",
            "type": "string",
            "description": "Only include posts published on or after this date. Format: YYYY-MM-DD"
          },
          "dateTo": {
            "title": "Date To",
            "type": "string",
            "description": "Only include posts published on or before this date. Format: YYYY-MM-DD"
          },
          "includeReplies": {
            "title": "Include Replies (deprecated — use Include Profile Replies)",
            "type": "boolean",
            "description": "Deprecated alias for includeProfileReplies. If enabled, replies already present in monitored handle timelines are included in the output. Increases runtime significantly.",
            "default": false
          },
          "includeProfileReplies": {
            "title": "Include Profile Replies",
            "type": "boolean",
            "description": "If enabled, replies that appear in monitored handle timelines are included in the output. This does not fetch full reply threads under matched posts. Increases runtime significantly."
          },
          "includeProfileStats": {
            "title": "Include Profile Stats",
            "type": "boolean",
            "description": "If enabled, emits a profile record with follower count and bio for each monitored handle.",
            "default": true
          },
          "deltaMode": {
            "title": "Delta Mode (deprecated — use Only New Posts)",
            "type": "boolean",
            "description": "Deprecated alias for onlyNewPosts. Only return posts newer than the last run. Ideal for scheduled monitoring runs.",
            "default": false
          },
          "onlyNewPosts": {
            "title": "Only New Posts",
            "type": "boolean",
            "description": "Return only posts that were not seen in previous runs, using both the last-run anchor and a persisted seen-post set. Ideal for scheduled monitoring runs. Defaults to true automatically when Mode is 'monitor_new_posts'."
          },
          "includeReplyThreads": {
            "title": "Include Reply Threads",
            "type": "boolean",
            "description": "If enabled, fetches the public post page for each matched/pushed post and emits its top-level replies as separate 'reply' records. Increases runtime and output size.",
            "default": false
          },
          "replyDepth": {
            "title": "Reply Depth",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "How many reply levels to include when Include Reply Threads is enabled, if the underlying data supports nesting. Depth 1 (top-level replies) is fully supported today.",
            "default": 1
          },
          "includeAuthorDetails": {
            "title": "Include Author Details",
            "type": "boolean",
            "description": "If enabled, emits an 'author' record for each distinct post author discovered during the run, with bio, follower count, verification status, and bio links.",
            "default": false
          },
          "includeAuthorContacts": {
            "title": "Include Author Contacts",
            "type": "boolean",
            "description": "If enabled, extracts emails and phone numbers from public author bio text (and bio links, if Follow Author Links is also enabled) and adds them to the author record. Enabling this alone (with Include Author Details left off) still emits author records. Off by default. You are responsible for lawful processing of any extracted contact data and for compliance with platform terms — see README.",
            "default": false
          },
          "followAuthorLinks": {
            "title": "Follow Author Links",
            "type": "boolean",
            "description": "If enabled together with Include Author Contacts, fetches a bounded number of public bio-link-hub pages (e.g. Linktree) per author to look for additional emails, phone numbers, and links. Off by default.",
            "default": false
          },
          "includeReports": {
            "title": "Include Reports",
            "type": "boolean",
            "description": "If enabled (default), emits per-group summary and alert records. Disable to return only post/reply/author/profile rows plus the compact run summary. The run summary is always emitted regardless of this setting.",
            "default": true
          },
          "riskKeywords": {
            "title": "Risk Keywords",
            "type": "array",
            "description": "Posts matching any of these keywords trigger alert records and are flagged in output.",
            "default": [
              "outage",
              "refund",
              "bug",
              "broken",
              "support",
              "scam",
              "cancel"
            ]
          },
          "minEngagement": {
            "title": "Minimum Engagement Filter",
            "minimum": 0,
            "type": "integer",
            "description": "Only include posts with at least this many total interactions (likes + replies + reposts). Set to 0 to include all.",
            "default": 0
          },
          "alertThresholds": {
            "title": "Alert Thresholds",
            "type": "object",
            "description": "Configure when alert records are emitted. mentionSpikeMultiplier controls whole-group and per-query mention-spike alerts. minEngagementForAlert controls high-engagement-post alerts. competitorBreakoutMultiplier controls competitor_breakout alerts (fires when a 'competitor' group's volume or engagement jumps this many times vs. its previous run). riskPostAlertLevel is the minimum severity ('low', 'medium', or 'high') a risk-keyword post alert must reach to be emitted.",
            "default": {
              "mentionSpikeMultiplier": 3,
              "minEngagementForAlert": 100,
              "competitorBreakoutMultiplier": 2,
              "riskPostAlertLevel": "low"
            }
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Residential proxies are recommended for keyword search. Threads blocks datacenter IPs on some routes."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}