# PSX Pakistan Stock Exchange API
> Live intraday and historical data for the Pakistan Stock Exchange (PSX), with no key. Read the latest quote for any listed symbol (last price, day change, sector, instrument type); pull the intraday tick series (every trade — time, price, size); get the end-of-day price history; and browse the full symbol directory classified by sector and instrument type (equity, ETF, debt). The Pakistan-equities / intraday-tick / symbol-directory layer for trading dashboards, screeners and research — distinct from other exchange readers, with intraday tick-level granularity. Live from the PSX Data Portal; short cache only.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/psx-api/..."
```

## Pricing
- **Free** (Free) — 15,000 calls/Mo, 3 req/s
- **Starter** ($23/Mo) — 300,000 calls/Mo, 8 req/s
- **Pro** ($60/Mo) — 1,700,000 calls/Mo, 20 req/s
- **Enterprise** ($139/Mo) — 8,800,000 calls/Mo, 60 req/s

## Endpoints

### Quotes

#### `GET /v1/quote` — Latest quote for a symbol

**Parameters:**
- `symbol` (query, required, string) — PSX symbol, e.g. LUCK (Lucky Cement), OGDC, HBL Example: `LUCK`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/psx-api/v1/quote?symbol=LUCK"
```

**Response:**
```json
{
    "data": {
        "name": "Lucky Cement Limited",
        "note": "The latest quote for one PSX-listed symbol — last traded price, previous close, day change and the symbol's name, sector and instrument type. Pass symbol (e.g. LUCK, OGDC, HBL). Use /v1/intraday for ticks and /v1/eod for history.",
        "as_of": "2026-06-12T11:49:49.000Z",
        "price": 449.11,
        "change": 16.02,
        "sector": "CEMENT",
        "source": "PSX",
        "symbol": "LUCK",
        "instrument": "equity",
        "change_percent": 3.7,
        "previous_close": 433.09
    },
    "meta": {
        "timestamp": "2026-06-15T02:11:07.512Z",
        "request_id": "01863ce9-1862-4560-994d-382da72ab0af"
    },
    "status": "ok",
    "message": "Quote retrieved successfully",
    "success": true
}
```

### History

#### `GET /v1/eod` — End-of-day price history

