borsapy

Turkey-specific finance library. A yfinance-like Python package for BIST stock data, forex, crypto, TEFAS and more.

Colophon

Category
Dev tools
Last update
GitHub stars
528
borsapyborsapy

Overview

While building Borsa MCP, we realized there was no Turkey-specific finance library like yfinance, and Yahoo Finance had incomplete or incorrect data for Turkish markets. We had to build everything from scratch.

So we extracted the data sources from Borsa MCP into a yfinance-like Python library. Introducing borsapy!

Features

Stocks (BIST - Borsa Istanbul)

  • Real-time price, volume, market cap
  • Historical OHLCV data (daily, hourly)
  • Balance sheet, income statement, cash flow
  • Dividend and capital increase history
  • Shareholder structure
  • Analyst target prices
  • KAP announcements (Public Disclosure Platform - Turkey's SEC filings equivalent)
  • ISIN codes

Forex & Commodities

  • USD, EUR, GBP and other exchange rates against TRY
  • Gold prices (gram, quarter, half, full coins - traditional Turkish gold denominations)
  • Silver prices
  • Historical exchange rate data

Cryptocurrency

  • BTC, ETH, XRP and 50+ pairs
  • Real-time price and volume
  • Historical OHLCV data

Mutual Funds (TEFAS)

  • Fund search and information (TEFAS is Turkey's Electronic Fund Distribution Platform)
  • Fund price history

Indices

  • XU100 (BIST 100 - main benchmark, similar to S&P 500)
  • XU030 (BIST 30 - blue chips)
  • XBANK (Banking sector index)
  • And more sector indices

Futures & Options (VIOP)

  • All futures contracts (VIOP is Borsa Istanbul Derivatives Market)
  • Options data

Inflation

  • CPI (Consumer Price Index) data
  • Inflation calculator

Installation

pip install borsapy

Usage Example

from borsapy import Stock

# Get stock info
stock = Stock("THYAO")  # THYAO = Turkish Airlines
print(stock.price)
print(stock.info)

# Historical data
history = stock.history(period="1y")
print(history)

Why borsapy?

We believe this will make life much easier for developers working with Turkish financial data. Problems with existing solutions:

  • Yahoo Finance: Incomplete and incorrect data for Turkish markets
  • Other APIs: Paid or limited access
  • Manual solutions: Code that needs to be written from scratch for every project

borsapy solves all these problems, offering an open-source gift to the Turkish developer community.

Contribute

The project is open source and welcomes community contributions. You can open issues or submit pull requests on GitHub.

From the same shelf, built with the same approach.

  • ProjectsNew

    Built by: Said Sürücü

    Borsacı

    AI agent for Turkish financial markets. Multi-agent architecture for BIST stocks, TEFAS funds, crypto, forex, and macroeconomic data.

    228 stars

  • MCP tools

    Built by: Said Sürücü

    Borsa MCP

    MCP server providing Turkish & American financial market data for Claude. BIST, forex, crypto, TEFAS and more.

    529 stars

  • Dev tools

    Built by: Said Sürücü

    yokatlas-py

    Modern Python wrapper for YÖKATLAS API. Type-safe university data access with pydantic validation.

    42 stars

Tools that connect to your own data.

borsapy is open source. If your organization needs something similar for its own data sources, let's talk.

borsapy - Resources | Beta Space Studio | Beta Space Studio