{
  "openapi": "3.0.1",
  "info": {
    "title": "X Signal",
    "description": "Monitor Twitter/X on autopilot. Track brands, keywords & accounts and get only NEW tweets - deduplicated, enriched with sentiment, intent & entities - via dataset or webhook alerts. Built-in MCP tools let AI agents search & analyze X in real time. Pay per event, only for what you use.",
    "version": "0.0",
    "x-build-id": "fTAZruFZUrbe7fzHY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rexreus~x-signal/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rexreus-x-signal",
        "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/rexreus~x-signal/runs": {
      "post": {
        "operationId": "runs-sync-rexreus-x-signal",
        "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/rexreus~x-signal/run-sync": {
      "post": {
        "operationId": "run-sync-rexreus-x-signal",
        "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": [
          "monitorId",
          "targetKind",
          "query"
        ],
        "properties": {
          "monitorId": {
            "title": "Monitor ID",
            "pattern": "^[a-z0-9][a-z0-9._-]{2,63}$",
            "type": "string",
            "description": "Stable id; same id across runs = same monitor (dedup state)."
          },
          "targetKind": {
            "title": "Target",
            "enum": [
              "search",
              "userTimeline"
            ],
            "type": "string",
            "description": "Search mode: 'search' for keyword queries, 'userTimeline' for a specific user's tweets.",
            "default": "search"
          },
          "query": {
            "title": "Query or handle",
            "type": "string",
            "description": "Search query (targetKind=search) or @handle (userTimeline)."
          },
          "backfillWindowHours": {
            "title": "Backfill Window (hours)",
            "minimum": 1,
            "maximum": 168,
            "type": "integer",
            "description": "How far back (in hours) to look on the first run when no cursor exists yet.",
            "default": 24
          },
          "maxNewItemsPerRun": {
            "title": "Max New Items Per Run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of new unique signals to emit per run. Acts as a cost cap.",
            "default": 1000
          },
          "enrichThread": {
            "title": "Enrich Thread Context",
            "type": "boolean",
            "description": "Fetch parent thread context for each tweet to provide conversation history.",
            "default": false
          },
          "threadDepth": {
            "title": "Thread Depth",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of parent tweets to fetch when enrichThread is enabled.",
            "default": 10
          },
          "providerPrimaryId": {
            "title": "Primary Provider",
            "type": "string",
            "description": "Apify Actor ID for the primary upstream tweet scraper. The default works on the Apify Free Plan.",
            "default": "kaitoeasyapi/twitter-x-data-tweet-scraper-pay-per-result-cheapest"
          },
          "providerFallbackId": {
            "title": "Fallback Provider",
            "type": "string",
            "description": "Fallback scraper Actor ID (apidojo requires a paid Apify plan for API use). Set to null to disable fallback.",
            "default": "apidojo/tweet-scraper"
          },
          "llmEnabled": {
            "title": "Enable LLM Enrichment",
            "type": "boolean",
            "description": "Enable LLM-powered enrichment for higher accuracy sentiment/intent analysis.",
            "default": false
          },
          "llmProvider": {
            "title": "LLM Provider",
            "enum": [
              "openai",
              "anthropic",
              "google"
            ],
            "type": "string",
            "description": "LLM provider to use for enrichment. Requires llmEnabled=true.",
            "default": "openai"
          },
          "llmModel": {
            "title": "LLM Model",
            "type": "string",
            "description": "Model identifier for the selected LLM provider.",
            "default": "gpt-4o-mini"
          },
          "llmApiKey": {
            "title": "LLM API Key",
            "type": "string",
            "description": "API key for the LLM provider. Required when llmEnabled is true."
          },
          "llmBatchSize": {
            "title": "LLM Batch Size",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Number of tweets to send per LLM batch request. Higher = fewer calls, more latency.",
            "default": 20
          },
          "filter": {
            "title": "Filter Config",
            "type": "object",
            "description": "See FilterConfig in data-model.md. Keys: minLikes, minRetweets, minViews, languages[], authorAllow[], authorDeny[], intentTypes[], excludeRetweets, excludeReplies.",
            "default": {}
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "HTTPS endpoint to receive real-time signal alerts via POST."
          },
          "webhookSecret": {
            "title": "Webhook Secret",
            "type": "string",
            "description": "HMAC-SHA256 signing secret for webhook payload verification."
          },
          "webhookBatch": {
            "title": "Webhook Batch Mode",
            "type": "boolean",
            "description": "Send all signals in a single webhook call instead of one per signal.",
            "default": false
          },
          "keepRaw": {
            "title": "Keep Raw Response",
            "type": "boolean",
            "description": "Include the raw upstream provider response in each dataset row.",
            "default": false
          },
          "logLevel": {
            "title": "Log Level",
            "enum": [
              "debug",
              "info",
              "warn",
              "error"
            ],
            "type": "string",
            "description": "Logging verbosity level. Use 'debug' for troubleshooting.",
            "default": "info"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}