> ## Documentation Index
> Fetch the complete documentation index at: https://psxdata.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch KSE-100 and PSX index data with Python

> Download KSE-100, KSE-30, and all PSX index data programmatically using psxdata.

# Fetch KSE-100 and PSX index data with Python

`psxdata.indices()` returns constituent data for any of the 18 PSX indices, including index weights and market cap.

## Fetch KSE-100 constituents

```python theme={null}
import psxdata

df = psxdata.indices("KSE100")
print(df.columns.tolist())
# ['symbol', 'current_index', 'idx_weight', 'idx_point', 'market_cap_m', 'freefloat_m']
print(df.head())
```

## Available indices

Pass the index name as a string:

| Index name string | Description              |
| ----------------- | ------------------------ |
| `"KSE100"`        | KSE-100 Index            |
| `"KSE30"`         | KSE-30 Index             |
| `"KMIALLSHR"`     | KMI All Shares Index     |
| `"KMI30"`         | KMI-30 Index             |
| `"BKTI"`          | Banking Index            |
| `"NITPGE"`        | NIT PSX Governance Index |

See `psxdata/constants.py` for the complete list.

## Top 10 by index weight

```python theme={null}
import psxdata

df = psxdata.indices("KSE100")
top10 = df.nlargest(10, "idx_weight")[["symbol", "idx_weight", "market_cap_m"]]
print(top10)
```

## Get tickers for an index

To get just the symbol list (cheaper than fetching full constituent data):

```python theme={null}
import psxdata

tickers = psxdata.tickers(index="KSE100")
print(f"{len(tickers)} stocks in KSE-100")
```

<Note>
  `tickers(index="KSE100")` and `indices("KSE100")` share the same cache key.
  Calling both in the same session makes only one network request.
</Note>

## See also

* [`indices()`](/sdk/reference/client) — parameter reference
* [`tickers()`](/sdk/reference/client) — symbol-only list by index
* [Historical data guide](/sdk/guides/historical-data) — download prices for index constituents
