{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Keyword Search Scraper - Messages by Keyword",
    "description": "Search public Telegram channels by keyword. Get every matching message with views, reactions, media and channel stats. Export CSV, Excel, JSON or XML.",
    "version": "0.1",
    "x-build-id": "VDe570fA7LBmSgGh1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parseforge~telegram-keyword-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parseforge-telegram-keyword-search-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/parseforge~telegram-keyword-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parseforge-telegram-keyword-search-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/parseforge~telegram-keyword-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parseforge-telegram-keyword-search-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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words, phrases or #hashtags to search for. Each keyword is searched separately. Every returned message contains the keyword.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
          },
          "discoverChannels": {
            "title": "Discover channels automatically",
            "type": "boolean",
            "description": "Find public Telegram channels that mention each keyword (through a web search restricted to t.me) and search inside each of them.",
            "default": true
          },
          "channels": {
            "title": "Channels to search",
            "type": "array",
            "description": "Public channel usernames or links to search inside, for example `cointelegraph`, `@durov` or `https://t.me/s/telegram`. Searched for every keyword, on top of the discovered channels.",
            "items": {
              "type": "string"
            }
          },
          "maxChannelsPerKeyword": {
            "title": "Max discovered channels per keyword",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many discovered channels to search for each keyword. Discovery usually finds 20 to 30 relevant channels per keyword.",
            "default": 20
          },
          "discoveryLanguage": {
            "title": "Discovery language",
            "enum": [
              "en",
              "es",
              "pt",
              "fr",
              "de",
              "it",
              "nl",
              "pl",
              "uk",
              "ru",
              "tr",
              "ar",
              "fa",
              "he",
              "hi",
              "bn",
              "ur",
              "id",
              "ms",
              "vi",
              "th",
              "zh-CN",
              "zh-TW",
              "ja",
              "ko",
              "uz",
              "kk",
              "az",
              "ro",
              "cs",
              "hu",
              "el",
              "sv",
              "fi",
              "da",
              "no",
              "am",
              "sw"
            ],
            "type": "string",
            "description": "Language used to discover channels. It biases which channels are found; it does not translate messages.",
            "default": "en"
          },
          "discoveryCountry": {
            "title": "Discovery country",
            "enum": [
              "us",
              "gb",
              "ca",
              "au",
              "in",
              "ng",
              "za",
              "ph",
              "sg",
              "es",
              "mx",
              "ar",
              "co",
              "cl",
              "pe",
              "br",
              "pt",
              "fr",
              "be",
              "ch",
              "de",
              "at",
              "it",
              "nl",
              "pl",
              "ua",
              "ru",
              "by",
              "kz",
              "uz",
              "tr",
              "il",
              "ae",
              "sa",
              "eg",
              "ir",
              "pk",
              "bd",
              "id",
              "my",
              "vn",
              "th",
              "cn",
              "hk",
              "tw",
              "jp",
              "kr",
              "ro",
              "cz",
              "hu",
              "gr",
              "se",
              "fi",
              "dk",
              "no",
              "et",
              "ke"
            ],
            "type": "string",
            "description": "Country used to discover channels. It biases which channels are found; it does not filter channels by location.",
            "default": "us"
          },
          "discoveryTimeRange": {
            "title": "Discovery time range",
            "enum": [
              "any",
              "d",
              "w",
              "m",
              "y"
            ],
            "type": "string",
            "description": "Only discover channels whose pages were indexed with activity in this period. Use it to favour channels that are active right now.",
            "default": "any"
          },
          "searchDepth": {
            "title": "Search depth",
            "enum": [
              "fast",
              "deep"
            ],
            "type": "string",
            "description": "Fast uses Telegram's built-in search only (newest 22 matches per channel and keyword). Deep also scans each channel's history and returns older matches, up to the scan limit below.",
            "default": "fast"
          },
          "maxResultsPerChannel": {
            "title": "Max results per channel",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum matching messages returned from one channel for one keyword.",
            "default": 100
          },
          "maxMessagesScannedPerChannel": {
            "title": "Max messages scanned per channel (deep search)",
            "minimum": 20,
            "maximum": 200000,
            "type": "integer",
            "description": "How far back deep search reads each channel's history, in messages. 1,000 messages is about 50 page loads per channel.",
            "default": 1000
          },
          "afterDate": {
            "title": "Published after",
            "type": "string",
            "description": "Only messages published on or after this date. Pick a date or type a relative value such as `7 days`, `2 weeks`, `3 months` or `1 year`."
          },
          "beforeDate": {
            "title": "Published before",
            "type": "string",
            "description": "Only messages published before this date."
          },
          "strictMatch": {
            "title": "Exact words only",
            "type": "boolean",
            "description": "Telegram's search also matches word forms (staking finds stake and unstaked) and link text. Switch this on to keep only messages whose visible text contains every word of the keyword. Wrap a keyword in quotes to require the exact phrase.",
            "default": false
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Only messages with at least this many views."
          },
          "onlyWithMedia": {
            "title": "Only messages with media",
            "type": "boolean",
            "description": "Only messages that carry a photo, video, document or voice note.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy used to load Telegram pages. Channel discovery always uses Apify's Google SERP proxy.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}