{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Monitor — Public Channel Posts Scraper",
    "description": "Scrape and monitor public Telegram channels with no login or API key. Get posts with text, views, reactions, media, links, forwards and replies. Filter by date or keyword, or schedule it with 'only new posts' for alerts and a webhook.",
    "version": "0.1",
    "x-build-id": "lCGRoWwVkPdfanv5R"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/latentlark~telegram-channel-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-latentlark-telegram-channel-monitor",
        "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/latentlark~telegram-channel-monitor/runs": {
      "post": {
        "operationId": "runs-sync-latentlark-telegram-channel-monitor",
        "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/latentlark~telegram-channel-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-latentlark-telegram-channel-monitor",
        "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. Use a username (durov), @username, or a link (https://t.me/durov, https://t.me/s/durov, https://t.me/durov/123). Private invite links (t.me/+...) are not supported.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "What to scrape",
            "enum": [
              "full",
              "lastNDays",
              "fromDate",
              "onlyNew"
            ],
            "type": "string",
            "description": "Full: newest posts back through history, up to the max. Last N days: posts from the last N days. Date range: posts between two dates. Only new posts: for scheduled monitoring. The first run saves a baseline and later runs return only posts published since the last run.",
            "default": "full"
          },
          "maxPostsPerChannel": {
            "title": "Max posts per channel",
            "minimum": 0,
            "type": "integer",
            "description": "Newest first. This caps cost on big channels. 0 = no limit, so the whole public history is scraped.",
            "default": 100
          },
          "lastNDays": {
            "title": "Last N days",
            "minimum": 1,
            "type": "integer",
            "description": "Used with mode 'Last N days'.",
            "default": 7
          },
          "fromDate": {
            "title": "From date",
            "type": "string",
            "description": "Used with mode 'Date range'. Pick a date (YYYY-MM-DD). Via the API you can also send a relative value like '30 days'."
          },
          "toDate": {
            "title": "To date",
            "type": "string",
            "description": "Optional end date for mode 'Date range'. Empty = up to now."
          },
          "monitorKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Only-new mode remembers the last seen post per channel under this name. Use different names for independent monitors.",
            "default": "default"
          },
          "firstRunMaxPosts": {
            "title": "First monitor run: posts per channel",
            "minimum": 1,
            "type": "integer",
            "description": "In only-new mode, the first run (no saved state) returns at most this many latest posts per channel as a baseline.",
            "default": 20
          },
          "includeKeywords": {
            "title": "Include keywords",
            "type": "array",
            "description": "Only keep posts that contain at least one of these words or phrases. Matching is case-insensitive and also checks link previews, polls and file names. In full and date modes, Telegram's channel search is used first, which is much faster on big channels.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop posts containing any of these words or phrases.",
            "items": {
              "type": "string"
            }
          },
          "messageTypes": {
            "title": "Message types",
            "type": "array",
            "description": "Only keep these kinds of posts. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "photo",
                "video",
                "album",
                "document",
                "audio",
                "voice",
                "round_video",
                "sticker",
                "gif",
                "poll",
                "location",
                "link",
                "unsupported"
              ],
              "enumTitles": [
                "Text only",
                "Photo",
                "Video",
                "Album (several media)",
                "File / document",
                "Audio / music",
                "Voice message",
                "Video message (round)",
                "Sticker",
                "GIF",
                "Poll",
                "Location",
                "Has link preview",
                "Media that only opens in the app"
              ]
            }
          },
          "minViews": {
            "title": "Min views",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep posts with at least this many views. 0 = no filter.",
            "default": 0
          },
          "includeServiceMessages": {
            "title": "Include service messages",
            "type": "boolean",
            "description": "System messages such as 'Channel photo updated'.",
            "default": false
          },
          "useTelegramSearch": {
            "title": "Use Telegram search for keywords",
            "type": "boolean",
            "description": "Use t.me's built-in channel search when include keywords are set (not in only-new mode). Turn it off to scan every post instead. That is slower, but it catches substring matches the search can miss.",
            "default": true
          },
          "includeChannelProfile": {
            "title": "Include channel profile",
            "type": "boolean",
            "description": "Add one profile row per channel with title, exact subscriber count, description, photo and verified flag. Works even for channels without a web preview.",
            "default": false
          },
          "includeTextHtml": {
            "title": "Include post HTML",
            "type": "boolean",
            "description": "Add the original formatted HTML of each post (bold, links and so on).",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. After the run, POST a JSON payload with the run summary and up to 100 new posts. Good for Slack, Zapier, Make or n8n."
          },
          "webhookOnlyWhenNew": {
            "title": "Webhook only when there are results",
            "type": "boolean",
            "description": "Skip the webhook when nothing new was found.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Channels in parallel",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many channels to scrape at the same time.",
            "default": 4
          },
          "requestDelaySecs": {
            "title": "Delay between pages (s)",
            "minimum": 0,
            "maximum": 10,
            "type": "number",
            "description": "A small pause between page requests for one channel. It keeps the scraper polite and unblocked.",
            "default": 0.5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Usually not needed: t.me works without a proxy. If Telegram throttles the run, it automatically switches to Apify datacenter 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}