Skip to content

Tiny-Trader/broker-api-docs

Repository files navigation

Indian Broker API Documentation Scraper

A collection of Crawl4AI-based scrapers to download and maintain offline copies of Indian stock broker API documentation.

πŸ“Š Scraped Brokers

Broker Sections Lines Status
Kite Connect v3 (Zerodha) 18 ~4,700 βœ… Complete
Angel One SmartAPI 19 ~161,740 βœ… Complete
Upstox Open API 24 ~1,200 βœ… Complete
Groww Trade API 27 ~6,200 βœ… Complete

Total: 88 files, ~173,840 lines of documentation


πŸ“ Output Structure

output/
β”œβ”€β”€ kite-connect-v3/          # Zerodha Kite Connect
β”‚   β”œβ”€β”€ orders/README.md
β”‚   β”œβ”€β”€ user/README.md
β”‚   β”œβ”€β”€ websocket/README.md
β”‚   └── ... (18 sections)
β”‚
β”œβ”€β”€ angel-one-smartapi/       # Angel One
β”‚   β”œβ”€β”€ Orders/README.md
β”‚   β”œβ”€β”€ User/README.md
β”‚   β”œβ”€β”€ Gtt/README.md
β”‚   └── ... (19 sections)
β”‚
β”œβ”€β”€ upstox-open-api/          # Upstox
β”‚   β”œβ”€β”€ orders/README.md
β”‚   β”œβ”€β”€ gtt-orders/README.md
β”‚   β”œβ”€β”€ authentication/README.md
β”‚   └── ... (24 sections)
β”‚
└── groww-trade-api/          # Groww
    β”œβ”€β”€ python-sdk/orders/README.md
    β”œβ”€β”€ python-sdk/smart-orders/README.md
    β”œβ”€β”€ python-sdk/portfolio/README.md
    β”œβ”€β”€ curl/orders/README.md
    └── ... (27 sections)

πŸš€ Quick Start

Prerequisites

# Install Crawl4AI
pip install crawl4ai

# Install Playwright browser
playwright install chromium

Re-Scrape Documentation

Kite Connect (Zerodha):

python kite_crawler.py
python clean_docs.py

Angel One SmartAPI:

python angel_crawler.py
python clean_angel_docs.py

Upstox Open API:

python upstox_crawler.py
python clean_upstox_docs.py

Verify All Documentation

python verify_all_docs.py

πŸ“‹ Available Scripts

Script Purpose Broker
kite_crawler.py Scrape Kite Connect docs Zerodha
angel_crawler.py Scrape Angel One docs Angel Broking
upstox_crawler.py Scrape Upstox docs Upstox
groww_crawler.py Scrape Groww docs Groww
clean_docs.py Clean Kite markdown Zerodha
clean_angel_docs.py Clean Angel markdown Angel Broking
clean_upstox_docs.py Clean Upstox markdown Upstox
clean_groww_docs.py Clean Groww markdown Groww
verify_all_docs.py Verify completeness All

πŸ”„ Refresh Documentation

Full Refresh (All Brokers)

# Re-scrape everything
python kite_crawler.py
python angel_crawler.py
python upstox_crawler.py
python groww_crawler.py

# Clean all
python clean_docs.py
python clean_angel_docs.py
python clean_upstox_docs.py
python clean_groww_docs.py

# Verify
python verify_all_docs.py

# Commit updates
git add output/
git commit -m "Refresh all broker docs - $(date +%Y-%m-%d)"

Fresh Start (Delete & Re-scrape)

# Delete existing output
rm -rf output/kite-connect-v3
rm -rf output/angel-one-smartapi
rm -rf output/upstox-open-api
rm -rf output/groww-trade-api

# Re-scrape from scratch
python kite_crawler.py && python clean_docs.py
python angel_crawler.py && python clean_angel_docs.py
python upstox_crawler.py && python clean_upstox_docs.py
python groww_crawler.py && python clean_groww_docs.py

βž• Adding New Brokers

To scrape a new broker's documentation:

  1. Copy existing crawler as template:

    cp kite_crawler.py newbroker_crawler.py
  2. Edit the configuration:

    # In newbroker_crawler.py, change:
    BASE_URL = "https://api.newbroker.com/docs/"
    OUTPUT_DIR = Path(__file__).parent / "output" / "newbroker-api"
  3. Run the crawler:

    python newbroker_crawler.py
  4. Create cleanup script if needed (depends on site's HTML structure)

  5. Commit:

    git add newbroker_crawler.py output/newbroker-api/
    git commit -m "Add NewBroker API documentation"

πŸ“… Maintenance Schedule

Frequency Action
Monthly Check broker API changelogs for updates
Quarterly Full re-scrape of all documentation
After announcements Re-scrape affected broker

πŸ› οΈ Technology Stack

  • Crawl4AI - Async web crawler with JavaScript rendering
  • Playwright - Headless browser automation
  • Python 3.10+ - Runtime environment

πŸ“ Documentation Topics Covered

Common Sections Across Brokers:

  • βœ… Authentication & Login
  • βœ… Orders (Regular, GTT, AMO, CO, Smart Orders)
  • βœ… Portfolio & Holdings
  • βœ… Market Data & Quotes
  • βœ… Historical Data
  • βœ… User Profile & Funds
  • βœ… Margins & Charges
  • βœ… WebSocket Streaming / Feed
  • βœ… Rate Limiting
  • βœ… Error Codes & Exceptions
  • βœ… SDKs & Libraries
  • βœ… Instruments & Symbols
  • βœ… Backtesting (Groww)

⚠️ Notes

  1. Navigation Cleanup: Some markdown files may contain residual navigation links. Cleanup scripts remove most noise automatically.

  2. Dynamic Content: All scrapers use headless browsers to handle JavaScript-rendered documentation sites.

  3. Rate Limiting: Scrapers respect website load times. Don't run too frequently to avoid being blocked.

  4. API Changes: Broker APIs evolve. Re-scrape quarterly or after major announcements.


πŸ“„ License

This repository contains scraped documentation for personal/offline use only. All content copyright belongs to respective brokers:

  • Zerodha (Kite Connect)
  • Angel One (SmartAPI)
  • Upstox (Open API)

For production use, always refer to official documentation:


🀝 Contributing

Found a broker with missing docs? Want to add a new scraper?

  1. Fork the repository
  2. Create a new crawler script
  3. Test thoroughly
  4. Submit a pull request

Last Updated: 2026-02-26

About

Offline Indian broker API documentation with automated scrapers

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages