{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Scraper | Export Message History to CSV",
    "description": "Export public Telegram channel history to CSV, Excel, JSON or Markdown. Filter messages by date or keyword, or export individual post URLs. Get text, views, reactions and source links. No Telegram login required.",
    "version": "0.4",
    "x-build-id": "2ydbbAYPP4o4vebyh"
  },
  "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 collection steps, spending budget and timeout set how far collection goes.",
            "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. Dates and ranges are validated before collection starts."
          },
          "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."
          },
          "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 collection steps, 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. Keep the checkpoint yourself and pass it to the next run."
          },
          "sortOrder": {
            "title": "Order of results",
            "enum": [
              "newestFirst",
              "oldestFirst"
            ],
            "type": "string",
            "description": "Orders the selected posts within each channel. With a post limit, the most recent matching posts are selected; Oldest first then lists them from oldest to newest.",
            "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. Saves 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 collection steps",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Shared scan limit for the whole run, across all channels. Default 100. Raise it for larger historical exports. Set separately from the post limit and spending budget.",
            "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 and counting every received byte. Streaming stops after the chunk that crosses this value, so the total can end slightly above it.",
            "default": 26214400
          },
          "exactSubscribers": {
            "title": "Fetch exact subscriber count",
            "type": "boolean",
            "description": "Optional exact public subscriber count per channel with matching posts. Uses one collection step per channel; keeps the displayed rounded 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}