PSX API Documentation

This API provides access to Pakistan Stock Exchange (PSX) data including stock histories and index data.

Base URL: https://psx-data.boltflare.com

Endpoints

1. Stock History

GET

Description: Get historical data for a specific stock symbol.

URL:
/psx/v2/stock_history/{SYMBOL}
Parameters:
SYMBOL: The stock symbol (e.g., KEL, HBL, etc.)
page (optional): Page number for pagination (default: 1)
limit (optional): Number of records per page (default: no limit, max: 10000)
Example:
https://psx-data.boltflare.com/psx/v2/stock_history/KEL?page=1&limit=100
Response Format (JSON):
{ "symbol": "KEL", "total_entries": 1234, "entry": [ { "date": "2023-12-01", "close": 123.45, "low": 120.00, "high": 125.00, "volume": 100000 }, ... ] }

2. Index Data

GET

Description: Get historical data for a specific index symbol.

URL:
/psx/v1/index/{SYMBOL}
Parameters:
SYMBOL: The index symbol (e.g., KMI30, KSE100, etc.)
page (optional): Page number for pagination (default: 1)
limit (optional): Number of records per page (default: no limit, max: 10000)
Example:
https://psx-data.boltflare.com/psx/v1/index/KMI30?page=1&limit=50
Response Format (JSON):
{ "symbol": "KMI30", "total_entries": 567, "entry": [ { "date": "2023-12-01", "close_value": 45678.90, "volume": 5000000 }, ... ] }

Error Responses

Notes