{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Keyword Search & Channel Scraper",
    "description": "Search public Telegram posts by keyword or collect known channels from $1 per 1,000 saved posts, plus start and applicable discovery fees. Export text, dates, source links, views and media references to JSON, CSV or Excel. No Telegram login or API key required.",
    "version": "0.6",
    "x-build-id": "fendbNkhcyos6xw08"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/monkey.d.scraping~telegram-keyword-search-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-monkey.d.scraping-telegram-keyword-search-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-keyword-search-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-monkey.d.scraping-telegram-keyword-search-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-keyword-search-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-monkey.d.scraping-telegram-keyword-search-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": {
          "collectionMode": {
            "title": "Scraping mode",
            "enum": [
              "auto",
              "keyword",
              "channel",
              "hybrid"
            ],
            "type": "string",
            "description": "Keyword search finds indexed public posts. Channel scraping collects known channels. Both combines them. Automatic keeps existing API behavior and uses whichever sources you fill.",
            "default": "auto"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keyword search / Both: one word or phrase per line. By default matches post text or channel title. For text-only matches, change Where must the keyword appear? in Keyword search options. Duplicate terms are searched once. Ignored in Channel scraping.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Channel scraping / Both: one public username or URL per line, e.g. cointelegraph, @telegram or https://t.me/telegram. Ignored in Keyword search.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "maxResults": {
            "title": "Total post limit",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum unique posts across all keywords and channels. Start with 5 for a small test. This limits posts, not discovery fees; set Maximum cost per run too.",
            "default": 100
          },
          "afterDate": {
            "title": "Published on or after",
            "type": "string",
            "description": "Inclusive start in UTC. Use YYYY-MM-DD or 7 days. Invalid dates and reversed ranges stop the run before collection."
          },
          "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. Invalid dates stop the run."
          },
          "includeKeywords": {
            "title": "Must include",
            "type": "array",
            "description": "Keep a post when its public text or channel title contains at least one phrase.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "excludeKeywords": {
            "title": "Must not include",
            "type": "array",
            "description": "Discard a post when its public text or channel title contains any phrase.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "countryCode": {
            "title": "Country preference",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Optional country bias for discovery, e.g. US. Does not verify where a post or author is located."
          },
          "languageCode": {
            "title": "Language preference",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Optional search-language preference, e.g. en. Does not verify the language of each returned post."
          },
          "discoveryCoverage": {
            "title": "Search coverage",
            "enum": [
              "quick",
              "standard",
              "thorough"
            ],
            "type": "string",
            "description": "Quick explores less and usually costs less. Standard is the balanced default. Thorough searches more broadly and can cost more. None guarantees complete coverage.",
            "default": "standard"
          },
          "keywordMatchScope": {
            "title": "Where must the keyword appear?",
            "enum": [
              "textOrChannel",
              "postText"
            ],
            "type": "string",
            "description": "Keyword discovery only. Post text only rejects channel-title-only matches unless nearby context posts are enabled. Output shows the literal matches in each field. This is not semantic relevance; signatures in post text can match.",
            "default": "textOrChannel"
          },
          "maxResultsPerKeyword": {
            "title": "Maximum matching posts per keyword",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional limit per keyword. Total post limit at the top still applies; this does not cap discovery fees."
          },
          "includeContextPosts": {
            "title": "Include nearby posts without a keyword",
            "type": "boolean",
            "description": "Off by default. Enable only when you want nearby context too; these posts are labelled channel_context and count toward the total post limit.",
            "default": false
          },
          "sourcePriority": {
            "title": "Collect first when using both sources",
            "enum": [
              "channelsFirst",
              "keywordsFirst"
            ],
            "type": "string",
            "description": "Known channels first is the default. If they fill the total post limit, keyword discovery is skipped. Choose keyword discovery first when topic research matters more.",
            "default": "channelsFirst"
          },
          "maxResultsPerChannel": {
            "title": "Maximum posts per channel",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional fairness cap for each individual channel. Leave empty to use only the global cap."
          },
          "regexFilters": {
            "title": "Advanced regex patterns",
            "type": "array",
            "description": "Optional JavaScript-compatible regular expressions applied to public post text. Leave empty for normal use.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "downloadMedia": {
            "title": "Download available public media",
            "type": "boolean",
            "description": "Off by default to keep runs fast and inexpensive. When enabled, available public media may be saved in the run key-value store.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}