{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Messages Scraper",
    "description": "Export public Telegram channel posts to CSV or JSON — text, views, reactions, media links and dates. From $0.99 per 1,000 messages. No account, no API key and no phone number. Search by keyword, collect only new posts, monitor news and crypto channels, track brand mentions or archive a channel.",
    "version": "0.1",
    "x-build-id": "HesezfJzgwsJ1S6B7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lightmoon~telegram-messages-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lightmoon-telegram-messages-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/lightmoon~telegram-messages-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lightmoon-telegram-messages-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/lightmoon~telegram-messages-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lightmoon-telegram-messages-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": "One per line, in any form: `durov`, `@durov`, `t.me/durov`, `https://t.me/s/durov`, or a link to a single post. Groups and private invite links (t.me/+...) are not public channels and cannot be read.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Only posts containing",
            "type": "string",
            "description": "A word or phrase. **Telegram runs this search itself**, so only matching posts are fetched and only matching posts are billed — a brand mention in a 50 000-post channel costs a few requests, not two and a half thousand. Results are paged, so a common word returns all of its matches and not just the first twenty. Leave empty to read the channel in order."
          },
          "maxPosts": {
            "title": "Maximum posts in total",
            "minimum": 0,
            "type": "integer",
            "description": "Across all channels. 0 means no limit. Free-plan runs are capped by your own Apify usage, so start small.",
            "default": 200
          },
          "maxPostsPerChannel": {
            "title": "Maximum per channel",
            "minimum": 0,
            "type": "integer",
            "description": "How deep to read one channel before moving to the next. 0 means no limit. Telegram serves about twenty message IDs per request, and an album counts as several IDs but one post — so a channel that posts photo albums needs more requests per post than one that posts text.",
            "default": 1000
          },
          "oldestPostDate": {
            "title": "Stop at posts older than",
            "type": "string",
            "description": "`2026-08-01`, or a full timestamp. Reading stops as soon as a post older than this appears, so a narrow window costs a few requests rather than the whole archive."
          },
          "newestPostDate": {
            "title": "Skip posts newer than",
            "type": "string",
            "description": "`2026-08-15`, or a full timestamp. Use with the field above to take one week out of the middle of an archive."
          },
          "onlyNewSinceLastRun": {
            "title": "Only posts published since the last run",
            "type": "boolean",
            "description": "Remembers the last post ID it read for each channel and starts from there next time, so a scheduled run collects — and bills — only what is genuinely new. It reads forwards from where it stopped, so nothing is skipped even when a channel posts hundreds of times between runs. The first run has nothing to resume from and reads normally.",
            "default": false
          },
          "afterPostId": {
            "title": "Start after this post ID",
            "minimum": 0,
            "type": "integer",
            "description": "The number at the end of a post link — `t.me/durov/523` is 523. Reads everything published after it, oldest first. Applies to a single channel; with several channels use the switch above, which keeps a separate resume point for each."
          },
          "onlyWithMedia": {
            "title": "Only posts with photos, video or files",
            "type": "boolean",
            "description": "Filters run before anything is stored or billed, so a filtered-out post costs you nothing.",
            "default": false
          },
          "onlyWithLinks": {
            "title": "Only posts that link somewhere",
            "type": "boolean",
            "description": "Counts both links inside the text and a shared article's link preview.",
            "default": false
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Telegram rounds large view counts to `12.5M`, so this compares against that rounded number. A post with no view count at all is dropped by this filter and reported separately, because it cannot be shown to clear the bar."
          },
          "includeChannelDetails": {
            "title": "Add the exact subscriber count",
            "type": "boolean",
            "description": "The channel's name, description, verified badge, avatar and its counts of photos, videos and links are on **every row already**, at no extra cost. Switch this on and the actor also reads the channel's profile page — one extra 11 KB request per channel, never billed — for the subscriber count as an exact number, `11 170 139`, instead of the `11.2M` Telegram rounds it to.",
            "default": false
          },
          "includeTextHtml": {
            "title": "Add the formatted text",
            "type": "boolean",
            "description": "The post's HTML, with bold, italics and links intact. Roughly doubles the size of a row, so it is off unless you need the formatting.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}