{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Scraper",
    "description": "Scrape public Telegram channels into structured posts, views, reactions, media, polls, forwards, discussion comments, capped participant samples, channel analytics, and discovery. Use no-login widget mode or publisher-pool MTProto. Run snapshots or monitor new posts with change events.",
    "version": "0.3",
    "x-build-id": "0e4VDeAOPkOCoREOu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/viremo-labs~telegram-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-viremo-labs-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/viremo-labs~telegram-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-viremo-labs-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/viremo-labs~telegram-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-viremo-labs-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "snapshot",
              "monitor"
            ],
            "type": "string",
            "description": "snapshot scrapes current state; monitor diffs against the stored baseline.",
            "default": "snapshot"
          },
          "authMode": {
            "title": "Auth mode",
            "enum": [
              "widget",
              "mtproto"
            ],
            "type": "string",
            "description": "widget needs no login; mtproto uses the publisher account pool for deeper history and optional API-only fields.",
            "default": "widget"
          },
          "channels": {
            "title": "Channels",
            "maxItems": 30,
            "type": "array",
            "description": "Usernames, @usernames or t.me links.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "channelObjects": {
            "title": "Channel objects",
            "maxItems": 30,
            "type": "array",
            "description": "Channels with stable query ids.",
            "items": {
              "type": "object",
              "properties": {
                "queryId": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9-_]{0,63}$",
                  "description": "Stable query id for monitor correlation (auto-generated if omitted).",
                  "title": "Query Id"
                },
                "username": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "Channel username, @username or t.me link.",
                  "title": "Username"
                }
              },
              "required": [
                "username"
              ],
              "additionalProperties": true
            }
          },
          "postUrls": {
            "title": "Post URLs",
            "maxItems": 50,
            "type": "array",
            "description": "Individual public post URLs to fetch exactly.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "default": []
          },
          "discover": {
            "title": "Discover topics",
            "maxItems": 10,
            "type": "array",
            "description": "Global public channel discovery by topic (MTProto only).",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            },
            "default": []
          },
          "maxPosts": {
            "title": "Max messages per channel",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "History paging stops at the cap.",
            "default": 50
          },
          "includeText": {
            "title": "Extract text",
            "type": "boolean",
            "description": "Extract message text (otherwise only metadata).",
            "default": true
          },
          "searchKeywords": {
            "title": "Search keywords",
            "maxItems": 20,
            "type": "array",
            "description": "Keep only messages whose text or hashtags contain a keyword.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "default": []
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Keep only messages with at least this many views."
          },
          "mediaOnly": {
            "title": "Media only",
            "type": "boolean",
            "description": "Keep only posts carrying media.",
            "default": false
          },
          "textOnly": {
            "title": "Text only",
            "type": "boolean",
            "description": "Keep only posts without downloadable media.",
            "default": false
          },
          "includePosts": {
            "title": "Fetch posts",
            "type": "boolean",
            "description": "Fetch message history (off = channel profile row only).",
            "default": true
          },
          "includeTextHtml": {
            "title": "Raw message HTML",
            "type": "boolean",
            "description": "Include the raw message HTML (formatting preserved).",
            "default": false
          },
          "includeComments": {
            "title": "Fetch comments",
            "type": "boolean",
            "description": "Fetch discussion comments per post (MTProto mode only).",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Comment cap per post (MTProto mode only).",
            "default": 20
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Keep only posts with at least this many discussion replies."
          },
          "minId": {
            "title": "Minimum message id",
            "minimum": 1,
            "maximum": 2000000000,
            "type": "integer",
            "description": "Keep only messages with id >= minId."
          },
          "maxId": {
            "title": "Maximum message id",
            "minimum": 1,
            "maximum": 2000000000,
            "type": "integer",
            "description": "Keep only messages with id <= maxId."
          },
          "resolveDiscussion": {
            "title": "Resolve discussion group",
            "type": "boolean",
            "description": "Discover the linked discussion group and its member counts.",
            "default": false
          },
          "messagePreview": {
            "title": "Message preview",
            "type": "boolean",
            "description": "Add a one-line LLM-ready preview per message.",
            "default": false
          },
          "includeSimilar": {
            "title": "Similar channels",
            "type": "boolean",
            "description": "Add Telegram's similar-channel picks (MTProto only).",
            "default": false
          },
          "includeMembers": {
            "title": "Export members",
            "type": "boolean",
            "description": "Export discussion-group members (MTProto only).",
            "default": false
          },
          "maxMembers": {
            "title": "Max members",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Member cap per channel (MTProto only).",
            "default": 100
          },
          "includeServiceEvents": {
            "title": "Service events",
            "type": "boolean",
            "description": "Include pins, title changes and joins (MTProto only).",
            "default": false
          },
          "fromUser": {
            "title": "From sender",
            "minLength": 2,
            "maxLength": 64,
            "type": "string",
            "description": "Keep only posts from this sender @username or id (MTProto only)."
          },
          "includeStories": {
            "title": "Channel stories",
            "type": "boolean",
            "description": "Fetch active channel stories (MTProto only).",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "How many pages may be fetched at once. Keep at 1 to stay polite.",
            "default": 1
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (secs)",
            "minimum": 10,
            "maximum": 60,
            "type": "integer",
            "description": "Request Timeout Secs.",
            "default": 20
          },
          "requestDelayMillis": {
            "title": "Delay between requests (ms)",
            "minimum": 1000,
            "maximum": 10000,
            "type": "integer",
            "description": "Minimum 1000 ms.",
            "default": 2000
          },
          "maxBytesPerPage": {
            "title": "Max bytes per page",
            "minimum": 50000,
            "maximum": 5000000,
            "type": "integer",
            "description": "Max Bytes Per Page.",
            "default": 2000000
          },
          "sinceDate": {
            "title": "Since date",
            "minLength": 1,
            "maxLength": 20,
            "type": "string",
            "description": "Keep messages posted on/after this date (YYYY-MM-DD or a relative lookback such as \"7 days\"). Older history stops."
          },
          "untilDate": {
            "title": "Until date",
            "minLength": 1,
            "maxLength": 20,
            "type": "string",
            "description": "Keep messages posted on/before this date (YYYY-MM-DD or a relative lookback such as \"7 days\")."
          },
          "baselineKey": {
            "title": "Baseline key",
            "pattern": "^[a-z0-9][a-z0-9-_]{0,63}$",
            "type": "string",
            "description": "Monitor baseline slot in the monitor key-value store.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}