{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Scraper — Posts, Views, Reactions & Monitor",
    "description": "Scrape public Telegram channels into JSON: posts, views, reactions, media, forwards, and channel profiles. No login. Incremental monitor for scheduled runs. A Telegram API alternative for Python, Node.js, and MCP.",
    "version": "0.1",
    "x-build-id": "0hsXZBStbIemobvuM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~telegram-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-telegram-channel-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/crawloop~telegram-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-telegram-channel-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/crawloop~telegram-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-telegram-channel-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "posts",
              "profiles",
              "search",
              "monitor"
            ],
            "type": "string",
            "description": "posts = public channel history; profiles = channel/group metadata only; search = keyword filter inside the given channels; monitor = incremental new posts (named KV watermark).",
            "default": "posts"
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Public t.me / t.me/s URLs, or a single post such as https://t.me/telegram/454. Private invite links (t.me/+ and joinchat) are rejected.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Public usernames or @handles (telegram, @durov). Same as Start URLs; merged and de-duplicated.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword or hashtag to keep (search / monitor, and optional filter in posts). Uses the public preview search plus a text match.",
            "default": ""
          },
          "searchQueries": {
            "title": "Search queries (multi)",
            "type": "array",
            "description": "Optional extra keywords. Merged with Search query.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sinceDate": {
            "title": "Since date",
            "type": "string",
            "description": "Lower bound. ISO date (2026-01-01) or relative lookback (7 days, 2 weeks, 1 month).",
            "default": ""
          },
          "untilDate": {
            "title": "Until date",
            "type": "string",
            "description": "Upper bound. ISO date/datetime. Posts newer than this are skipped.",
            "default": ""
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum dataset rows to push. 0 = unlimited.",
            "default": 100
          },
          "maxPostsPerChannel": {
            "title": "Max posts per channel",
            "minimum": 0,
            "type": "integer",
            "description": "Per-channel cap. 0 = no per-channel cap (still bounded by Max items).",
            "default": 0
          },
          "includeChannelInfo": {
            "title": "Include channel profile on each post",
            "type": "boolean",
            "description": "Copy title, description, subscriber count, verified flag, and avatar onto every post row.",
            "default": true
          },
          "includeReactions": {
            "title": "Include reactions",
            "type": "boolean",
            "description": "Parse reaction tallies when the public preview exposes them (not all channels do).",
            "default": true
          },
          "onlyWithMedia": {
            "title": "Only posts with media",
            "type": "boolean",
            "description": "Skip text-only posts.",
            "default": false
          },
          "messageTypes": {
            "title": "Message types",
            "type": "array",
            "description": "Optional allow-list. Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "photo",
                "video",
                "voice",
                "document",
                "sticker",
                "poll",
                "location",
                "album",
                "service"
              ]
            },
            "default": []
          },
          "monitorStoreName": {
            "title": "Monitor state store name",
            "type": "string",
            "description": "Named key-value store for per-channel lastPostId watermarks. Use a distinct name per schedule.",
            "default": "telegram-channel-monitor"
          },
          "monitorBaselineOnly": {
            "title": "Monitor baseline only (first run)",
            "type": "boolean",
            "description": "If true and no watermark exists yet, record the newest post ids without pushing rows. Later runs emit only new posts.",
            "default": false
          },
          "resetMonitorState": {
            "title": "Reset monitor state",
            "type": "boolean",
            "description": "Clear watermarks in the monitor store before this run.",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. Monitor mode POSTs each new post JSON to this URL (Slack/Discord-style text+content)."
          },
          "telegramToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "Optional bot token for monitor alerts (new posts)."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "Chat/user ID that receives monitor alerts (requires token)."
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "Parallel channel fetches. Keep low; Telegram rate-limits aggressive clients.",
            "default": 3
          },
          "maxRequestsPerSecond": {
            "title": "Max requests / second",
            "minimum": 0.3,
            "maximum": 20,
            "type": "number",
            "description": "Client-side rate limit for t.me requests.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Enable Apify Proxy if you see HTTP 403; switch to RESIDENTIAL for stubborn blocks.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}