Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jessebyarugaba/Unofficial-Uganda-Securities-Exhange-API/llms.txt
Use this file to discover all available pages before exploring further.

Welcome to the Uganda Securities Exchange API
The Uganda Securities Exchange API is an unofficial PHP library that enables developers to programmatically access real-time market data from the Uganda Securities Exchange website. Built on the robust Simple HTML DOM Parser, this library provides a straightforward interface for retrieving company listings, stock prices, and financial information.This is an unofficial library that uses web scraping to retrieve data. For production use, please obtain approval from the Uganda Securities Commission.
Key features
Company listings
Retrieve all listed companies from the Uganda Securities Exchange market snapshot
Company details
Fetch detailed information including ISIN, market cap, listing date, and contact details
Historical stock data
Access historical price data with open, high, low, close values and trading volume
Exchange rates
Get current UGX to USD exchange rates and currency performance metrics
Get started
Installation
Install the library in your PHP project using manual download
Quickstart
Get up and running with your first API call in minutes
API reference
Explore all available methods and their parameters
Examples
Learn from practical code examples and common use cases
How it works
The library uses web scraping to extract data from the Uganda Securities Exchange website. ThePortfolioManager class provides four main methods:
getAllPortfolioCompanies()- Scrapes the market snapshot page for all listed companiesgetCompanyDetails($companyName)- Retrieves detailed company information from individual listing pagesgetPortfolioCompanyData($companyName)- Fetches historical OHLC price data from the exchange’s data endpointgetExchangeRateDetails()- Scrapes current UGX exchange rates from African Financials
getPortfolioCompanyData() outputs data directly using echo rather than returning it.
Legal compliance
Before using this library in production:- Visit the Uganda Securities Exchange website
- Contact the Uganda Securities Commission for data usage approval
- Ensure your use case complies with their terms of service
- Implement rate limiting to avoid overloading their servers
Requirements
- PHP 5.6 or higher
- ext-iconv extension
- Simple HTML DOM Parser (included)
- ext-mbstring for better multi-byte document decoding
- ext-curl for cURL download support
- ext-openssl for HTTPS page loading
Support
This is an open-source project. For issues, questions, or contributions:- View the source code on GitHub
- Report bugs or request features via GitHub Issues
- Contribute improvements via Pull Requests
