{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Scraper: Posts, Views, Media, Subscribers",
    "description": "Scrape public Telegram channels without login: posts with text, views, reactions, photo and video URLs, links, hashtags, forwards and replies, plus channel info with exact subscriber counts. Date range, keyword and media filters.",
    "version": "1.0",
    "x-build-id": "DEtu45uRZffe3OET2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhtech~telegram-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhtech-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/zhtech~telegram-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zhtech-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/zhtech~telegram-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zhtech-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": [
          "channels"
        ],
        "properties": {
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Public Telegram channels, one per line: a username (durov), @username, or a link (https://t.me/durov, https://t.me/s/durov, or any post link like https://t.me/durov/123). Private invite links (t.me/+...) and personal accounts cannot be read without a login and return an error row that is not charged.",
            "default": [
              "durov",
              "telegram"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerChannel": {
            "title": "Max posts per channel",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Newest posts first. The run stops for a channel when this many posts are saved, when the oldest date is reached, or when the channel history ends. Set 0 to save only the channel info rows.",
            "default": 20
          },
          "includeChannelInfo": {
            "title": "Add a channel info row",
            "type": "boolean",
            "description": "One extra row per channel with title, username, description, subscriber count, photo, verified flag and the photo, video, link and file counters.",
            "default": true
          },
          "exactSubscriberCount": {
            "title": "Exact subscriber count",
            "type": "boolean",
            "description": "Reads the exact number (for example 9921131 instead of 9.92M) from the channel's public t.me page, 1 extra page load per channel. Only used with the channel info row.",
            "default": true
          },
          "oldestDate": {
            "title": "Oldest post date",
            "type": "string",
            "description": "Stop when posts get older than this. YYYY-MM-DD (UTC), a full ISO timestamp, or a relative value such as 24 hours, 7 days, 2 weeks, 3 months. Leave empty for no date limit."
          },
          "newestDate": {
            "title": "Newest post date",
            "type": "string",
            "description": "Skip posts newer than this (they are not saved or charged). Same formats as above; a plain date includes the whole UTC day. Leave empty to start from the latest post."
          },
          "minPostId": {
            "title": "Only posts newer than post ID",
            "minimum": 0,
            "type": "integer",
            "description": "For scheduled monitoring: stop at this post ID, so only posts with a higher ID are saved. Use the latestPostId from your previous run's channel row. 0 means off.",
            "default": 0
          },
          "keywords": {
            "title": "Keywords (any match)",
            "type": "array",
            "description": "Save only posts that contain at least one of these words or phrases (case insensitive, matched in post text, link preview title and description, file names and poll question). Posts that do not match are skipped and not charged. Each saved post lists its matchedKeywords.",
            "items": {
              "type": "string"
            }
          },
          "useTelegramSearch": {
            "title": "Use Telegram channel search for keywords",
            "type": "boolean",
            "description": "Off: the actor reads the channel history page by page and keeps matching posts (exact, but slow for rare words in big channels). On: uses the search box of the channel preview (t.me/s/channel?q=keyword) to jump straight to matching posts, one search per keyword, then keeps only posts that really contain the keyword. Much faster for old or rare matches.",
            "default": false
          },
          "keywordMatch": {
            "title": "Keyword matching",
            "enum": [
              "contains",
              "wholeWord"
            ],
            "type": "string",
            "description": "Contains: the keyword can be part of a longer word (wallet also matches wallets). Whole word: only complete words or phrases (TON does not match button). Applies to keywords and exclude keywords.",
            "default": "contains"
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Skip posts that contain any of these words or phrases (case insensitive). Skipped posts are not charged.",
            "items": {
              "type": "string"
            }
          },
          "mediaTypes": {
            "title": "Only posts with media type",
            "type": "array",
            "description": "Keep only posts that contain at least one of the selected types. Leave empty for all posts.",
            "items": {
              "type": "string",
              "enum": [
                "photo",
                "video",
                "gif",
                "album",
                "document",
                "audio",
                "voice",
                "round_video",
                "sticker",
                "poll",
                "location",
                "any_media",
                "text_only"
              ],
              "enumTitles": [
                "Photo",
                "Video",
                "GIF",
                "Album (several photos or videos)",
                "Document or file",
                "Audio or music",
                "Voice message",
                "Round video message",
                "Sticker",
                "Poll",
                "Location",
                "Any media",
                "Text only (no media)"
              ]
            },
            "default": []
          },
          "includeForwarded": {
            "title": "Include forwarded posts",
            "type": "boolean",
            "description": "Turn off to keep only original posts of the channel.",
            "default": true
          },
          "maxPagesPerChannel": {
            "title": "Max pages to read per channel",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Safety limit for filtered runs. Each page holds about 20 posts. With strict filters (rare keywords, a narrow date window far in the past) the actor may read many pages to find matches; this caps the reading per channel and per keyword search.",
            "default": 50
          },
          "maxItems": {
            "title": "Max results (all channels)",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the whole run after this many saved rows (posts and channel rows). 0 means no limit. Your maximum cost per run (set in the run options) is respected as well.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Usually not needed: the t.me preview is public and the actor reads it slowly (about 1 page per second). Turn on Apify Proxy only if you see BLOCKED or RATE_LIMITED errors in big runs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}