Free, reliable data for the Pakistan Stock Exchange.
psxdata is a family of open-source tools that turns the exchange's public data into clean, checked tables. Use it from Python, from any language over HTTP, or just ask Claude.
Market snapshot
- This year
- —
- 1 year
- —
— — (—) today
Top movers in KSE-100
Up
Down
Closing values as of —, refreshed every weekday after the close by the psxdata library itself. Not investment advice.
- Listed tickers
- 1,000+
- Sectors
- 37
- Years of daily index history
- 10
- Downloads last month
- —
- Cost
- Free
One dataset, three ways in
The same clean data, whichever way you work.
For analysts and data people
Install from PyPI and get pandas DataFrames back. Caching, retries and data checks are built in, so a notebook or a nightly job just works.
KSE-100 stocks with the highest dividend yield, from the screener
| Symbol | Sector | Price (PKR) | Dividend yield | P/E |
|---|---|---|---|---|
| Loading… | ||||
For apps, sheets and any language
Plain JSON over HTTPS. Call it from JavaScript, Excel, Go or a cron job. No key, no sign-up, 60 requests a minute.
Loading…
Shortened. The full response has a few more fields.
For everyone else
Connect psxdata to Claude and ask in plain English. Claude pulls the data and answers with the numbers, so you can check them.
Runs on your machine in Docker today. A hosted version that needs no install is invite-only while it's in testing.
From a real conversation, 1 Nov 2026
Which KSE-100 banks pay the highest dividend right now?
Claude used the psxdata screener
These five. NBP's yield is the highest, but its price fell about 25% over the year, and a falling price pushes the yield up. Worth checking why before reading it as cheap.
| Bank | Price (PKR) | Dividend yield | 1-year change |
|---|---|---|---|
| NBP | 159.72 | 21.3% | −24.7% |
| BAFL | 57.77 | 13.2% | +12.5% |
| HMB | 96.68 | 12.3% | −20.1% |
| BOP | 28.35 | 10.2% | −15.4% |
| SCBPL | 59.57 | 10.0% | −6.9% |
How it fits together
One open-source core does the hard part. Everything else is built on it.
- SourcePSX public websiteMarket board, historical pages, index and sector data
- Corepsxdata libraryScrapes, cleans, validates and caches it into tidy tables
-
- Python libraryDataFrames for notebooks and scripts
- REST APIJSON for apps and spreadsheets
- MCP serverPSX data inside Claude
- Analytics warehouseDaily indicators, rankings and returns
Checked, not just scraped
Every price row is validated. Impossible highs and lows, duplicate dates and out-of-order rows are flagged instead of passed on silently.
Fast and gentle
Results are cached, requests are rate limited and retried with backoff, so your code stays fast and the exchange's site isn't hammered.
Tested every day
Integration tests run against the live site every night, a weekly check catches page-layout changes, and this page is rebuilt with psxdata every weekday.
What data you get
Everything the exchange publishes, in one consistent shape.
- Historical prices
- Daily open, high, low, close and volume for every listed stock and index.
- Live quotes
- Price, change, P/E and yield for any ticker from the market board.
- Indices
- KSE-100, KSE-30, KMI-30 and more, with each stock's weight and points.
- Sectors
- All 37 sectors: aggregates, turnover and member stocks.
- Screener
- About 750 stocks with price, P/E, dividend yield and 1-year change.
- Fundamentals
- The financial reports each company has filed.
- Debt market
- TFCs, sukuks and other listed debt instruments.
- Margin-eligible stocks
- The current list of eligible scrips.
What people build with it
- Dividend and value screens
- Filter the whole market by yield, P/E and one-year change, and rerun it every morning. Python library
- Strategy backtests
- Ten years of daily index and stock prices to test moving averages, momentum or rebalancing rules. Python library
- Dashboards and spreadsheets
- Pull quotes and sector moves into Google Sheets, Excel or a web app without writing a scraper. REST API
- Research in plain English
- Ask Claude to compare companies, check trends or explain a move, with the numbers shown. MCP server
Questions
Is it really free?
Yes. The library, the API and the MCP server are free and MIT licensed. There's no paid tier. The hosted API is rate limited to 60 requests a minute per IP so it stays free for everyone.
Is this official PSX data?
psxdata isn't affiliated with the Pakistan Stock Exchange. It reads the data the exchange publishes on its public website and tidies it up. For anything that matters, check against the exchange.
How fresh is the data?
Quotes and the screener follow the exchange's market board, which updates during trading hours but isn't tick by tick. Historical prices are daily, up to the last close.
Are prices adjusted for splits and dividends?
No. Prices are as the exchange reports them, not adjusted for splits, bonus shares or dividends. Keep that in mind for long backtests.
Can I use it in a commercial project?
The code is MIT licensed, so yes. The underlying data comes from the exchange, so check its terms for your use.
Which tool should I start with?
Writing Python? Use the library. Building an app or a spreadsheet in another language? Use the REST API. Not a programmer? Connect it to Claude and ask questions.
Start with the docs
Install guides, examples and the full reference for every tool.