{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Scraper — Posts & Stats",
    "description": "Scrape any public Telegram channel as data. One row per post: text, date, views, photos, videos, links, link preview, author signature, edited flag, poll. Plus a channel row with subscribers, description and media counts. No login, no API key, no bot token.",
    "version": "0.1",
    "x-build-id": "fVENE4bTzHJPq9vfP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/insight.solutions~telegram-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-insight.solutions-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/insight.solutions~telegram-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-insight.solutions-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/insight.solutions~telegram-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-insight.solutions-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": {
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "One entry per public channel. Every spelling works and they all reach the same channel: the bare username (`durov`), the `@name` (`@durov`), a link (`https://t.me/durov`), a preview link (`https://t.me/s/durov`), or a link to one of its posts (`https://t.me/durov/527` — the post number is ignored here). Duplicates across those spellings are read, and billed, **once**. Private invite links (`t.me/+AbCdEf`) and internal links (`t.me/c/…`) cannot be read at all and get a free diagnostic row saying so.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerChannel": {
            "title": "Posts per channel",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "How many posts to return for each channel, **newest first**. Telegram serves 20 posts per request, so 100 posts is 5 requests and 1,000 is 50. Set **0 for as deep as the preview will go** — that is `maxPagesPerChannel` × 20 posts, 1,000 by default. There is no way to reach the very first post of a large channel: Telegram's public preview stops serving older pages long before that.",
            "default": 100
          },
          "since": {
            "title": "Only posts since (ISO date)",
            "type": "string",
            "description": "Stop as soon as a post older than this is reached — `2026-08-01`, or a full timestamp like `2026-08-01T12:00:00Z`. Because posts come back newest first, this is a **stop**, not a filter: a cutoff of yesterday costs one request per channel however large the channel is. That makes it the right setting for a scheduled run that only wants what is new. Leave empty for no cutoff."
          },
          "includeChannelInfo": {
            "title": "Include a channel row",
            "type": "boolean",
            "description": "Write one `channel` row per channel before its posts: title, `@username`, description, subscriber count, verified flag, avatar URL, and Telegram's own counts of the photos, videos, links and files the channel has posted. It is free to fetch — the information is in the header of the page the posts come from — but it is a separately priced row, so it can be turned off for a run that only wants posts.",
            "default": true
          },
          "postUrls": {
            "title": "Single post URLs",
            "type": "array",
            "description": "Links to individual posts — `https://t.me/durov/300` — read one at a time through Telegram's embed widget. Use this for posts that have scrolled out of a channel's recent history, or when you have a list of specific posts and do not want the channel around them. One row each, and no `channel` row. A post listed here is fetched even if the same post also arrives from its channel's feed.",
            "items": {
              "type": "string"
            }
          },
          "includeHtml": {
            "title": "Keep the HTML of post text",
            "type": "boolean",
            "description": "Add a `textHtml` column holding the post exactly as Telegram marked it up — `<b>`, `<i>`, `<a href>`, `<code>`, custom emoji tags and all. The plain-text `text` column is always there; this is for when you want the formatting or the anchor markup. It makes rows several times larger and it is off by default.",
            "default": false
          },
          "maxPagesPerChannel": {
            "title": "Maximum pages per channel",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "A hard ceiling on requests per channel, whatever `maxPostsPerChannel` says. Each page is 20 posts and roughly 140 KB, so the default of 50 is 1,000 posts and about 7 MB per channel. This is the safety rail for `maxPostsPerChannel: 0`, and the number to raise when you genuinely want to walk a channel's whole readable history.",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Channels in parallel",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many channels are read at once. Each parallel worker keeps its own proxy session, so one rate-limited channel burns only its own exit IP. Pages within one channel are always sequential and spaced 300–700 ms apart, because that is what paging politely looks like.",
            "default": 4
          },
          "maxRunSecs": {
            "title": "Maximum run time (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Wall-clock budget for the whole run. When it is reached the Actor stops fetching, keeps and bills for every row it already wrote, and files a free diagnostic row for each channel it never reached or could not finish. A channel stopped part-way keeps its posts. Nothing is charged for work that did not happen.",
            "default": 240
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Telegram's public preview answers datacenter addresses, so the default is Apify's datacenter proxy — much cheaper than residential, and the proxy cost is already inside the per-row price. Switch to residential if you are reading many channels on a schedule and start seeing `blocked` rows: Telegram rate-limits by address, and sessions rotate automatically when an exit IP is refused.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}