{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channels Scraper: Messages, Contacts & Leads",
    "description": "Scrape public Telegram channel messages with every email and link in each post pulled out for you, plus views, reactions and media. Schedule it to collect only new messages, with no account or phone number.",
    "version": "1.0",
    "x-build-id": "SYvz4HRwG1nh0Kowf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~telegram-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-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/khadinakbar~telegram-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-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/khadinakbar~telegram-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-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",
        "properties": {
          "channels": {
            "title": "Channel usernames or URLs",
            "type": "array",
            "description": "Use this field when the user provides specific Telegram channel names, @handles, or t.me URLs. Accepts any of: plain username (e.g. 'durov'), @handle (e.g. '@durov'), or full URL (e.g. 'https://t.me/durov'). Do NOT use this field when the user describes a topic or niche — this actor only works with known channel names. You can provide multiple channels in one run.",
            "items": {
              "type": "string"
            }
          },
          "maxMessagesPerChannel": {
            "title": "Max messages per channel",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of messages to extract per channel. The actor paginates automatically to get older messages. Use a lower value (e.g. 50–200) for monitoring recent activity, or a higher value (500–2000) for full archive extraction. Each message is charged separately.",
            "default": 100
          },
          "includeChannelInfo": {
            "title": "Include channel metadata",
            "type": "boolean",
            "description": "When enabled, adds a channel_info record to the dataset with the channel title, description, subscriber count, verification status, and avatar URL. Highly recommended — leave this on unless you only need raw message data.",
            "default": true
          },
          "includeMedia": {
            "title": "Include media URLs",
            "type": "boolean",
            "description": "When enabled, extracts media_type (photo/video/sticker/document) and media_url from each message. Disable if you only need text and engagement data.",
            "default": true
          },
          "includeReactions": {
            "title": "Include reaction breakdowns",
            "type": "boolean",
            "description": "When enabled, extracts the full reactions array (emoji + count per reaction type) and total reaction_count for each message. Disable to reduce output size.",
            "default": true
          },
          "oldestMessageDate": {
            "title": "Oldest message date (stop scraping before this date)",
            "type": "string",
            "description": "Return messages with observed dates at or after this cutoff. Enter YYYY-MM-DD or a timezone-qualified ISO timestamp. For a relative period, calculate its cutoff date first. Unknown timestamps are skipped and reported as incomplete coverage."
          },
          "sinceLastRun": {
            "title": "Only new messages since last run (incremental mode)",
            "type": "boolean",
            "description": "Establish a recent baseline on the first run, then collect messages newer than the saved checkpoint. Incomplete runs retain the old checkpoint and may replay saved messages. Increase maxMessagesPerChannel to cover the backlog and run scheduled collections sequentially.",
            "default": false
          },
          "discoverRelated": {
            "title": "Discover related channels",
            "type": "boolean",
            "description": "Use this field when the user says 'find related channels', 'discover more channels like this', or 'expand my channel list'. When enabled, the actor extracts channel handles from forwarded messages and adds them as discovered_channel records in the output. Useful for building channel networks for lead gen or research.",
            "default": false
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "json",
              "markdown"
            ],
            "type": "string",
            "description": "Use 'markdown' when the user wants to paste results into ChatGPT/Claude, use this for AI analysis, or says 'format for LLM'. The markdown format adds a markdown_preview field to every message record — a compact single-line summary ideal for LLM context windows. Use 'json' (default) for all other integrations (Make.com, Zapier, spreadsheets, etc.).",
            "default": "json"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "HTTP proxy settings. Defaults to Apify datacenter proxies. Only change this if you are experiencing blocks — Telegram's web preview is generally accessible without residential proxies."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}