The PSX API for developers
Pakistan Stock Exchange data as clean JSON: prices, dividends, financials, P/E, beta and a full market screener. Add your users' watchlists and portfolios with Sign in with PSX Lens.
curl https://api.psxlens.com/v1/quotes/OGDC
{"symbol":"OGDC","price":312.55,"change_pct":-0.08,"volume":1236159,"high_52":352,"low_52":246, ...}Quotes and daily prices
Every listed company's price, change and volume after each session, and years of daily OHLCV history with corporate action adjustment.
Fundamentals
Financial statements, EPS, P/E, dividend yield, payout ratio and dividend history with ex-dates.
Screener
Filter the whole market by yield, P/E, size, Shariah compliance, 52-week position and beta in one call.
Risk
Volatility, drawdowns and a one-year beta against the KSE-100, built for thinly traded shares.
Indices and sectors
KSE-100, KMI-30, All Share and sector medians, with constituents.
Your users' data
Sign in with PSX Lens, or create your own app users with Google sign-in. Watchlists and portfolios stored for you, no server needed.
Popular endpoints
| GET /v1/quotes/{symbol} | Latest price, change and volume |
| GET /v1/prices/{symbol} | Daily open, high, low, close, volume |
| GET /v1/stocks/{symbol} | Everything about one company, including beta |
| GET /v1/screener | Filter and sort the whole market |
| GET /v1/dividends/{symbol} | Dividend history and ex-dates |
| GET /v1/market/wrap/{date} | A session's breadth, movers and sectors |
| GET /v1/me/watchlist | A signed-in user's watchlist |
| GET /v1/me/portfolios | A signed-in user's portfolios |
Every endpoint is in the API reference and the OpenAPI spec. AI assistants can use the MCP server.
Guides
- Sign in with PSX LensLet users bring their watchlist and portfolios into your app.
- No backend? Use oursCreate your app's users with Google sign-in and store their watchlists here.
- Get PSX stock prices in PythonFetch Pakistan Stock Exchange quotes, daily price history and KSE-100 data in Python with the free PSX Lens API.
- PSX stock prices in Google SheetsPull live Pakistan Stock Exchange prices, dividend yields and P/E into Google Sheets with a short Apps Script function and the free PSX Lens API..
- PSX data in Excel with Power QueryLoad Pakistan Stock Exchange prices, the screener or a stock's price history into Excel with Power Query and the free PSX Lens API.
- PSX market data in JavaScript and Node.jsUse the free PSX Lens API from JavaScript, Node.js or a browser app: quotes, price history, the screener and Sign in with PSX Lens for user watchlists..
Questions
Is there a free PSX API?
Yes. PSX Lens offers a free JSON API for Pakistan Stock Exchange market data. Market and company endpoints need no key; a free key raises the rate limit from 120 to 600 requests a minute.
Is the data real time?
No. Prices are delayed and published once a day after the 15:30 PKT close. The API is built for research, screening, portfolio tracking and end of day analysis, not for trading on live ticks.
Can I get KSE-100 historical data?
Daily prices for every listed company go back to 2021, and the KSE-100's members and daily returns are available. Use /v1/prices/{symbol} for history and /v1/indices for index levels.
Can my app store users' watchlists and portfolios?
Yes, two ways. Your app can create its own users with Google sign-in or anonymous accounts using a publishable key, with no server of your own. Or people sign in with PSX Lens and approve your app. Either way you read and update their watchlist and portfolios through the API.
Does it work with Google Sheets, Excel and AI assistants?
Yes. There are guides for Google Sheets, Excel Power Query, Python and JavaScript, an OpenAPI spec, and an MCP server for Claude, ChatGPT and Cursor.
What does it cost?
It is free while in beta, including Sign in with PSX Lens for any number of users.
Building something? Tell us at hello@btb.finance. Data is delayed and for information only; see the disclaimer.