> ## 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.

# Full A-Share Market Tickers

> Retrieve the current full-market ticker snapshot for A-shares.

## Plan Access

| Plan | Available |
| - | :-: |
| Free | ❌ |
| Starter | ❌ |
| Professional | ❌ |
| All A-Shares | ✅ |
| All HK-Shares | ❌ |
| All US-Shares | ❌ |
| Enterprise | ✅ |

## Notes

* No request parameters are required. The endpoint returns all currently available records in one non-paginated response.
* Coverage includes Shanghai, Shenzhen, and Beijing stocks, ETFs, indices, and bonds. Use `type` and `category` to identify the product type.
* The response can be large. Clients must enable HTTP response compression and advertise at least one of `gzip`, `br`, or `zstd`; requests without compression support may receive `406`.
* `timestamp` is the data time of each ticker, represented as a Unix timestamp in milliseconds.
* `open` and `prev_close` are omitted when the corresponding data is unavailable.

## Supported Market

| Market | Examples |
| - | - |
| A-Shares | 600519.SH, 000001.SZ, 920186.BJ |

## Request Parameters

None.

## Request Example

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

## Code Example

The following Node.js 22+ example advertises all three compression formats and selects the decompressor from the response `Content-Encoding` header.

```javascript theme={null}
const https = require("node:https");
const zlib = require("node:zlib");

const decompressors = {
  gzip: zlib.gunzipSync,
  br: zlib.brotliDecompressSync,
  zstd: zlib.zstdDecompressSync,
};

const request = https.get("https://api.tickdb.ai/v1/market/ticker/cn-stock", {
  headers: {
    "X-API-Key": process.env.TICKDB_API_KEY,
    "Accept-Encoding": "gzip, br, zstd",
  },
}, (response) => {
  const chunks = [];
  response.on("data", (chunk) => chunks.push(chunk));
  response.on("end", () => {
    if (response.statusCode !== 200) {
      throw new Error(`Request failed: ${response.statusCode}`);
    }

    const encoding = response.headers["content-encoding"];
    const decompress = decompressors[encoding];
    if (!decompress) {
      throw new Error(`Unsupported compression format: ${encoding}`);
    }

    const body = decompress(Buffer.concat(chunks));
    const result = JSON.parse(body.toString("utf8"));
    console.log(`Received ${result.data.length} tickers`);
    console.log(result.data[0]);
  });
});

request.on("error", console.error);
```

## Response Fields

| Field | Description |
| - | - |
| code | Response code; `0` indicates success. |
| message | Response message. |
| data | Full-market A-share ticker array. |
| └─ symbol | Trading symbol with a `.SH`, `.SZ`, or `.BJ` market suffix. |
| └─ name | Product name. |
| └─ type | Product type: `stock` for equity-like products or `indices` for indices. |
| └─ category | Detailed product category; see the table below. |
| └─ last\_price | Latest traded price. |
| └─ open | Current-day open; omitted when unavailable. |
| └─ prev\_close | Previous trading day's close; omitted when unavailable. |
| └─ volume\_24h | Current-day cumulative volume. |
| └─ quote\_volume\_24h | Current-day cumulative traded value. |
| └─ high\_24h | Current-day high. |
| └─ low\_24h | Current-day low. |
| └─ price\_change\_24h | Price change from the previous close. |
| └─ price\_change\_percent\_24h | Percentage price change from the previous close. |
| └─ timestamp | Unix timestamp in milliseconds. |

### `category` Values

| Value | Description |
| - | - |
| `sh_stock` | Shanghai Stock Exchange stock. |
| `sz_stock` | Shenzhen Stock Exchange stock. |
| `bj_stock` | Beijing Stock Exchange stock. |
| `etf` | ETF. |
| `cn_index` | A-share market index. |
| `cn_bond` | Mainland China exchange-traded bond. |


## OpenAPI

````yaml openapi.en.yaml GET /v1/market/ticker/cn-stock
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/market/ticker/cn-stock:
    get:
      summary: Full A-Share Market Tickers
      description: Retrieve the current full-market ticker snapshot for A-shares.
      parameters:
        - $ref: '#/components/parameters/FullMarketCompressionHeader'
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FullMarketTickerResponse'
        '406':
          description: Successful response.
        '503':
          description: Successful response.
components:
  parameters:
    FullMarketCompressionHeader:
      name: Accept-Encoding
      in: header
      required: true
      description: >-
        Full-market responses require compression. Support at least one of gzip,
        br, or zstd; gzip is the default.
      schema:
        type: string
        enum:
          - gzip
          - br
          - zstd
        default: gzip
  schemas:
    FullMarketTickerResponse:
      type: object
      required:
        - code
        - message
        - data
      additionalProperties: false
      properties:
        code:
          type: integer
          example: 0
        message:
          type: string
          example: success
        data:
          type: array
          items:
            $ref: '#/components/schemas/FullMarketTicker'
    FullMarketTicker:
      type: object
      required:
        - symbol
        - last_price
        - timestamp
      additionalProperties: false
      properties:
        symbol:
          type: string
          description: Trading product symbol.
        name:
          type: string
          description: Product name.
        type:
          type: string
          enum:
            - stock
            - indices
          description: >-
            Product type: `stock` for equity-like products or `indices` for
            indices.
        category:
          type: string
          enum:
            - sh_stock
            - sz_stock
            - bj_stock
            - etf
            - cn_index
            - cn_bond
          description: >-
            A-share product subcategory; returned only in the A-share
            full-market feed.
        last_price:
          type: string
          description: Latest traded price.
        open:
          type: string
          description: Current-day open; omitted when unavailable.
        prev_close:
          type: string
          description: Previous trading day's close; omitted when unavailable.
        volume_24h:
          type: string
          description: Current-day cumulative volume.
        quote_volume_24h:
          type: string
          description: Current-day cumulative traded value.
        high_24h:
          type: string
          description: Current-day high.
        low_24h:
          type: string
          description: Current-day low.
        price_change_24h:
          type: string
          description: Price change from the previous close.
        price_change_percent_24h:
          type: string
          description: Percentage price change from the previous close.
        timestamp:
          type: integer
          format: int64
          description: Unix timestamp in milliseconds.
  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.