{
  "openapi": "3.0.1",
  "info": {
    "title": "Telegram Keyword Search & Channel Scraper",
    "description": "Search public Telegram posts by keyword, collect public channel posts, and export verified structured data without Telegram credentials.",
    "version": "0.1",
    "x-build-id": "MOgztYCNS2CFBwXmX"
  },
  "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": "Collection plan",
            "enum": [
              "auto",
              "keyword",
              "channel",
              "hybrid"
            ],
            "type": "string",
            "description": "Automatic uses whichever source fields you fill in. Select a focused plan when you want the Actor to ignore the other source type.",
            "default": "auto"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases used to discover publicly indexed Telegram posts. Each returned discovery result must contain the literal keyword.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "channels": {
            "title": "Public channels",
            "type": "array",
            "description": "Public Telegram usernames, @usernames, or public channel URLs. Private, invite-only, login-protected, and deleted content is out of scope.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "afterDate": {
            "title": "Published on or after",
            "type": "string",
            "description": "Inclusive lower date bound. Choose a date or use a relative value such as 7 days. Leave empty for no lower bound."
          },
          "beforeDate": {
            "title": "Published on or before",
            "type": "string",
            "description": "Inclusive upper date bound. Choose a date or use a relative value such as 30 days. Leave empty for no upper bound."
          },
          "countryCode": {
            "title": "Country preference for discovery",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Optional preference for keyword discovery, not a strict post-location filter. Select a common country code or type any ISO 3166-1 alpha-2 code."
          },
          "languageCode": {
            "title": "Language preference for discovery",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Optional preference for keyword discovery, not an automatic language classification. Select a common language code or type any ISO 639-1 code."
          },
          "sourcePriority": {
            "title": "Priority when both sources are used",
            "enum": [
              "channelsFirst",
              "keywordsFirst"
            ],
            "type": "string",
            "description": "Only matters in a combined run when the global cap is reached. Choose which source gets capacity first.",
            "default": "channelsFirst"
          },
          "maxResults": {
            "title": "Maximum unique posts in this run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Global cap across every keyword and channel. The source-priority setting decides which source is processed first when both are used.",
            "default": 100
          },
          "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 maximum above."
          },
          "includeKeywords": {
            "title": "Post text or channel title must include",
            "type": "array",
            "description": "Keep a post only when its public text or public channel title contains at least one of these phrases.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "excludeKeywords": {
            "title": "Post text or channel title must not include",
            "type": "array",
            "description": "Discard a post when its public text or public channel title contains any of these phrases.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "regexFilters": {
            "title": "Advanced: regular-expression text patterns",
            "type": "array",
            "description": "Optional advanced filter. Keep a post only when its public text matches at least one JavaScript-compatible regular expression. Leave empty for normal use.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "downloadMedia": {
            "title": "Download available public media",
            "type": "boolean",
            "description": "Disabled by default. When enabled, available public media may also be saved in this run's key-value store; source references remain in the dataset.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}