**Parameters:**
- `symbol` (query, required, string) — PSX symbol, e.g. OGDC Example: `OGDC`
- `limit` (query, optional, string) — Days (1-1000, default 90) Example: `90`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/psx-api/v1/eod?symbol=OGDC&limit=90"
```

**Response:**
```json
{
    "data": {
        "note": "The end-of-day price history for one PSX symbol — each day's closing price and volume, newest first. Pass symbol (e.g. OGDC) and limit (1-1000, default 90).",
        "count": 90,
        "source": "PSX",
        "symbol": "OGDC",
        "history": [
            {
                "date": "2026-06-12",
                "close": 317.99,
                "volume": 3228564
            },
            {
                "date": "2026-06-11",
                "close": 316.2,
                "volume": 2336208
            },
            {
                "date": "2026-06-10",
                "close": 316.68,
                "volume": 1366369
            },
            {
                "date": "2026-06-09",
                "close": 319.63,
                "volume": 2778242
            },
            {
                "date": "2026-06-08",
                "close": 318.07,
                "volume": 2805226
            },
            {
                "date": "2026-06-05",
                "close": 320.31,
                "volume": 2032744
            },
            {
                "date": "2026-06-04",
                "close": 324.56,
                "volume": 2362888
            },
            {
                "date": "2026-06-03",
                "close": 319.95,
                "volume": 2339418
            },
            {
                "date": "2026-06-02",
                "close": 320.58,
                "volume": 2144427
            },
        
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/intraday` — Intraday tick series

**Parameters:**
- `symbol` (query, required, string) — PSX symbol, e.g. LUCK Example: `LUCK`
- `limit` (query, optional, string) — Ticks (1-1000, default 100) Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/psx-api/v1/intraday?symbol=LUCK&limit=100"
```

**Response:**
```json
{
    "data": {
        "note": "The intraday tick series for one PSX symbol for the current/last session — each trade's time, price and size, newest first. Pass symbol (e.g. LUCK) and limit (1-1000, default 100). Only available while or shortly after the market trades.",
        "count": 100,
        "ticks": [
            {
                "time": "2026-06-12T11:49:49.000Z",
                "price": 449.11,
                "volume": 5
            },
            {
                "time": "2026-06-12T11:49:08.000Z",
                "price": 449.11,
                "volume": 5000
            },
            {
                "time": "2026-06-12T11:48:06.000Z",
                "price": 449.11,
                "volume": 3000
            },
            {
                "time": "2026-06-12T11:48:04.000Z",
                "price": 449.11,
                "volume": 26
            },
            {
                "time": "2026-06-12T11:48:00.000Z",
                "price": 449.11,
                "volume": 77
            },
            {
                "time": "2026-06-12T11:47:38.000Z",
                "price": 449.11,
                "volume": 500
            },
            {
                "time": "2026-06-12T11:47:13.000Z",
                "price": 449.11,
                "volume": 10
            },
            {
                "time": "2026-06-12T11:47:06.000Z",
                "price": 449.11,
                "volume": 5
            },
            {
                "time":
…(truncated, see openapi.json for full schema)
```

### Reference

#### `GET /v1/symbols` — Symbol directory by sector & type

**Parameters:**
- `sector` (query, optional, string) — Filter by sector, e.g. CEMENT
- `type` (query, optional, string) — equity, etf or debt Example: `etf`
- `limit` (query, optional, string) — Results (1-2000, default 100) Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/psx-api/v1/symbols?type=etf&limit=100"
```

**Response:**
```json
{
    "data": {
        "note": "The PSX symbol directory — every listed symbol with its name, sector and instrument type (equity, ETF or debt). Filter by sector (see the sectors list) and type; page with limit. Use a symbol with the quote, intraday and eod endpoints.",
        "count": 9,
        "total": 9,
        "source": "PSX",
        "sectors": [
            "APPAREL",
            "AUTOMOBILE ASSEMBLER",
            "AUTOMOBILE PARTS & ACCESSORIES",
            "BILLS AND BONDS",
            "CABLE & ELECTRICAL GOODS",
            "CEMENT",
            "CHEMICAL",
            "CLOSE - END MUTUAL FUND",
            "COMMERCIAL BANKS",
            "ENGINEERING",
            "EXCHANGE TRADED FUNDS",
            "FERTILIZER",
            "FOOD & PERSONAL CARE PRODUCTS",
            "GLASS & CERAMICS",
            "INSURANCE",
            "INV. BANKS / INV. COS. / SECURITIES COS.",
            "JUTE",
            "LEASING COMPANIES",
            "LEATHER & TANNERIES",
            "MISCELLANEOUS",
            "MODARABAS",
            "OIL & GAS EXPLORATION COMPANIES",
            "OIL & GAS MARKETING COMPANIES",
            "PAPER, BOARD & PACKAGING",
            "PHARMACEUTICALS",
            "POWER GENERATION & DISTRIBUTION",
            "PROPERTY",
            "REAL ESTATE INVESTMENT TRUST",
            "REFINERY",
            "SUGAR & ALLIED INDUSTRIES",
            "SYNTHETIC & RAYON",
            "TECHNOLOGY & COMMUNICATION",
            "TEXTILE COMPOSITE",
       
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Endpoints & source

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/psx-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "sample": {
            "luck_close": 449.11
        },
        "source": "PSX Data Portal public feed (dps.psx.com.pk), keyless",
        "service": "psx-api",
        "endpoints": {
            "GET /v1/eod": "End-of-day price history (symbol, limit).",
            "GET /v1/meta": "This document.",
            "GET /v1/quote": "Latest quote for one symbol (symbol).",
            "GET /v1/symbols": "Symbol directory by sector & type (sector, type).",
            "GET /v1/intraday": "Intraday tick series (symbol, limit)."
        },
        "description": "Live intraday and historical data for the Pakistan Stock Exchange (PSX) with no key: the latest quote for any symbol (price, change, sector, instrument type), the intraday tick series, the end-of-day price history, and the full symbol directory classified by sector and instrument type (equity, ETF, debt). The Pakistan-equities / intraday-tick / symbol-directory layer for trading dashboards and screeners. Distinct from other exchange readers — PSX with intraday-tick granularity. Live, short cache only.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-15T02:11:08.478Z",
        "request_id": "e1180ad5-5f09-48bb-b5a1-e80954d415db"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/psx-api
OpenAPI spec: https://www.oanor.com/api/psx-api/openapi.json
