Com APIdps.psx.com.pk ↗
Access PSX market data via API: live quotes, indices, sector summaries, financials, dividends, and announcements for all listed companies on the Pakistan Stock Exchange.
What is the Com API?
This API covers 11 endpoints for the Pakistan Stock Exchange Data Portal (dps.psx.com.pk), returning live quotes, market indices, sector breakdowns, financial highlights, payout history, and company announcements. The get_stock_quote endpoint delivers current price, P/E ratio, market cap, free float, and trading statistics for any listed symbol. The get_symbols endpoint enumerates every listed instrument with sector classification and flags for ETF and debt instruments.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/0f3edd12-1750-4749-9b05-539f1e94db49/get_symbols' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace dps-psx-com-pk-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.psx_data_portal_api import PSX, IndexName, AnnouncementType, BoardType
psx = PSX()
# List all market indices
for idx in psx.marketindexes.list():
print(idx.name, idx.price, idx.as_of)
# Get market summary
summary = psx.marketsummaries.get()
for board in summary.boards:
print(board.board, board.stats)
# Get a stock quote and explore its financials
stock = psx.stocks.get(symbol="OGDC")
print(stock.symbol, stock.price, stock.change)
# Get financial tables for the stock
for table in stock.financials():
print(table.headers, table.rows[0])
# Get dividend payouts
for payout in stock.payouts():
print(payout.date, payout.details, payout.book_closure)
# Get company announcements filtered by type
for ann in stock.announcements(type=AnnouncementType.C):
print(ann.date, ann.time, ann.title)
# Navigate an index and list its constituents
kse100 = psx.marketindex(name=IndexName.KSE100)
for constituent in kse100.constituents():
print(constituent.symbol, constituent.current, constituent.percent_change)
# List trading board with board type filter
for ts in psx.tradingstocks.list(board_type=BoardType.REG):
print(ts.symbol, ts.bid_price, ts.offer_price, ts.volume)
Returns all listed symbols with their names and sectors on the Pakistan Stock Exchange. Each symbol includes classification flags (ETF, debt) and sector assignment.
No input parameters required.
{
"type": "object",
"fields": {
"items": "array of symbol objects with symbol, name, sectorName, isETF, isDebt"
},
"sample": {
"data": {
"items": [
{
"name": "Oil & Gas Development Company Limited",
"isETF": false,
"isDebt": false,
"symbol": "OGDC",
"sectorName": "OIL & GAS EXPLORATION COMPANIES"
}
]
},
"status": "success"
}
}About the Com API
Market Data and Quotes
The get_market_summary endpoint returns board-level trading statistics — trades, volume, and value — alongside top index values with daily change and percent change. For granular per-stock data, get_trading_panel exposes the live trading board with bid/offer prices, bid/offer volumes, last day closing price (LDCP), and traded volume. The board_type parameter accepts REG (regular equity), FUT (deliverable futures), CSF (cash settled futures), and ODL (odd lot). Note that only the REG board reliably returns data outside market hours.
Indices and Constituents
get_market_indices lists all PSX indices with high, low, volume, 52-week range, YTD change, and previous close. To drill into an index, get_index_constituents accepts a named index — KSE100, KSE30, KMI30, ALLSHR, PSXDIV20, and others — and returns each constituent's current price, change, volume, and contribution to index points (indexPoints). This makes it straightforward to decompose which stocks are driving a given index's movement on any given day.
Company-Level Data
get_stock_financials returns annual and quarterly highlights for a given symbol, structured as a headers array (year or quarter labels) plus rows of metric values covering Sales, Profit, EPS, and margins. get_stock_payouts provides full dividend history per symbol, including announcement date, book closure date range, payout details (percentage and type), and the financial period each payout references. get_stock_announcements supports filtering by symbol and by announcement type (C for company, E for exchange, CDC, SECP, NCCPL), and returns a PDF download link where available.
Listings and Sector Coverage
get_listings enumerates all main-board companies with their sector, total outstanding shares, and free float. get_sector_summary aggregates trading activity by sector, returning advance/decline counts, turnover volume, and market cap in billions alongside the PSX sector code. Together these endpoints give a complete cross-sectional view of the exchange without requiring per-symbol iteration.
The Com API is a managed, monitored endpoint for dps.psx.com.pk — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when dps.psx.com.pk changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official dps.psx.com.pk API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Building a PSX portfolio tracker that pulls live bid/offer prices via
get_trading_paneland calculates unrealized P&L. - Screening stocks by sector using
get_sector_summaryadvance/decline ratios and market cap to identify sector rotation. - Monitoring dividend calendars by ingesting
get_stock_payoutsbook closure dates for multiple symbols. - Aggregating company announcements via
get_stock_announcementswith type C to trigger alerts on regulatory filings or results. - Constructing index-tracking spreadsheets using
get_index_constituentsindex points contributions for KSE100 or KMI30. - Charting annual EPS and profit trends from
get_stock_financialsquarterly headers across multiple listed companies. - Populating a symbol lookup service with
get_symbolsto classify instruments as equity, ETF, or debt across all PSX sectors.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does the Pakistan Stock Exchange have an official developer API?+
What does `get_stock_quote` return beyond the current price?+
get_stock_quote returns a stats object that includes Open, High, Low, Volume, LDCP, P/E Ratio, Market Cap, total Shares, and Free Float for the requested symbol, along with the price change and percentage change. The symbol parameter is required — there is no bulk quote endpoint that returns all symbols in one call.Are there any known limitations with the `get_trading_panel` endpoint?+
Does the API return historical OHLCV price series for individual stocks?+
Can I retrieve announcements for all company types, including SECP and NCCPL filings?+
get_stock_announcements endpoint accepts type values C, E, CDC, SECP, and NCCPL, but type C (company announcements) is the most reliable. Other types may return inconsistent results. Filtering by symbol is only meaningful for type C; regulatory bodies like SECP do not map cleanly to individual stock symbols.