{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Channel Scraper + AI Translate & Summarize",
    "description": "Export posts from any public Telegram channel: text, date, views, reactions, links, media, forwards. No login or bot token. Optional AI with your own API key (OpenAI, Claude, Gemini...): translate, summarize, entities, sentiment. Monitoring mode returns only new posts.",
    "version": "0.0",
    "x-build-id": "NIZbBN6h4jOJ4wSGt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kassieiii~telegram-channel-scraper-ai/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kassieiii-telegram-channel-scraper-ai",
        "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/kassieiii~telegram-channel-scraper-ai/runs": {
      "post": {
        "operationId": "runs-sync-kassieiii-telegram-channel-scraper-ai",
        "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/kassieiii~telegram-channel-scraper-ai/run-sync": {
      "post": {
        "operationId": "run-sync-kassieiii-telegram-channel-scraper-ai",
        "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": "Telegram channels",
            "type": "array",
            "description": "Public channel usernames or links. Accepts <code>durov</code>, <code>@durov</code>, <code>t.me/durov</code> or <code>https://t.me/s/durov</code>. Private channels and groups are not supported.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerChannel": {
            "title": "Max posts per channel",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Newest posts first. Scraping stops at this number (or earlier if you set a start date).",
            "default": 100
          },
          "dateFrom": {
            "title": "Only posts from (date)",
            "type": "string",
            "description": "Oldest post date to include, YYYY-MM-DD (UTC). Leave empty for no limit."
          },
          "dateTo": {
            "title": "Only posts until (date)",
            "type": "string",
            "description": "Newest post date to include, YYYY-MM-DD (UTC). Leave empty for up to now."
          },
          "keywords": {
            "title": "Keywords filter",
            "type": "array",
            "description": "Keep only posts containing at least one of these words (case-insensitive). Leave empty to keep all posts. You pay only for posts that are saved.",
            "items": {
              "type": "string"
            }
          },
          "includeMedia": {
            "title": "Include media info",
            "type": "boolean",
            "description": "Add photo/video/document info and preview URLs to each post.",
            "default": true
          },
          "onlyNewPosts": {
            "title": "Monitoring mode: only new posts since the last run",
            "type": "boolean",
            "description": "Remembers the newest post of each channel. Schedule this Actor (e.g. hourly or daily) and every run returns — and charges for — only posts published since the previous run.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Use a different name for each separate monitor (e.g. \"crypto-news\", \"competitors\"). Only letters, numbers and dashes.",
            "default": "telegram-channel-monitor"
          },
          "aiEnrichment": {
            "title": "AI: translate, summarize, extract entities & sentiment",
            "type": "boolean",
            "description": "For every post with text: detected language, full translation, one-sentence summary, up to 3 topics, people/organizations/locations and sentiment. Uses YOUR OWN AI API key below — you pay your AI provider directly for tokens (usually cents per 1,000 posts).",
            "default": false
          },
          "aiProvider": {
            "title": "AI provider",
            "enum": [
              "openai",
              "openrouter",
              "anthropic",
              "gemini",
              "deepseek",
              "groq",
              "custom"
            ],
            "type": "string",
            "description": "Any OpenAI-compatible API. Tip: a free Google AI Studio key works with \"Google Gemini\". Choose \"Custom\" for your own gateway, Together, Mistral, a local server, etc.",
            "default": "openai"
          },
          "aiApiKey": {
            "title": "Your AI API key",
            "type": "string",
            "description": "Stored encrypted by Apify, never logged or saved to results. Only used to call the provider you chose."
          },
          "aiModel": {
            "title": "Model",
            "type": "string",
            "description": "Model name at your provider. Leave empty for the default: OpenAI gpt-4o-mini, OpenRouter openai/gpt-4o-mini, Google Gemini gemini-3.5-flash-lite (works with a free AI Studio key), DeepSeek deepseek-chat. Required for Anthropic, Groq and Custom — use a fast, cheap model."
          },
          "aiBaseUrl": {
            "title": "Custom API base URL",
            "type": "string",
            "description": "Only for provider \"Custom\": the OpenAI-compatible base URL, e.g. https://api.together.xyz/v1"
          },
          "aiTargetLanguage": {
            "title": "AI output language",
            "enum": [
              "en",
              "ru",
              "uk",
              "kk",
              "uz",
              "es",
              "de",
              "fr",
              "pt",
              "it",
              "tr",
              "ar",
              "fa",
              "hi",
              "zh",
              "ja",
              "ko",
              "pl"
            ],
            "type": "string",
            "description": "Language for translations, summaries and topics.",
            "default": "en"
          },
          "maxPagesPerChannel": {
            "title": "Max pages per channel",
            "minimum": 1,
            "type": "integer",
            "description": "Safety limit. Each page holds about 20 posts. Increase it when a keyword filter skips many posts.",
            "default": 200
          },
          "requestDelayMs": {
            "title": "Delay between pages (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Polite pause between page requests. Lower is faster but more likely to be rate-limited.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy helps avoid rate limits on large runs.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}