{
  "openapi": "3.0.1",
  "info": {
    "title": "X (Twitter) Followers & Following Scraper",
    "description": "Export followers and following of any X (Twitter) account to clean JSON, CSV or Excel. No login or API key needed. Scrape followers lists, verified followers & subscriptions in bulk. Filter by follower count for lead generation, audience & competitor analysis.",
    "version": "0.0",
    "x-build-id": "sjU8I5newj5h1AP9D"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/b2b_leads~X-Followers-and-Following-Scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-b2b_leads-X-Followers-and-Following-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/b2b_leads~X-Followers-and-Following-Scraper/runs": {
      "post": {
        "operationId": "runs-sync-b2b_leads-X-Followers-and-Following-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/b2b_leads~X-Followers-and-Following-Scraper/run-sync": {
      "post": {
        "operationId": "run-sync-b2b_leads-X-Followers-and-Following-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",
        "properties": {
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "X (Twitter) handles to export, without the @ (e.g. nasa, openai). Their followers and/or following will be scraped based on the relationships you select.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "User IDs (optional)",
            "type": "array",
            "description": "Numeric X user IDs to export. Use this to skip username resolution when you already know the account IDs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "relationships": {
            "title": "Relationships to export",
            "type": "array",
            "description": "Which social graphs to export for each account. 'followers' = accounts that follow them; 'following' = accounts they follow; 'verified_followers' = only verified followers; 'subscriptions' = paid subscriptions. Each selected relationship is exported for every account.",
            "items": {
              "type": "string",
              "enum": [
                "followers",
                "following",
                "verified_followers",
                "subscriptions"
              ],
              "enumTitles": [
                "Followers",
                "Following",
                "Verified followers",
                "Subscriptions"
              ]
            },
            "default": [
              "followers",
              "following"
            ]
          },
          "maxUsersPerAccount": {
            "title": "Max users per account (per relationship)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum users to export for each account, for each selected relationship. Set 0 for unlimited (export the entire graph, bounded only by Max items). Example: 100 with followers+following returns up to 100 followers AND up to 100 following per account.",
            "default": 100
          },
          "minFollowers": {
            "title": "Minimum followers filter",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep exported users who have at least this many followers. Useful for building lead lists of larger accounts. 0 = no filter.",
            "default": 0
          },
          "maxItems": {
            "title": "Max items (global)",
            "minimum": 1,
            "type": "integer",
            "description": "Hard ceiling on the total number of users exported in this run, across all accounts and relationships. This is the main cost lever. Lower it to keep runs small.",
            "default": 100000
          },
          "pageSize": {
            "title": "Page size (per request)",
            "minimum": 1,
            "type": "integer",
            "description": "How many users to request per page. This does NOT limit your total results — the Actor keeps paginating until it hits Max users per account or Max items. Higher values mean fewer requests. Default 1000.",
            "default": 1000
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "type": "integer",
            "description": "How many times to automatically retry a request when the data source is rate-limited or returns a temporary server error.",
            "default": 5
          },
          "retryBaseDelayMs": {
            "title": "Retry base delay (ms)",
            "minimum": 100,
            "type": "integer",
            "description": "Initial wait before the first retry. Grows exponentially on each subsequent retry.",
            "default": 2000
          },
          "retryMaxDelayMs": {
            "title": "Retry max delay (ms)",
            "minimum": 1000,
            "type": "integer",
            "description": "Maximum wait between retries, regardless of exponential growth.",
            "default": 30000
          },
          "includeRaw": {
            "title": "Include raw payload",
            "type": "boolean",
            "description": "Attach the untouched source payload for each user under a 'raw' field. For power users who want every available attribute.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}