{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Scraper: Channels, Messages, Comments & Profiles",
    "description": "Telegram scraper for public channels and profiles: export messages, comments, views, reactions, media URLs, links and exact subscriber counts. Filter by keyword, date or media type. No API key or login. $1 or less per 1,000 messages.",
    "version": "0.1",
    "x-build-id": "jCFXTp3tbHJQV50ie"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~telegram-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-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/automation-lab~telegram-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-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/automation-lab~telegram-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-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": [
          "channels"
        ],
        "properties": {
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Public Telegram channels to scrape: a username such as \"durov\", \"@durov\", or a URL such as \"https://t.me/durov\". For profile lookups, bots, users and groups also work.",
            "items": {
              "type": "string"
            }
          },
          "maxMessages": {
            "title": "Max messages per channel",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of messages to return per channel, newest first. The Actor pages through history automatically.",
            "default": 100
          },
          "oldestMessageDate": {
            "title": "Oldest message date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional UTC date in YYYY-MM-DD format. Only messages on or after this date are returned, and paging stops once older messages are reached. Has no effect in profile-only mode."
          },
          "newestMessageDate": {
            "title": "Newest message date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional UTC date in YYYY-MM-DD format. Only messages on or before this date are returned. Newer messages are scanned but not charged."
          },
          "lastNDays": {
            "title": "Last N days",
            "minimum": 1,
            "type": "integer",
            "description": "Optional shortcut: only messages from the last N days. If you also set an oldest date, the later of the two applies."
          },
          "afterMessageId": {
            "title": "Only messages after ID",
            "minimum": 0,
            "type": "integer",
            "description": "Optional exclusive cursor for incremental monitoring. Only messages with messageId greater than this value are returned, and pagination stops when the cursor is reached. Combine it with maxMessages and oldestMessageDate; it has no effect in profile-only mode."
          },
          "afterMessageIds": {
            "title": "Only messages after ID, per channel",
            "type": "object",
            "description": "Optional per-channel cursor for monitoring several channels, for example {\"durov\": 455, \"telegram\": 460}. Message IDs differ per channel, so use this rather than one shared ID when you monitor more than one. A channel listed here ignores the single ID above."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Optional. Keep only messages whose text contains any of these words or phrases (case-insensitive). Filtered messages are not charged. A run reads about 80 history pages (about 1,600 messages) plus 8 more per row returned, so a rare keyword may stop early; the run status says so.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Optional. Skip messages whose text contains any of these words or phrases (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "mediaTypes": {
            "title": "Media types",
            "type": "array",
            "description": "Optional. Keep only messages of these types: text, photo, video, document, poll, sticker, voice, location.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "photo",
                "video",
                "document",
                "poll",
                "sticker",
                "voice",
                "location"
              ],
              "enumTitles": [
                "Text only",
                "Photo",
                "Video",
                "Document or file",
                "Poll",
                "Sticker",
                "Voice message",
                "Location"
              ]
            }
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also return public comments under each message, as separate rows with rowType \"comment\". Each comment is charged as one message and does not count toward Max messages. Adds one request per message, so runs take longer.",
            "default": false
          },
          "maxCommentsPerMessage": {
            "title": "Max comments per message",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of comments to return for each message when comments are on.",
            "default": 20
          },
          "includeChannelInfo": {
            "title": "Include channel info",
            "type": "boolean",
            "description": "Add a separate dataset row with channel profile data (title, description, exact subscriber count, avatar, verified status, etc.).",
            "default": true
          },
          "profileOnly": {
            "title": "Profile only",
            "type": "boolean",
            "description": "Return only profile data and skip messages. Works for channels, groups, bots and users.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}