{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Scraper — History & CSV Export",
    "description": "Scrape public Telegram channel posts and accessible history to CSV, Excel, JSON or Markdown. Filter by date or keyword; collect text, views, reactions and media URLs. No Telegram login. $0.20/1K posts plus the scheduled start fee; platform included.",
    "version": "0.3",
    "x-build-id": "LYS1Km5QHrx4sK38D"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/monkey.d.scraping~telegram-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-monkey.d.scraping-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/monkey.d.scraping~telegram-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-monkey.d.scraping-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/monkey.d.scraping~telegram-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-monkey.d.scraping-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 to scrape",
            "type": "array",
            "description": "Add one channel per line: cointelegraph, @cointelegraph or https://t.me/cointelegraph. For exact post URLs only, clear this field and use Single post URLs below.",
            "items": {
              "type": "string"
            }
          },
          "maxMessagesPerChannel": {
            "title": "Maximum posts per channel",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Start with 10 for a small test. Clear this limit to request accessible history; also clear the total limit and date/ID filters. Maximum page requests, spending budget and timeout can still stop collection.",
            "default": 100
          },
          "outputPreset": {
            "title": "Export layout",
            "enum": [
              "full",
              "compact",
              "llm"
            ],
            "type": "string",
            "description": "Pick the shape that matches where the data is going next.",
            "default": "full"
          },
          "afterDate": {
            "title": "Published on or after",
            "type": "string",
            "description": "Inclusive start in UTC. Use YYYY-MM-DD or 7 days. Invalid dates and reversed ranges stop the run before collection."
          },
          "beforeDate": {
            "title": "Published on or before",
            "type": "string",
            "description": "Inclusive end in UTC: YYYY-MM-DD includes the entire day through 23:59:59.999. A timestamp with timezone keeps its exact time. Invalid dates stop the run."
          },
          "includeKeywords": {
            "title": "Must contain",
            "type": "array",
            "description": "Keep posts when the text, channel title or poll question contains at least one phrase.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Must not contain",
            "type": "array",
            "description": "Discard posts when the text, channel title or poll question contains any phrase.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Single post URLs",
            "type": "array",
            "description": "Export only these exact posts, e.g. `https://t.me/durov/342`. Useful for enriching a list of links you already have. Works on its own or alongside the channels above. *(Optional)*",
            "items": {
              "type": "string"
            }
          },
          "maxMessages": {
            "title": "Total post limit across channels",
            "minimum": 1,
            "maximum": 5000000,
            "type": "integer",
            "description": "Optional maximum for the whole run, alongside the per-channel limit. For accessible history, clear both post limits and set an appropriate Maximum page requests, spending budget and timeout."
          },
          "fromMessageId": {
            "title": "Only posts newer than this message ID",
            "minimum": 1,
            "type": "integer",
            "description": "Exclusive lower bound. Use one channel and its last fully collected checkpoint. This Actor does not save or update your checkpoint automatically."
          },
          "sortOrder": {
            "title": "Order of results",
            "enum": [
              "newestFirst",
              "oldestFirst"
            ],
            "type": "string",
            "description": "Orders the selected posts within each channel. A limited run still selects recent matching posts; Oldest first does not select the channel’s oldest posts.",
            "default": "newestFirst"
          },
          "regexFilters": {
            "title": "Regular expressions",
            "type": "array",
            "description": "Keep a message only when its text matches at least one JavaScript-compatible pattern. *(Optional)*",
            "items": {
              "type": "string"
            }
          },
          "includeChannelInfo": {
            "title": "Include channel details",
            "type": "boolean",
            "description": "Include available channel metadata such as subscriber count, description and verification. No additional result charge.",
            "default": true
          },
          "downloadMedia": {
            "title": "Download media files",
            "type": "boolean",
            "description": "Off by default. Attempt to save available public media files in the run’s key-value store. Source URLs remain available when exposed; downloading can take longer.",
            "default": false
          },
          "maxRequests": {
            "title": "Maximum page requests",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Shared cap across all channels, date probes and retries. Default 100. Stops with partial coverage even when no post matches. Raise deliberately for larger historical exports. This is separate from the post limit and spending limit.",
            "default": 100
          },
          "maxMediaFileBytes": {
            "title": "Maximum bytes per media file",
            "minimum": 1,
            "maximum": 20971520,
            "type": "integer",
            "description": "Default 10 MiB. Oversized files are skipped and keep their source URL. Active only when Download media files is enabled.",
            "default": 10485760
          },
          "maxMediaTotalBytes": {
            "title": "Maximum media bytes per run",
            "minimum": 1,
            "maximum": 104857600,
            "type": "integer",
            "description": "Default 25 MiB, shared across files including bytes from failed downloads. Streaming stops after the chunk that crosses the limit; a final chunk can exceed it.",
            "default": 26214400
          },
          "exactSubscribers": {
            "title": "Fetch exact subscriber count",
            "type": "boolean",
            "description": "Optional extra public profile request per channel with matching posts. Uses Maximum page requests; falls back to the preview count when unavailable. No additional event fee. Keep Include channel details enabled.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}