{
  "openapi": "3.0.1",
  "info": {
    "title": "X Account Change Monitor",
    "description": "Monitor public X (Twitter) accounts on a schedule. Get one row per change to bio, handle, display name, website, verification badge or follower counts, with previous and current values. No login, no cookies. Pay per account checked and per change found.",
    "version": "1.0",
    "x-build-id": "xcSGqxaUi0pq1kvc7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~x-account-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-x-account-change-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/coregent~x-account-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-coregent-x-account-change-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/coregent~x-account-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-x-account-change-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": "X handles",
            "maxItems": 1000,
            "type": "array",
            "description": "X (Twitter) usernames to watch, one per entry, with or without the @ (e.g. <code>apify</code>, <code>@NASA</code>). The monitor follows each account by its permanent ID, so it keeps tracking an account after it changes its handle.",
            "items": {
              "type": "string"
            }
          },
          "profileUrls": {
            "title": "Profile URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "X or Twitter profile links (e.g. <code>https://x.com/nasa</code>, <code>twitter.com/apify</code>, <code>https://x.com/i/user/11348282</code>). Tweet links are not profiles and are skipped.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "Numeric user IDs",
            "maxItems": 1000,
            "type": "array",
            "description": "X numeric account IDs (e.g. <code>11348282</code>). An ID finds the account even after a handle change.",
            "items": {
              "type": "string"
            }
          },
          "maxAccounts": {
            "title": "Maximum accounts",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Checks at most this many accounts per run, in input order. Accounts beyond the limit are skipped and never charged.",
            "default": 100
          },
          "watchFields": {
            "title": "Fields to watch",
            "type": "array",
            "description": "Profile fields compared with the last snapshot. A change in any of them produces one change row. Follower, following and post counts also need to reach the thresholds below.",
            "items": {
              "type": "string",
              "enum": [
                "bio",
                "username",
                "displayName",
                "website",
                "verified",
                "followersCount",
                "followingCount",
                "postsCount",
                "location",
                "isProtected",
                "profileImageUrl",
                "bannerImageUrl"
              ],
              "enumTitles": [
                "Bio",
                "Handle (username)",
                "Display name",
                "Website",
                "Verification badge",
                "Followers count",
                "Following count",
                "Posts count",
                "Location",
                "Protected (private) status",
                "Profile picture",
                "Banner image"
              ]
            },
            "default": [
              "bio",
              "username",
              "displayName",
              "website",
              "verified",
              "followersCount",
              "followingCount"
            ]
          },
          "metricThresholds": {
            "title": "Count thresholds",
            "type": "object",
            "description": "When a follower, following or post count change is reported. A change must reach BOTH its absolute and its percent threshold, measured against the value at the last reported change (so slow growth is reported once it adds up). Set one of the pair to 0 to use only the other. Keys: <code>followersCountAbsolute</code> (default 100), <code>followersCountPercent</code> (1.0), <code>followingCountAbsolute</code> (1), <code>followingCountPercent</code> (0), <code>postsCountAbsolute</code> (10), <code>postsCountPercent</code> (0). Missing keys use their defaults.",
            "default": {
              "followersCountAbsolute": 100,
              "followersCountPercent": 1
            }
          },
          "outputSnapshots": {
            "title": "Save a snapshot row per account",
            "type": "boolean",
            "description": "Also save each checked account's current profile as an <code>account_snapshot</code> row (with how many changes were found), next to the change rows. Turn off to get change rows only, e.g. for alerts. The account check is charged either way.",
            "default": true
          },
          "stateKey": {
            "title": "State key",
            "pattern": "^[A-Za-z0-9-]{1,40}$",
            "type": "string",
            "description": "Name of the saved snapshot to compare against. Runs with the same key compare with each other; use a different key per watch list (e.g. <code>competitors</code>, <code>clients</code>). Letters, digits and hyphens. The snapshot is stored in your own Apify account, in the key-value store <code>x-account-change-monitor-state</code>.",
            "default": "default"
          },
          "reportUnavailableAccounts": {
            "title": "Report accounts that become unavailable",
            "type": "boolean",
            "description": "Save a change row (field <code>accountStatus</code>, confidence <code>uncertain</code>) when a watched account can't be found for several checks in a row, and another when it comes back. Off by default: a failed lookup is not proof that an account was deleted.",
            "default": false
          },
          "unavailableAfterChecks": {
            "title": "Unavailable after this many failed checks",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many checks in a row must fail before an account is reported as unavailable. Only used when the option above is on.",
            "default": 2
          },
          "maxConcurrency": {
            "title": "Parallel lookups",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many accounts are looked up at the same time.",
            "default": 2
          },
          "includeRawProviderData": {
            "title": "Include raw provider data",
            "type": "boolean",
            "description": "Adds the data provider's raw profile response to each snapshot row. For debugging only; it makes rows much larger.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}