PSX Lens API
MCP REST · OpenAPI · free, no key

Pakistan Stock Exchange data, built for machines

Quotes, dividends, financials and filings for every PSX listing. Every number carries its source and timestamp, and a gap is reported as a gap, never filled with a guess.

Read the docs
Market
…
Quotes
…
Daily prices
…
Dividends
…

Start in one step

Point an AI client at the MCP endpoint and it gets typed tools with schemas. Or call the REST API from anything that speaks HTTP.

{
  "mcpServers": {
    "psxlens": {
      "type": "http",
      "url": "https://api.psxlens.com/mcp"
    }
  }
}

Then ask plainly: Which KSE-100 dividend payers yield over 8% with a P/E under 6?

# dividend payers yielding 8%+, P/E under 6, at least Rs 5m traded a day
curl "https://api.psxlens.com/v1/screener?dividend_yield_min=8\
&pe_max=6&min_value_traded=5000000&inside_kse100=true"

# everything about one company
curl "https://api.psxlens.com/v1/stocks/HUBC"
const res = await fetch("https://api.psxlens.com/v1/dividends/HUBC");
const d = await res.json();

console.log(d.trailing_yield_pct, d.five_year.years_covered);
// a short years_covered means our record is short, not that it stopped paying

The surface

Grouped by the question you are asking. Paths with an example open the live JSON.

Rs 0

Free, with nothing held back

Every market and company endpoint is free and needs no key. There is no paid tier and no throttled starter plan. If something is missing, the data is missing, and the list below says what.

Your own portfolio

Create a key at psxlens.com/api-access and send it as Authorization: Bearer pl_live_….

A key reads market data by default. Reading holdings and recording trades are separate grants you switch on.

For AI agents

If you are an assistant reading this page for someone, this is the short version. The full plain-text guide is at /llms.txt; requesting / with Accept: text/plain returns it too.

1. Prefer MCP: https://api.psxlens.com/mcp (JSON-RPC: initialize, tools/list, tools/call). 2. No key needed for market data. Spec: /openapi.json. 3. Check /v1/freshness before stating anything as current. 4. Have a name, not a ticker? GET /v1/search?q=name. 5. One company: GET /v1/stocks/SYM?compact=1. 6. Quotes are delayed. Prices: oldest first, limit = latest N. 7. history_gap.stale = true means indicators describe an old bar. 8. null means unknown, never zero. Times PKT, amounts PKR. 9. Tell the person the data's date and caveats. Not investment advice.

What we will not hide

Each of these is also stated in the responses themselves, so an agent reading the JSON gets the same caveat you do.

Daily prices have a gap

PSX closed its end-of-day feed on 28 August 2026. Bars resumed in November from company pages, after each close. Indicators say history_gap when they rest on old bars.

New payouts may be missing

PSX's payouts listing has been unreachable since late August 2026. /v1/freshness shows the latest payout we hold; yields after that date understate.

Quotes are delayed

Read from PSX once per session and labelled delayed. Never live.

Dividend history is short

It starts in November 2024. Five-year figures count only covered years and report years_covered.

Prices are not adjusted

A 30% bonus issue leaves a ~23% step in the chart that is not a fall.

No balance sheet

ROE, price to book and debt to equity are absent for every company: PSX publishes those lines only inside filing PDFs.

No Shariah screen or index history

KSE-100 membership and current index levels only.

Blank means unknown

A null is never a zero, and coverage: "unknown" means we could not reach PSX for that symbol.