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

# Market Status

> Query the current trading phase and market time for each market.

## Plan Access

| Plan | Available |
| - | :-: |
| Free | ❌ |
| Starter | ✅ |
| Professional | ✅ |
| Full-Market Plans (A-Shares, HK Stocks, US Stocks) | ✅ |
| Enterprise | ✅ |

## Notes

* This is a global endpoint and does not accept `market` or `symbol`; status changes with the trading session.

## Supported Markets

| Market | Examples |
| - | - |
| US Stocks | US |
| HK Stocks | HK |
| A-Shares | CN |

## Request Parameters

This endpoint does not require query parameters.

## Request Example

```bash theme={null}
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.tickdb.ai/v1/fundamentals/market/status"
```

## Response Fields

The table below lists fields in `data`; an outer `code=0` indicates success.

| Field | Description |
| - | - |
| markets | Trading status list for each market. |
| └─ market | Market code. |
| └─ market\_time | Current market time as an RFC 3339 date-time string with a time-zone offset. |
| └─ trade\_status | Trading-status code. |

Returns market time and trading status for `CN`, `HK`, and `US`.

### `trade_status` Codes

Each market returns only the statuses that apply to it. Common and special trading-phase codes are listed below:

| Market | Code | Meaning |
| - | -: | - |
| CN, HK | `101` | Pre-open clearing |
| CN, HK | `102` | Opening auction |
| CN, HK | `105` | Regular trading |
| CN, HK | `106` | Midday break |
| CN, HK | `107` | Closing auction |
| CN, HK | `108` | Market closed |
| CN | `120` | After-hours fixed-price trading |
| CN, HK | `121` | Half-day market closed |
| CN, HK | `122` | Not yet opened under special conditions |
| CN, HK | `123` | Temporary intraday break |
| US | `201` | Pre-market trading |
| US | `202` | Regular trading |
| US | `203` | Post-market trading |
| US | `204` | Market closed |
| US | `205` | Trading halted |
| US | `206` | Pre-open clearing and pre-market session |
| US | `207` | Overnight trading |
| US | `209` | Pre-market clearing |
| US | `210` | Post-market clearing |


## OpenAPI

````yaml openapi.en.yaml GET /v1/fundamentals/market/status
openapi: 3.1.0
info:
  title: TickDB API
  description: TickDB unified real-time market data API via REST and WebSocket.
  version: 1.0.3
  contact:
    email: support@tickdb.ai
servers:
  - url: https://api.tickdb.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/fundamentals/market/status:
    get:
      tags:
        - fundamentals-events
      summary: Market Status
      description: Query the current trading phase and market time for each market.
      operationId: getFundamentalsMarketStatus
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        required:
                          - markets
                        properties:
                          markets:
                            type: array
                            items:
                              type: object
                              required:
                                - market
                                - market_time
                                - trade_status
                              properties:
                                market:
                                  type: string
                                  example: US
                                market_time:
                                  type: string
                                  format: date-time
                                trade_status:
                                  type: integer
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    SuccessEnvelope:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          const: 0
          description: Business status code; `0` means success.
    ErrorEnvelope:
      type: object
      required:
        - code
        - message
      properties:
        code:
          description: >-
            TickDB API business error code; may be an integer or string. Convert
            it to a string before comparing.
          oneOf:
            - type: integer
            - type: string
        message:
          type: string
          description: Error description.
        error:
          type: string
          description: >-
            Compatibility error identifier; present only in some error
            responses.
        data:
          description: Optional error context; may be null, an object, or an array.
          oneOf:
            - type: 'null'
            - type: object
              additionalProperties: true
            - type: array
              items: {}
  responses:
    ErrorResponse:
      description: >-
        Error response. Common HTTP statuses include 400 (invalid parameters),
        401 (authentication failed), 403 (permission or quota restriction), 404
        (no matching data), 429 (rate limit), and 503 (service temporarily
        unavailable).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            missingAPIKey:
              summary: Missing API key
              value:
                code: '1002'
                message: API key is required. Provide via X-API-Key header
                error: '1002'
            missingKind:
              summary: Missing required parameter
              value:
                code: 40001
                message: kind is required
                data: null
            endpointForbidden:
              summary: API key cannot access this endpoint
              value:
                code: 3009
                message: This endpoint is not allowed for your API key
                data: null
            marketForbidden:
              summary: API key cannot access this market
              value:
                code: 3010
                message: Fundamentals market not allowed for your API key
                data:
                  market: US
            noAvailableSource:
              summary: Data temporarily unavailable
              value:
                code: 5003
                message: Data is temporarily unavailable
                data: null
            notFound:
              summary: No matching data
              value:
                code: 40404
                message: shareholder detail not found
                data: null
            businessNoData:
              summary: No business data matches the query
              value:
                code: 40405
                message: valuation time series not found
                data: null
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.