{
  "openapi": "3.0.1",
  "info": {
    "title": "X / Twitter Mentions & Keyword Monitor",
    "description": "Monitor X (Twitter) for mentions of handles and keyword watchlists. Returns normalized posts with engagement metadata for brand monitoring, competitive intelligence, and social listening.",
    "version": "1.0",
    "x-build-id": "Ji4jsZTyObr60GlO2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automly~x-twitter-mentions-keyword-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automly-x-twitter-mentions-keyword-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/automly~x-twitter-mentions-keyword-monitor/runs": {
      "post": {
        "operationId": "runs-sync-automly-x-twitter-mentions-keyword-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/automly~x-twitter-mentions-keyword-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-automly-x-twitter-mentions-keyword-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",
        "properties": {
          "handles": {
            "title": "Handles to monitor for mentions",
            "type": "array",
            "description": "Accounts to watch for mentions. Accepts @handles (e.g. @nasa), bare handles (nasa), or profile URLs. Each becomes a search for public posts that mention the account.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords / phrases to monitor",
            "type": "array",
            "description": "Keywords or phrases to watch for. Multi-word entries are matched as an exact phrase. Combine with handles to build a full watchlist.",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Advanced search query",
            "type": "string",
            "description": "Optional raw X search query for power users (supports operators like from:, to:, filter:, OR). Used in addition to handles and keywords. Leave empty if not needed."
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "latest",
              "top"
            ],
            "type": "string",
            "description": "How results are ordered. 'Latest' returns the newest posts first (best for monitoring); 'Top' returns the most relevant posts.",
            "default": "latest"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum number of posts to collect across all monitors in a single run (1-2000).",
            "default": 100
          },
          "since": {
            "title": "Only posts since (date)",
            "type": "string",
            "description": "Optional ISO date (YYYY-MM-DD). Posts created before this date are skipped. Ignored when 'Since minutes' is set."
          },
          "until": {
            "title": "Only posts until (date)",
            "type": "string",
            "description": "Optional ISO date (YYYY-MM-DD). Posts created on or after this date are skipped."
          },
          "sinceMinutes": {
            "title": "Since minutes (rolling window)",
            "minimum": 1,
            "type": "integer",
            "description": "Optional. Only return posts from the last N minutes. Ideal for scheduled monitoring runs. Takes precedence over the 'since' date when set."
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Include posts that are replies to other posts.",
            "default": true
          },
          "includeRetweets": {
            "title": "Include reposts",
            "type": "boolean",
            "description": "Include reposts (retweets). When off, only original posts and quotes are returned.",
            "default": false
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Optional ISO language code to restrict results (e.g. 'en', 'es', 'pt'). Leave empty for all languages."
          },
          "authCookie": {
            "title": "Session cookie (optional)",
            "type": "string",
            "description": "Optional. Your own logged-in X session cookie string (must include the auth_token and ct0 values). Searching X reliably generally requires authenticated session details. Provided by you and stored securely."
          },
          "authHeader": {
            "title": "Authorization header (optional)",
            "type": "string",
            "description": "Optional. A custom Authorization header value to send with requests. Most users can leave this empty."
          },
          "bearerToken": {
            "title": "Bearer token (optional)",
            "type": "string",
            "description": "Optional. A bearer token to use instead of the default web token. Most users can leave this empty."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings used to reach X reliably. Residential proxies are strongly recommended for consistent results."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}