{
  "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.2",
    "x-build-id": "Q7aZV9dhB7cELIEnE"
  },
  "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": "Public channel names, @handles or t.me links, for example durov or https://t.me/durov. Add many at once; 8 are read at the same time.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Single post links",
            "type": "array",
            "description": "Optional. Exact public post links such as https://t.me/durov/123. Each saved post is charged like a message.",
            "items": {
              "type": "string"
            }
          },
          "maxMessagesPerChannel": {
            "title": "Max messages per channel",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Most messages to save per channel, newest first. Each saved message is charged. Use 50–200 for monitoring, up to 10,000 for archives.",
            "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": "Adds media_type, media_url and a media list (photo, video, audio, file, sticker). Turn off if you only need text.",
            "default": true
          },
          "includeReactions": {
            "title": "Include reaction breakdowns",
            "type": "boolean",
            "description": "Adds the emoji reaction list and total reaction_count for each message. Some channels switch reactions off, then the list is empty.",
            "default": true
          },
          "keywords": {
            "title": "Keep only messages with these words",
            "type": "array",
            "description": "Optional. A message is kept if its text contains any of these words or phrases (not case sensitive).",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Drop messages with these words",
            "type": "array",
            "description": "Optional. Messages containing any of these words are left out and not charged.",
            "items": {
              "type": "string"
            }
          },
          "mediaTypes": {
            "title": "Only these kinds of posts",
            "type": "array",
            "description": "Optional. Keep posts that have at least one of: photo, video, audio, file, sticker, poll, link_preview, text_only.",
            "items": {
              "type": "string"
            }
          },
          "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."
          },
          "newestMessageDate": {
            "title": "Newest message date",
            "type": "string",
            "description": "Optional. Skip messages newer than this date (YYYY-MM-DD or a full timestamp)."
          },
          "lastNDays": {
            "title": "Only the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Optional. Keep messages from the last N days (1–3650). If you also set an oldest date, the later of the two is used."
          },
          "afterMessageIds": {
            "title": "Start after message number (per channel)",
            "type": "object",
            "description": "Optional. Skip messages at or below a number for chosen channels, for example {\"durov\": 560}. Good for picking up where you stopped."
          },
          "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
          },
          "includeChannelStats": {
            "title": "Add channel statistics",
            "type": "boolean",
            "description": "Adds average and median views, reactions, posts per day and share of posts with media to each channel summary row. Free.",
            "default": false
          },
          "includeContactsSummary": {
            "title": "Add contacts summary",
            "type": "boolean",
            "description": "Adds one row at the end listing the emails, Telegram links, @names and link websites found, with how many messages mention each. Free.",
            "default": true
          },
          "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": "Optional. Leave empty: Telegram's public pages are read directly. Only add your own proxy if your account is refused."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}