{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Messages Scraper",
    "description": "Get public Telegram channel messages with text, dates, views, reactions, links, media, and channel details. Filter by date, keyword, or views, add post comments, or monitor channels for new posts. No Telegram login needed.",
    "version": "1.0",
    "x-build-id": "qTudmCRC1JiYGfx9e"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maximedupre~telegram-channel-messages-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maximedupre-telegram-channel-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/maximedupre~telegram-channel-messages-scraper/runs": {
      "post": {
        "operationId": "runs-sync-maximedupre-telegram-channel-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/maximedupre~telegram-channel-messages-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-maximedupre-telegram-channel-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": [
          "targets"
        ],
        "properties": {
          "targets": {
            "title": "Telegram channels",
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "description": "Paste one public Telegram channel target per row. Works with channel URLs, t.me/s archive URLs, @handles, bare handles, and direct public post URLs.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "maxMessages": {
            "title": "Messages to save",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of Telegram message rows to save across the run. Leave it empty or set 0 to save all available messages."
          },
          "sortOrder": {
            "title": "Save order",
            "enum": [
              "newest_first",
              "oldest_first"
            ],
            "type": "string",
            "description": "Save rows newest first or oldest first after the requested messages are collected.",
            "default": "newest_first"
          },
          "dateFrom": {
            "title": "Start date",
            "type": "string",
            "description": "Optional. Saves only messages published on or after this date. Dates use UTC."
          },
          "dateTo": {
            "title": "End date",
            "type": "string",
            "description": "Optional. Saves only messages published before the start of this date. Dates use UTC."
          },
          "afterMessageNumber": {
            "title": "After message number",
            "minimum": 1,
            "type": "integer",
            "description": "Optional. Saves only messages with a message number higher than this one. The message number is the last part of a post link, such as 540 in https://t.me/durov/540."
          },
          "beforeMessageNumber": {
            "title": "Before message number",
            "minimum": 1,
            "type": "integer",
            "description": "Optional. Saves only messages with a message number lower than this one."
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Optional. Saves only the channel messages that Telegram's channel search finds for this keyword."
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Saves only messages with at least this many views."
          },
          "onlyWithMedia": {
            "title": "Only messages with media",
            "type": "boolean",
            "description": "Saves only messages that have a photo, video, file, or other media.",
            "default": false
          },
          "onlyWithLinks": {
            "title": "Only messages with links",
            "type": "boolean",
            "description": "Saves only messages that contain at least one link.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "pattern": "^[a-zA-Z0-9_-]{1,63}$",
            "type": "string",
            "description": "Optional. Give this run a monitor name to check channels over time. Each later run with the same monitor name saves only messages published since the last run of that monitor. Use letters, numbers, dashes, and underscores."
          },
          "includeComments": {
            "title": "Include post comments",
            "type": "boolean",
            "description": "Save the public comments under each channel post, with each comment author's public name and username. Each saved comment is charged.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Saves up to this many comments for each post, where available. Set 0 to save all comments. Used only when Include post comments is on.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}