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

# CGSimplePrice

> Real-time coin price updates by CoinGecko coin IDs

### Notes

* Streams real-time prices for one or more coins by their unique Coin API IDs.
* Specify preferred quote currencies via `vs_currencies` in the subscription data. See [Supported Currencies](/reference/simple-supported-currencies) for valid values. Defaults to USD.
* Find a coin's API ID on its [CoinGecko](https://www.coingecko.com) page, via [Coins List](/reference/coins-list), or this [Google Sheet](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?usp=sharing).
* Fields may return `null` when data is unavailable. Ensure your application handles null values.

<Callout icon="clock-rotate-left" color="#2196F3" iconType="regular">
  <strong>Update Frequency:</strong><br />As fast as \~10 seconds for large-cap and actively traded coins.
</Callout>

### Data Payload

| Key     | Field                         | Type    | Description                                             | Example          |
| ------- | ----------------------------- | ------- | ------------------------------------------------------- | ---------------- |
| `c`     | `channel_type`                | string  | Channel type subscribed to.                             | `C1`             |
| `i`     | `coin_id`                     | string  | Coin identifier.                                        | `bitcoin`        |
| `vs`    | `vs_currency`                 | string  | Target quote currency.                                  | `usd`            |
| `p`     | `price`                       | number  | Current price in the specified `vs_currency`.           | 61696.68         |
| `pp`    | `price_24h_change_percentage` | number  | Price change percentage over the last 24 hours.         | 1.42             |
| `pp7d`  | `price_7d_change_percentage`  | number  | Price change percentage over the last 7 days.           | 3.8214           |
| `pp30d` | `price_30d_change_percentage` | number  | Price change percentage over the last 30 days.          | -2.1543          |
| `pp60d` | `price_60d_change_percentage` | number  | Price change percentage over the last 60 days.          | 12.4512          |
| `pp1y`  | `price_1y_change_percentage`  | number  | Price change percentage over the last 1 year.           | 120.8541         |
| `m`     | `market_cap`                  | number  | Market capitalization in the specified `vs_currency`.   | 1236047139289.68 |
| `cs`    | `circulating_supply`          | number  | Circulating supply of coin.                             | 19734150         |
| `fdv`   | `fully_diluted_value`         | number  | Fully diluted valuation in the specified `vs_currency`. | 1312500000000    |
| `v`     | `24h_vol`                     | number  | 24-hour trading volume in the specified `vs_currency`.  | 30595921115.54   |
| `t`     | `last_updated_at`             | integer | UNIX timestamp in seconds.                              | 1780839768       |

***

### 1. Establish Connection

```bash theme={null}
wss://stream.coingecko.com/v1?x_cg_pro_api_key=YOUR_KEY
```

<Tip>You can also pass the key as a header: `x-cg-pro-api-key: YOUR_KEY`</Tip>

**Output:**

```json theme={null}
{
  "code": 3000,
  "message": "Connection established",
  "uuid": "YOUR_SESSION_ID"
}
```

```json theme={null}
{
  "type": "welcome",
  "sid": "YOUR_SESSION_ID"
}
```

***

### 2. Subscribe to CGSimplePrice

**Input:**

```json wrap theme={null}
{"command":"subscribe","identifier":"{\"channel\":\"CGSimplePrice\"}"}
```

**Output:**

```json theme={null}
{
  "type": "confirm_subscription",
  "identifier": "{\"channel\":\"CGSimplePrice\"}"
}
```

***

### 3. Stream Price Data

**Input:**

```json wrap theme={null}
{"command":"message","identifier":"{\"channel\":\"CGSimplePrice\"}","data":"{\"coin_id\":[\"bitcoin\"],\"vs_currencies\":[\"usd\"],\"action\":\"set_tokens\"}"}
```

**Output:**

```json theme={null}
{
  "code": 2000,
  "message": "Subscribed to bitcoin in usd"
}
```

**Streaming output:**

```json theme={null}
{
  "c": "C1",
  "i": "bitcoin",
  "vs": "usd",
  "p": 61696.67928656691,
  "pp": 1.4192404041947198,
  "pp7d": 3.8214,
  "pp30d": -2.1543,
  "pp60d": 12.4512,
  "pp1y": 120.8541,
  "m": 1236047139289.684,
  "cs": 19734150,
  "fdv": 1312500000000,
  "v": 30595921115.53988,
  "t": 1780839768
}
```

