Market Status
Retrieve current market status and trading session information.
GET/3.0/market/state
Description
This endpoint returns the current status of the PSX market including whether the market is open or closed, trading session information, and market statistics.
Request
Authentication
- Type: Bearer Token
- Required: Yes
Parameters
This endpoint does not accept any query parameters.
Response
Success Response (200)
{
"status": "ok",
"message": "",
"count": 0,
"data": {
"state": "SUS",
"last_update": "2025-10-02 15:50:01",
"last_closing": "2025-10-02 16:00:00",
"last_activity": "2025-10-02 16:39:40"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
state | string | Current market state. See Market State Values for possible values. |
last_update | string | Last update timestamp (YYYY-MM-DD HH:MM:SS) |
last_closing | string | Last market closing timestamp (YYYY-MM-DD HH:MM:SS) |
last_activity | string | Last trading activity timestamp (YYYY-MM-DD HH:MM:SS) |
Market State Values
| State | Description |
|---|---|
RED | Market is starting |
PRE | Pre-market session (open or normal) |
OPN | Market is actively trading |
BRK | Market break |
PCL | Post-close / After hours |
HLT | Temporarily suspended |
CBR | Circuit breaker triggered |
SUS | Suspended (default state) |
Error Responses
For detailed Common Error responses, see the Error Handling.
Examples
Get Current Market Status
curl -X GET "https://csapis.com/3.0/market/state" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Use Cases
- Real-time Monitoring: Check if market is open or closed
- Trading Hours: Know exact opening and closing times
- Market Summary: Get current market statistics
- Index Values: Check current index values
- Trading Activity: Monitor market activity and sentiment
- Alert Management: Check for any market alerts or circuit breaker triggers