Beta Ask Claude about PSX data with the hosted connector, no install. Join the waitlist
New release See what's new

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.

Get started View on GitHub

Market snapshot

This year
—
1 year
—

— — (—) today

Loading market data…

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

      SymbolSectorPrice (PKR)Dividend yieldP/E
      Loading…

      How it fits together

      One open-source core does the hard part. Everything else is built on it.

      1. SourcePSX public websiteMarket board, historical pages, index and sector data
      2. 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.

      Read the docs Browse the code