A high-performance REST API for searching Telegram Bot API documentation with lightning-fast response times.
This service parses official Telegram documentation and provides an efficient search interface with advanced query capabilities.
- Ultra-fast search with in-memory caching and optimized algorithms
- Multiple data sources: Bot API, WebApps, Features, FAQ, Tutorials
- Advanced search syntax with special operators
- Unique ID system for entities and fields
- Multiple output formats: JSON, HTML, Markdown
- Manual documentation refresh
- Memory + database caching with configurable TTL
GET /api/search– Search documentationGET /api/lookup/id/{entity_id}– Lookup entity by IDGET /api/lookup/field/{field_id}– Lookup field by IDGET /api/entity/{entity_name}– Get entity by name
POST /api/update– Force documentation refreshGET /api/stats– System statisticsPOST /api/cache/clear– Clear memory cacheGET /health– Health check
!method sendMessage
!object User.message_id
.chat_idsend*
get_*
chat_*!method .*photo
!object .from- Python 3.10+
- pip
git clone https://github.com/Soumyadeep765/docs-bot.git
cd docs-bot
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python main.pycurl "http://localhost:5000/api/search?q=sendMessage"curl "http://localhost:5000/api/search?q=!method%20sendMessage&advanced=true"{
"query": "sendMessage",
"count": 1,
"results": [
{
"id": "a1b2c3d4",
"name": "sendMessage",
"type": "method",
"description": "Sends text messages...",
"fields": [
{
"id": "a1b2c3d4_1",
"name": "chat_id",
"type": "Integer or String",
"required": true
}
],
"reference": "https://core.telegram.org/bots/api#sendmessage",
"score": 1000
}
],
"search_time_ms": 0.45
}DB_FILE=/path/to/database.db
CACHE_DURATION=1800
PORT=5000
LOG_LEVEL=INFO- Search: < 5ms
- Entity lookup: < 2ms
- Startup load: ~2–3 seconds
Data Flow
- Fetch official Telegram docs
- Parse HTML into entities
- Assign unique IDs
- Store in SQLite (FTS enabled)
- Cache entire dataset in memory
- Serve queries from memory
- Fork the repository
- Create a feature branch
- Commit changes
- Add tests if needed
- Submit a pull request
MIT License. See LICENSE for details.
- Telegram Documentation Team
- FastAPI Team
- Open-source contributors
Built with performance in mind ⚡
Search the Telegram Bot API documentation faster than ever.