{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Group Scraper — Bio, Phone & Premium MCP Server",
    "description": "Extract ALL members from ANY Telegram supergroup — phone numbers, bios, premium status, last seen & language. 3x faster parallel bio fetching, auto-resume, FloodWait handling. Native MCP Server for AI Agents. Pay-per-result $1/1k members. Actively maintained in 2026.",
    "version": "0.0",
    "x-build-id": "9LqpqUrcXMlmaobuT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/opportunity-biz~telegram-group-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-opportunity-biz-telegram-group-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/opportunity-biz~telegram-group-scraper/runs": {
      "post": {
        "operationId": "runs-sync-opportunity-biz-telegram-group-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/opportunity-biz~telegram-group-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-opportunity-biz-telegram-group-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": [
          "groupUrl",
          "sessionString"
        ],
        "properties": {
          "groupUrl": {
            "title": "🔗 Telegram Group URL or Username",
            "type": "string",
            "description": "Paste the **@username** or **t.me/...** link of the Telegram group you want to scrape.\n\n**✅ Works with:** supergroups where you can see the member list inside the Telegram app.\n**❌ Does NOT work with:** broadcast channels (like @telegram).\n\n📌 **Example:** `@mychatgroup` or `https://t.me/mychatgroup`"
          },
          "sessionString": {
            "title": "🔐 Your Telethon Session String",
            "type": "string",
            "description": "Your personal **session key** that connects your Telegram account. Generate it **once** using the script in the README (5-minute setup).\n\n📌 **Never expires** — generate once, reuse forever.\n📌 **Kept secret** — the platform encrypts it automatically.\n📌 **No logout needed** — valid unless you manually revoke it from Telegram Settings → Devices."
          },
          "maxMembers": {
            "title": "👥 Max Members to Scrape",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "How many members do you want? Set a limit to control cost and speed.\n\n• **100** — Quick test, ~3 seconds\n• **1,000** — Small group, ~30 seconds (default)\n• **10,000** — Medium group, ~5 minutes\n• **50,000** — Large group (maximum)",
            "default": 1000
          },
          "scrapingMode": {
            "title": "🚀 Speed Mode",
            "enum": [
              "fast",
              "balanced",
              "safe"
            ],
            "type": "string",
            "description": "Choose how fast you want to scrape. Faster modes use more concurrency but may increase flood-wait risk on larger groups.\n\n**⚡ Fast** — Best for small-to-medium groups. 10 parallel bio requests.\n**⚖️ Balanced** — Recommended for most users. 5 parallel bio requests.\n**🛡️ Safe** — Minimal risk for large groups or sensitive accounts. 2 parallel bio requests.\n\n📌 **Without bio** (fetchBio: false), all modes are similarly fast (~30s for 500 members).\n📌 **With bio** (fetchBio: true), choose wisely: Fast ~2min, Balanced ~8min, Safe ~20min per 500 members.",
            "default": "balanced"
          },
          "enableResume": {
            "title": "💾 Auto-Resume on Crash",
            "type": "boolean",
            "description": "**Save progress every 200 members.** If the run crashes or times out, just restart and it picks up exactly where it left off. **No data lost, no need to start over.**\n\n🔥 **Recommended: ON** — always protects your progress.\n💡 Works great with scheduled runs and large groups.",
            "default": true
          },
          "fetchBio": {
            "title": "📝 Fetch Profile Bios",
            "type": "boolean",
            "description": "Enable to scrape each member's **profile description (bio)**.\n\n📌 **Without bio (default):** ~30 seconds for 500 members\n📌 **With bio:** ~2–20 minutes depending on speed mode\n\n⚠️ Only enable if you specifically need bio data for lead qualification or persona analysis.",
            "default": false
          },
          "excludeBots": {
            "title": "🤖 Exclude Bot Accounts",
            "type": "boolean",
            "description": "Remove automated bot accounts from your results.\n\n📌 **ON** → Only real human users in your dataset.\n📌 **OFF** → Includes bots (useful for auditing).",
            "default": false
          },
          "excludeDeleted": {
            "title": "🗑️ Exclude Deleted Accounts",
            "type": "boolean",
            "description": "Remove deleted/deactivated accounts from your results.\n\n📌 **ON (default)** → Clean dataset of active users only.\n📌 **OFF** → Includes zombie accounts.",
            "default": true
          },
          "proxyIp": {
            "title": "Proxy IP Address",
            "type": "string",
            "description": "IP address of your SOCKS5 proxy. Leave empty if you don't use a proxy.\n\n📌 **Format:** `123.456.78.90`\n📌 **Need a proxy?** Any SOCKS5 provider works."
          },
          "proxyPort": {
            "title": "Proxy Port",
            "type": "integer",
            "description": "Port number of your SOCKS5 proxy.\n\n📌 **Example:** `1080`"
          },
          "proxyUsername": {
            "title": "Proxy Username",
            "type": "string",
            "description": "Authentication username for your proxy (if required)."
          },
          "proxyPassword": {
            "title": "Proxy Password",
            "type": "string",
            "description": "Authentication password for your proxy (if required)."
          },
          "webhookNotificationUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "If set, the Actor sends a **structured JSON payload** to this URL after every run.\n\n**Includes:** run_id, dataset_id, group info, stats (speed, elapsed time, flood waits handled), new members (if diff is enabled), and triggered alert signals.\n\n📌 Perfect for: n8n workflows, Slack notifications, Google Sheets logging."
          },
          "previousRunId": {
            "title": "Previous Run ID (for Diff)",
            "type": "string",
            "description": "Paste a **previous run ID** to detect **new members only**. The Actor compares current vs previous members and flags newcomers in the webhook.\n\n📌 Use this in scheduled runs to **track group growth over time**."
          },
          "alertRules": {
            "title": "Alert Rules",
            "type": "array",
            "description": "Define custom conditions that trigger signals in the webhook.\n\n**Each rule is an object with:**\n- `field`: member field to check (e.g. `\"bio\"`, `\"username\"`, `\"member_count_delta\"`)\n- `contains`: keyword to look for (case-insensitive)\n- `gt`: numeric threshold for `member_count_delta`\n\n**Examples:**\n- `[{\"field\": \"bio\", \"contains\": \"investor\"}]` → alerts when someone with \"investor\" in bio joins\n- `[{\"field\": \"member_count_delta\", \"gt\": 50}]` → alerts when group grows by 50+ members"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}