# Get Public Token - Classic Spot/Margin

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/bullet-public:
    post:
      summary: Get Public Token - Classic Spot/Margin
      deprecated: false
      description: >+
        :::info[Description]

        This interface can obtain the token required for Websocket to establish
        a Spot/Margin connection.

        If you need use public channels (e.g. all public market data), please
        make request as follows to obtain the server list and public token 

        :::

      tags:
        - Classic WebSocket/Base Info
        - MAIN
        - TH
        - TR
        - AU
        - EU
        - ALL
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  data:
                    type: object
                    properties:
                      token:
                        type: string
                        description: The token required to establish a Websocket connection
                      instanceServers:
                        type: array
                        items:
                          type: object
                          properties:
                            endpoint:
                              type: string
                              description: >-
                                Websocket domain URL. It is recommended to use a
                                dynamic URL, as the URL may change.
                            encrypt:
                              type: boolean
                              description: >-
                                Whether to encrypt. Currently only supports wss,
                                not ws
                            protocol:
                              type: string
                              description: Network Protocol
                              enum:
                                - websocket
                              x-apidog-enum:
                                - value: websocket
                                  name: Websocket
                                  description: Websocket
                            pingInterval:
                              type: integer
                              description: Recommended ping interval (milliseconds)
                            pingTimeout:
                              type: integer
                              description: Heartbeat timeout (milliseconds)
                          x-apidog-orders:
                            - endpoint
                            - encrypt
                            - protocol
                            - pingInterval
                            - pingTimeout
                          required:
                            - endpoint
                            - encrypt
                            - protocol
                            - pingInterval
                            - pingTimeout
                    required:
                      - token
                      - instanceServers
                    x-apidog-orders:
                      - token
                      - instanceServers
                required:
                  - code
                  - data
                x-apidog-orders:
                  - code
                  - data
              example: |-
                {
                    "code": "200000",
                    "data": {
                        "token": "2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==",
                        "instanceServers": [
                            {
                                "endpoint": "wss://ws-api-spot.kucoin.***/",  //
                                "encrypt": true,
                                "protocol": "websocket",
                                "pingInterval": 18000,
                                "pingTimeout": 10000
                            }
                        ]
                    }
                }
          headers: {}
          x-apidog-name: OK
      security: []
      x-abandon: normal
      x-domain: Spot
      x-api-channel: Public
      x-api-permission: 'NULL'
      x-api-rate-limit-pool: Public
      x-sdk-service: Spot
      x-sdk-sub-service: Market
      x-sdk-method-name: getPublicToken
      x-sdk-method-description: >-
        This interface can obtain the token required for Websocket to establish
        a Spot/Margin connection. If you need use public channels (e.g. all
        public market data), please make request as follows to obtain the server
        list and public token
      x-api-rate-limit-weight: 10
      x-apidog-folder: Classic WebSocket/Base Info
      x-apidog-status: released
      x-run-in-apidog: https://www.kucoin.com/docs-new/web/project/345089/apis/api-3470294-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.kucoin.com
    description: OPEN
security: []

```