{
  "openapi": "3.0.1",
  "info": {
    "title": "X Followers & Following Scraper — At Scale",
    "description": "Export followers and accounts followed by public X / Twitter profiles. Enter usernames, profile URLs, or user IDs; filter by verification, privacy, follower count, and total posts; then download structured profile data in JSON, CSV, or Excel. No login or API key required.",
    "version": "0.2",
    "x-build-id": "b5HZVO7rF9SdfGBeP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/arjun_code~x-twitter-followers-followings-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-arjun_code-x-twitter-followers-followings-scraper",
        "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/arjun_code~x-twitter-followers-followings-scraper/runs": {
      "post": {
        "operationId": "runs-sync-arjun_code-x-twitter-followers-followings-scraper",
        "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/arjun_code~x-twitter-followers-followings-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-arjun_code-x-twitter-followers-followings-scraper",
        "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": [
          "relationshipType",
          "maxItemsPerUser"
        ],
        "properties": {
          "screenNames": {
            "title": "X usernames or profile URLs",
            "type": "array",
            "description": "Enter one account per line as a username (elonmusk), @handle (@elonmusk), or full profile URL. Numeric user IDs also work here, or you can enter them in the separate field below. Up to 25 distinct input identifiers are accepted across both fields; a username and ID for the same account count separately at input time.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "X user IDs (optional)",
            "type": "array",
            "description": "Enter one positive numeric X user ID per line. You can use this field instead of usernames or profile URLs. Remove the example profile URL above if you want to collect only these IDs. Both fields together accept up to 25 distinct input identifiers.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "relationshipType": {
            "title": "Collect followers or following?",
            "enum": [
              "followers",
              "followings"
            ],
            "type": "string",
            "description": "Choose Followers to find people who follow the account, or Following to find people the account follows. Run the Actor twice if you need both.",
            "default": "followers"
          },
          "maxItemsPerUser": {
            "title": "Profiles per account (0 = all)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum matching follower or following profiles to save for each account. Keep 100 for a quick test, or enter 0 to continue through every page and collect all profiles available from X. When filters are enabled, the Profiles to check for matches limit still applies.",
            "default": 100
          },
          "verification": {
            "title": "Verification status",
            "enum": [
              "any",
              "any_verified",
              "blue_verified",
              "business",
              "government",
              "unverified"
            ],
            "type": "string",
            "description": "Keep all accounts, any account with an X verification signal, or one specific badge type. Blue, Business, and Government badges are separate signals and can overlap.",
            "default": "any"
          },
          "visibility": {
            "title": "Account privacy",
            "enum": [
              "any",
              "public",
              "protected"
            ],
            "type": "string",
            "description": "Keep all accounts, public accounts only, or protected accounts only. Protected accounts limit who can view their posts.",
            "default": "any"
          },
          "minFollowers": {
            "title": "Minimum followers",
            "minimum": 0,
            "type": "integer",
            "description": "Only save accounts with at least this many followers. For example, 1,000 keeps accounts with 1,000 followers or more. Keep 0 to disable this filter.",
            "default": 0
          },
          "maxFollowers": {
            "title": "Maximum followers",
            "minimum": 0,
            "type": "integer",
            "description": "Only save accounts with no more than this many followers. For example, 100,000 keeps accounts with 100,000 followers or fewer. Leave empty for no maximum. This value cannot be lower than Minimum followers."
          },
          "minTweets": {
            "title": "Minimum total posts",
            "minimum": 0,
            "type": "integer",
            "description": "Only save accounts that have published at least this many posts over their lifetime. Keep 0 to disable this filter. This does not measure recent activity.",
            "default": 0
          },
          "maxProfilesScannedPerUser": {
            "title": "Profiles to check for matches",
            "minimum": 0,
            "type": "integer",
            "description": "Used only with filters. For each account, the Actor checks up to this many follower or following profiles while looking for matches. Default: 20,000. Lower it for a shorter run, increase it for narrow filters, or enter 0 to check until X ends the list.",
            "default": 20000
          },
          "includeRawUser": {
            "title": "Include full raw X user data",
            "type": "boolean",
            "description": "Leave this off for clean, spreadsheet-friendly results. Turn it on only when you need the complete original X user object in raw_user; this makes each Dataset item 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}