{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Scraper",
    "description": "Tracking Telegram channels by scrolling misses posts and numbers. Scrape public channels in bulk: messages, views, reactions, media, links, polls, comments, subscriber counts and engagement stats, with keyword and date filters. No login needed.",
    "version": "1.0",
    "x-build-id": "Hs0yAOjSX8wpmRilz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawl_craft~telegram-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawl_craft-telegram-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/crawl_craft~telegram-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawl_craft-telegram-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/crawl_craft~telegram-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawl_craft-telegram-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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "📡 Channels, links or usernames",
            "minItems": 1,
            "type": "array",
            "description": "Public channel usernames (durov), @handles, channel links (https://t.me/telegram), post links (https://t.me/durov/528) or search links (https://t.me/s/durov?q=ton). Add as many as you like.",
            "items": {
              "type": "string"
            }
          },
          "collectMessages": {
            "title": "💬 Collect messages",
            "type": "boolean",
            "description": "Turn off to get channel profiles only (title, bio, subscribers, statistics) without messages.",
            "default": true
          },
          "maxMessagesPerChannel": {
            "title": "🔢 Max messages per channel",
            "minimum": 0,
            "type": "integer",
            "description": "Newest messages to collect from each channel. 0 means no limit. Free plan users get up to 10 results per run; paid plans have no limit.",
            "default": 10
          },
          "dateFrom": {
            "title": "⏪ Messages newer than",
            "type": "string",
            "description": "Only messages on or after this day. Pick a date, or use a relative value such as 7 days or 2 weeks."
          },
          "dateTo": {
            "title": "⏩ Messages older than",
            "type": "string",
            "description": "Only messages on or before this day (the whole day is included). Same options as the start date."
          },
          "scrapeLastNDays": {
            "title": "📅 Messages from the last N days",
            "minimum": 0,
            "type": "integer",
            "description": "1 returns only today's messages, 2 yesterday and today, and so on. If a start date is also set, the more recent of the two is used."
          },
          "messageIdFrom": {
            "title": "🏁 First message ID",
            "minimum": 0,
            "type": "integer",
            "description": "Only messages with this ID or higher."
          },
          "messageIdTo": {
            "title": "🚩 Last message ID",
            "minimum": 0,
            "type": "integer",
            "description": "Only messages with this ID or lower."
          },
          "searchQueries": {
            "title": "🔍 Search inside channels",
            "type": "array",
            "description": "Run Telegram's own channel search for each phrase and collect the matching messages.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeKeywords": {
            "title": "🏷 Keep messages containing",
            "type": "array",
            "description": "Keep only messages that contain these words or phrases. Leave empty to keep everything.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "🚫 Drop messages containing",
            "type": "array",
            "description": "Drop messages that contain any of these words or phrases.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywordMatch": {
            "title": "🧩 Keyword match mode",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "any keeps a message that has at least one of the keep-words; all requires every one of them.",
            "default": "any"
          },
          "keywordRegex": {
            "title": "🧪 Keywords are regular expressions",
            "type": "boolean",
            "description": "Treat the keyword lists as regular expressions instead of plain text.",
            "default": false
          },
          "caseSensitive": {
            "title": "🔠 Case-sensitive keywords",
            "type": "boolean",
            "description": "Match upper and lower case letters exactly.",
            "default": false
          },
          "contentTypes": {
            "title": "🖼 Only these content types",
            "type": "array",
            "description": "Keep only messages that contain at least one of the selected types. Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "photo",
                "video",
                "gif",
                "document",
                "audio",
                "voice",
                "round_video",
                "sticker",
                "poll",
                "link_preview"
              ],
              "enumTitles": [
                "Text",
                "Photo",
                "Video",
                "GIF",
                "Document",
                "Audio",
                "Voice message",
                "Round video",
                "Sticker",
                "Poll",
                "Link preview"
              ]
            },
            "default": []
          },
          "minViews": {
            "title": "👁 Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Drop messages with fewer views than this.",
            "default": 0
          },
          "minReactions": {
            "title": "❤️ Minimum reactions",
            "minimum": 0,
            "type": "integer",
            "description": "Drop messages with fewer total reactions than this.",
            "default": 0
          },
          "forwards": {
            "title": "🔀 Forwarded messages",
            "enum": [
              "include",
              "exclude",
              "only"
            ],
            "type": "string",
            "description": "Include forwarded messages, exclude them, or return only forwarded messages.",
            "default": "include"
          },
          "includeServiceMessages": {
            "title": "🛎 Include service messages",
            "type": "boolean",
            "description": "Also return notices such as channel created or photo updated.",
            "default": false
          },
          "exactSubscriberCount": {
            "title": "👥 Exact subscriber count",
            "type": "boolean",
            "description": "Return 10459608 instead of 10.4M.",
            "default": true
          },
          "channelStats": {
            "title": "📊 Channel statistics",
            "type": "boolean",
            "description": "Add average views, engagement rate, posting frequency, top hashtags and more to each channel.",
            "default": true
          },
          "extractEntities": {
            "title": "🔗 Extract hashtags, links and contacts",
            "type": "boolean",
            "description": "Add hashtags, mentions, links, emails, phone numbers and crypto addresses found in each message.",
            "default": true
          },
          "includeHtml": {
            "title": "🧾 Include message HTML",
            "type": "boolean",
            "description": "Add the formatted message HTML (bold, links) next to the plain text.",
            "default": false
          },
          "collectComments": {
            "title": "🗨 Collect comments",
            "type": "boolean",
            "description": "Collect public comments of posts in channels that have a discussion group. Comments are added to each message and to a separate Comments table.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "💭 Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Newest comments to keep for each post. 0 means all.",
            "default": 10
          },
          "discoverRelatedChannels": {
            "title": "🧭 Discover related channels",
            "type": "boolean",
            "description": "Also scrape channels that appear in forwards, mentions and links of the collected messages.",
            "default": false
          },
          "discoveryDepth": {
            "title": "🪜 Discovery depth",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "How many levels of related channels to follow.",
            "default": 1
          },
          "maxDiscoveredChannels": {
            "title": "🛰 Max discovered channels",
            "minimum": 0,
            "type": "integer",
            "description": "Upper limit of extra channels added by discovery.",
            "default": 20
          },
          "downloadMedia": {
            "title": "📥 Save media files",
            "type": "boolean",
            "description": "Telegram file links expire. Save the selected media types to the run's storage and return a permanent link in localPath.",
            "default": false
          },
          "mediaTypesToDownload": {
            "title": "🎞 Media types to save",
            "type": "array",
            "description": "Which media to save when saving is on.",
            "items": {
              "type": "string",
              "enum": [
                "photo",
                "video",
                "gif",
                "voice",
                "round_video",
                "sticker"
              ],
              "enumTitles": [
                "Photo",
                "Video",
                "GIF",
                "Voice message",
                "Round video",
                "Sticker"
              ]
            },
            "default": [
              "photo"
            ]
          },
          "maxMediaSizeMB": {
            "title": "📏 Max file size",
            "minimum": 0,
            "type": "integer",
            "description": "Skip files larger than this. 0 means no limit.",
            "default": 20
          },
          "incrementalMode": {
            "title": "🔁 Only new messages since last run",
            "type": "boolean",
            "description": "Return only messages newer than the newest one seen in your previous run of this mode. Ideal for scheduled monitoring.",
            "default": false
          },
          "webhookUrl": {
            "title": "📣 Webhook URL",
            "type": "string",
            "description": "Optional address that receives a short JSON summary when the run finishes."
          },
          "outputMode": {
            "title": "🗂 Result format",
            "enum": [
              "messages",
              "legacy"
            ],
            "type": "string",
            "description": "Detailed gives one rich row per message (plus separate Channels and Comments tables). Compact gives one row per message with profile fields at the top.",
            "default": "messages"
          },
          "concurrency": {
            "title": "🚀 Parallel runs",
            "minimum": 1,
            "maximum": 32,
            "type": "integer",
            "description": "Speed setting for the run, from 1 to 32. Higher values finish faster.",
            "default": 8
          },
          "maxRetries": {
            "title": "🔄 Retries",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many times to try again when something fails before giving up.",
            "default": 3
          },
          "requestTimeout": {
            "title": "⏲ Timeout",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Seconds to wait before giving up on a step.",
            "default": 40
          },
          "maxScanned": {
            "title": "🧮 Max messages checked per channel",
            "minimum": 0,
            "type": "integer",
            "description": "Upper limit of messages checked per channel when filters are strict. 0 means no limit.",
            "default": 20000
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "Optional proxy settings. Leave the default unless you want to use your own proxy.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}