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.
Method signature
Parameters
The ticker symbol of the company (e.g., “BOBU”, “DFCU”)
Return value
Returns a JSON-encoded string (via echo) containing historical stock data, or a JSON error object if the request fails.Response examples
Usage example
How it works
Build data URL
Constructs the API endpoint:
https://www.use.or.ug/data.php?stock={companyName}&callback=?Transform data
Converts numeric array indices to named keys (timestamp, open, high, low, close, adjusted_close, volume) and adds human-readable dates
HTTP headers
The method sets the following HTTP headers:Content-Type: application/jsonAccess-Control-Allow-Origin: *(enables CORS)
Content-Type: application/jsonHTTP/1.1 500 Internal Server Error
Notes
This method uses
echo to output the result directly, rather than returning it. Use output buffering (ob_start() and ob_get_clean()) if you need to capture the result as a variable.- The data source is the USE API endpoint at
data.php - Timestamps are converted from milliseconds to human-readable format
- The latest share price is extracted from the last data point in the array
- CORS is enabled by default, allowing cross-origin requests