The open-source API for Egyptian Exchange data
Self-hostable. BYOK. One docker command. Unified access to Alpha Vantage, Finnhub, and Yahoo Finance — with automatic fallback.
Try it now
Hits a live instance. 50 requests/day shared across all visitors — for evaluation only.
Want unlimited? Self-host in 60 seconds
Why it exists
The Egyptian Exchange is one of the oldest in the world — yet it remains dramatically underserved by developer tooling.
Fragmented data
Different providers cover different EGX symbols with different formats. Alpha Vantage may have COMI but not EAST. Yahoo coverage varies by symbol variant. You end up writing glue code forever.
No clean Python interface
yfinance partially works, but EGX symbol formats are inconsistent across providers — .CA, .EY, no suffix. You spend hours on reconciliation before writing a single line of real logic.
Open by default
MIT licensed, self-hostable, no vendor lock-in. Your API keys stay on your server. The fallback logic, the schema normalization, and the symbol dictionary are all yours to fork.
How it works
From zero to a running EGX API in under 60 seconds.
Clone the repo
Get the code and copy the environment template.
git clone https://github.com/omarelsergany/borsa.git
cd borsa
cp .env.example .envAdd your API keys
Get free keys from Alpha Vantage and/or Finnhub. Yahoo Finance needs no key.
# .env
ALPHA_VANTAGE_API_KEY=your_key_here
FINNHUB_API_KEY=your_key_here
# Get free keys at:
# → alphavantage.co/support/#api-key
# → finnhub.io/registerStart the service
One command. API live at localhost:8000. Interactive docs at /docs.
docker compose up
# Or without Docker:
uv sync && uv run uvicorn borsa.main:app --reload
# Query it:
curl http://localhost:8000/quotes/COMICode examples
Same REST API, any language. Consistent response schema regardless of which provider answered.
# Fetch a quote
curl https://api.borsa.ashh.me/demo/quote/COMI
# Response:
# {
# "symbol": "COMI",
# "name": "Commercial International Bank",
# "price": 45.80,
# "open": 45.20,
# "high": 46.10,
# "low": 45.00,
# "previous_close": 45.50,
# "change": 0.30,
# "change_percent": 0.659,
# "volume": 1234567,
# "currency": "EGP",
# "provider": "yahoo",
# "fetched_at": "2025-05-24T10:30:00"
# }
# List all EGX symbols
curl http://localhost:8000/symbols
# Historical data (daily, last month)
curl "http://localhost:8000/historical/COMI?interval=daily&period=1mo"Features
Everything you need to build on EGX data, nothing you don't.
Multi-provider fallback
Alpha Vantage → Finnhub → Yahoo Finance. If one fails or rate-limits, the next is tried automatically.
15+ EGX symbols pre-configured
COMI, CIBEA, EAST, ETEL, HRHO, and more. Symbol-to-provider mapping handled for you.
In-process caching
TTL-based cache with configurable size. Responses served in microseconds on cache hit.
Async parallel fetching
Built on FastAPI and httpx. Non-blocking I/O means fast p99 even under concurrent load.
Type-safe with Pydantic
Every response is a validated Pydantic model. No surprise null fields, no string-typed numbers.
Open source (MIT)
Fork it, extend it, deploy it. No vendor lock-in, no per-seat pricing, no usage telemetry.