Skip to main content

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.

Uganda Securities Exchange API Hero Light

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. The PortfolioManager class provides four main methods:
  • getAllPortfolioCompanies() - Scrapes the market snapshot page for all listed companies
  • getCompanyDetails($companyName) - Retrieves detailed company information from individual listing pages
  • getPortfolioCompanyData($companyName) - Fetches historical OHLC price data from the exchange’s data endpoint
  • getExchangeRateDetails() - Scrapes current UGX exchange rates from African Financials
Most methods return JSON-formatted data for easy integration with your applications. Note that getPortfolioCompanyData() outputs data directly using echo rather than returning it.
This library relies on web scraping and may break if the Uganda Securities Exchange website structure changes. Always implement proper error handling in production environments.
Before using this library in production:
  1. Visit the Uganda Securities Exchange website
  2. Contact the Uganda Securities Commission for data usage approval
  3. Ensure your use case complies with their terms of service
  4. Implement rate limiting to avoid overloading their servers
See our legal compliance guide for more information.

Requirements

  • PHP 5.6 or higher
  • ext-iconv extension
  • Simple HTML DOM Parser (included)
Recommended:
  • 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
See our contributing guide to get started.

Build docs developers (and LLMs) love