<Note>Output keys may appear in any order.</Note>

***

### 4. Unsubscribe

**Unsubscribe from a specific token:**

```json wrap theme={null}
{"command":"message","identifier":"{\"channel\":\"CGSimplePrice\"}","data":"{\"coin_id\":[\"bitcoin\"],\"action\":\"unset_tokens\"}"}
```

```json theme={null}
{
  "code": 2000,
  "message": "Unsubscription is successful for bitcoin"
}
```

**Unsubscribe from the channel entirely:**

```json wrap theme={null}
{"command":"unsubscribe","identifier":"{\"channel\":\"CGSimplePrice\"}"}
```

```json theme={null}
{
  "code": 2000,
  "message": "Unsubscription is successful for all tokens"
}
```

***


## AsyncAPI

````yaml websocket/asyncapi.json cgsimpleprice
id: cgsimpleprice
title: Cgsimpleprice
description: Real-time coin price updates by CoinGecko coin IDs
servers:
  - id: production
    protocol: wss
    host: stream.coingecko.com
    bindings: []
    variables: []
address: /v1
parameters: []
bindings: []
operations:
  - &ref_1
    id: subscribeToCGSimplePrice
    title: 'CGSimplePrice: Subscribe'
    description: To subscribe to the CGSimplePrice channel for receiving coin price updates
    type: receive
    messages:
      - &ref_4
        id: subscribe
        payload:
          - name: Subscribe to CGSimplePrice
            description: Subscribe to the CGSimplePrice channel
            type: object
            properties:
              - name: command
                type: string
                description: Subscription command
                enumValues:
                  - subscribe
                required: true
              - name: identifier
                type: string
                description: JSON string specifying the target channel
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - command
            - identifier
          properties:
            command:
              type: string
              enum:
                - subscribe
              default: subscribe
              description: Subscription command
              x-parser-schema-id: <anonymous-schema-2>
            identifier:
              type: string
              default: '{"channel":"CGSimplePrice"}'
              description: JSON string specifying the target channel
              x-parser-schema-id: <anonymous-schema-3>
          x-parser-schema-id: <anonymous-schema-1>
        title: Subscribe to CGSimplePrice
        description: Subscribe to the CGSimplePrice channel
        example: |-
          {
            "command": "<string>",
            "identifier": "<string>"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: cgsimpleprice
  - &ref_2
    id: streamCGSimplePrice
    title: 'CGSimplePrice: Stream Data'
    description: To set which coins and vs_currencies to stream price data for
    type: receive
    messages:
      - &ref_5
        id: stream
        payload:
          - name: Stream CGSimplePrice Data
            description: Set coins to receive price updates for
            type: object
            properties:
              - name: command
                type: string
                description: Message command
                enumValues:
                  - message
                required: true
              - name: identifier
                type: string
                description: JSON string specifying the target channel
                required: true
              - name: data
                type: string
                description: >-
                  JSON string with coin_id array (required) and vs_currencies
                  array (optional, defaults to ["usd"])
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - command
            - identifier
            - data
          properties:
            command:
              type: string
              enum:
                - message
              default: message
              description: Message command
              x-parser-schema-id: <anonymous-schema-5>
            identifier:
              type: string
              default: '{"channel":"CGSimplePrice"}'
              description: JSON string specifying the target channel
              x-parser-schema-id: <anonymous-schema-6>
            data:
              type: string
              default: >-
                {"coin_id":["bitcoin"],"vs_currencies":["usd"],"action":"set_tokens"}
              example: >-
                {"coin_id":["bitcoin"],"vs_currencies":["usd"],"action":"set_tokens"}
              description: >-
                JSON string with coin_id array (required) and vs_currencies
                array (optional, defaults to ["usd"])
              x-parser-schema-id: <anonymous-schema-7>
          x-parser-schema-id: <anonymous-schema-4>
        title: Stream CGSimplePrice Data
        description: Set coins to receive price updates for
        example: |-
          {
            "command": "<string>",
            "identifier": "<string>",
            "data": "<string>"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: stream
    bindings: []
    extensions: *ref_0
  - &ref_3
    id: receiveCGSimplePriceUpdates
    title: 'CGSimplePrice: Receive Updates'
    description: >-
      To receive real-time coin price updates including price, market cap,
      volume, and 24h change
    type: send
    messages:
      - &ref_6
        id: update
        payload:
          - name: CGSimplePrice Update
            description: Real-time coin price update from server
            type: object
            properties:
              - name: c
                type: string
                description: Channel type
                required: false
              - name: i
                type: string
                description: Coin identifier
                required: false
              - name: vs
                type: string
                description: Target vs_currency
                required: false
              - name: p
                type: number
                description: Price in vs_currency
                required: false
              - name: pp
                type: number
                description: 24h price change percentage
                required: false
              - name: pp7d
                type: number
                description: 7d price change percentage
                required: false
              - name: pp30d
                type: number
                description: 30d price change percentage
                required: false
              - name: pp60d
                type: number
                description: 60d price change percentage
                required: false
              - name: pp1y
                type: number
                description: 1y price change percentage
                required: false
              - name: m
                type: number
                description: Market cap in vs_currency
                required: false
              - name: cs
                type: number
                description: Circulating supply
                required: false
              - name: fdv
                type: number
                description: Fully diluted valuation in vs_currency
                required: false
              - name: v
                type: number
                description: 24h trading volume in vs_currency
                required: false
              - name: t
                type: integer
                description: UNIX timestamp in seconds
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            c:
              type: string
              example: C1
              description: Channel type
              x-parser-schema-id: <anonymous-schema-9>
            i:
              type: string
              example: bitcoin
              description: Coin identifier
              x-parser-schema-id: <anonymous-schema-10>
            vs:
              type: string
              example: usd
              description: Target vs_currency
              x-parser-schema-id: <anonymous-schema-11>
            p:
              type: number
              example: 61696.68
              description: Price in vs_currency
              x-parser-schema-id: <anonymous-schema-12>
            pp:
              type: number
              example: 1.42
              description: 24h price change percentage
              x-parser-schema-id: <anonymous-schema-13>
            pp7d:
              type: number
              example: 3.8214
              description: 7d price change percentage
              x-parser-schema-id: <anonymous-schema-14>
            pp30d:
              type: number
              example: -2.1543
              description: 30d price change percentage
              x-parser-schema-id: <anonymous-schema-15>
            pp60d:
              type: number
              example: 12.4512
              description: 60d price change percentage
              x-parser-schema-id: <anonymous-schema-16>
            pp1y:
              type: number
              example: 120.8541
              description: 1y price change percentage
              x-parser-schema-id: <anonymous-schema-17>
            m:
              type: number
              example: 1236047139289.68
              description: Market cap in vs_currency
              x-parser-schema-id: <anonymous-schema-18>
            cs:
              type: number
              example: 19734150
              description: Circulating supply
              x-parser-schema-id: <anonymous-schema-19>
            fdv:
              type: number
              example: 1312500000000
              description: Fully diluted valuation in vs_currency
              x-parser-schema-id: <anonymous-schema-20>
            v:
              type: number
              example: 30595921115.54
              description: 24h trading volume in vs_currency
              x-parser-schema-id: <anonymous-schema-21>
            t:
              type: integer
              example: 1780839768
              description: UNIX timestamp in seconds
              x-parser-schema-id: <anonymous-schema-22>
          x-parser-schema-id: <anonymous-schema-8>
        title: CGSimplePrice Update
        description: Real-time coin price update from server
        example: |-
          {
            "c": "C1",
            "i": "bitcoin",
            "vs": "usd",
            "p": 61696.68,
            "pp": 1.42,
            "pp7d": 3.8214,
            "pp30d": -2.1543,
            "pp60d": 12.4512,
            "pp1y": 120.8541,
            "m": 1236047139289.68,
            "cs": 19734150,
            "fdv": 1312500000000,
            "v": 30595921115.54,
            "t": 1780839768
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: update
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
  - *ref_2
receiveOperations:
  - *ref_3
sendMessages:
  - *ref_4
  - *ref_5
receiveMessages:
  - *ref_6
extensions:
  - id: x-parser-unique-object-id
    value: cgsimpleprice
securitySchemes:
  - id: cgApiKey
    name: x_cg_pro_api_key
    type: httpApiKey
    description: CoinGecko API key
    in: query
    extensions: []

````