{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Scraper — Messages, Views, Links & Emails",
    "description": "Scrape public Telegram channels from t.me links or @handles: message text, dates, view counts, photos, videos, forwards, replies and link previews, plus the emails, links, hashtags and mentions in each post. Filter by date or collect only new posts. No Telegram account or login.",
    "version": "0.0",
    "x-build-id": "CxSiASixo98bX4RvZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~telegram-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-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/memo23~telegram-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-memo23-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/memo23~telegram-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-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": {
          "startUrls": {
            "title": "t.me URLs",
            "type": "array",
            "description": "Full t.me URLs — a channel URL scrapes its message feed (newest first), a direct post URL (t.me/channel/123) scrapes that single message.",
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Channel usernames (alternative to URLs)",
            "type": "array",
            "description": "Bare Telegram channel handles, with or without the @ — e.g. `@telegram` or `durov`. Merged with the URL list above and deduplicated.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search inside channels",
            "type": "string",
            "description": "Return only posts that match this text, using Telegram's own search inside each channel (the same as the search box on t.me/s/{channel}). Example: <code>bitcoin</code>. Works with Oldest/Newest message date, Exclude keywords and Only new messages; an Only-new-messages run with a search keeps its own position, separate from plain runs of the same channel. Leave empty to scrape every post."
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop posts whose text contains ANY of these terms (case-insensitive substring). Example: <code>giveaway</code>, <code>promo</code>. Dropped posts are not saved and not charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Attach each post's public comments to the post row: <code>commentsCount</code> (the post's total) and <code>comments[]</code> with author, author link, date, text, the comment it replies to, and reactions. Works for channels that have comments turned on; other posts get <code>commentsCount: 0</code>. Adds one request per post, so runs take longer. No extra charge.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many of each post's most recent comments to attach when Include comments is on. 1 to 100, default 20.",
            "default": 20
          },
          "includeChannelStats": {
            "title": "Include channel-stats summary row",
            "type": "boolean",
            "description": "When on, emit ONE extra row per channel (type=\"channelStats\") after its messages: subscriber count, posts scraped, average & median views, posts per day, top post URL/views, and engagement rate (avg views ÷ subscribers). Off by default, so existing message-row output is unchanged.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum messages to scrape",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on the number of message rows saved in this run, across all channels. Each channel is scraped newest-first, so the cap keeps the most recent posts. Use it to limit billing.",
            "default": 100
          },
          "oldestDate": {
            "title": "Oldest message date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}",
            "type": "string",
            "description": "Skip messages posted before this date (ISO format, e.g. `2026-01-01`). Also stops pagination early once the feed reaches older posts, saving run time on large channels."
          },
          "newestDate": {
            "title": "Newest message date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}",
            "type": "string",
            "description": "Skip messages posted after this date (ISO format, e.g. `2026-06-30`). Combine with the oldest-date filter to extract an exact date window."
          },
          "sinceLastRun": {
            "title": "Only new messages since last run",
            "type": "boolean",
            "description": "Return only messages posted since the previous run of this Actor, per channel. The highest message ID seen is remembered between runs, so a scheduled job returns just the new posts instead of re-scraping (and re-charging for) the whole feed. Leave off for a full backfill. Has no effect on direct post URLs.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of channels processed in parallel. Pages within one channel are always fetched sequentially (each page's cursor comes from the previous one).",
            "default": 10
          },
          "minConcurrency": {
            "title": "Min concurrency",
            "minimum": 1,
            "type": "integer",
            "description": "Minimum number of channels processed in parallel.",
            "default": 1
          },
          "maxRequestRetries": {
            "title": "Max request retries",
            "minimum": 0,
            "type": "integer",
            "description": "Number of retries before a failed request is given up.",
            "default": 5
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "t.me is served from Telegram's edge with no anti-bot, so no proxy is needed — direct connections are fastest. Configure a proxy here only if your infrastructure requires one.",
            "default": {
              "useApifyProxy": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}