Skip to main content
WSS

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 for valid values. Defaults to USD.
  • Find a coin’s API ID on its CoinGecko page, via Coins List, or this Google Sheet.
  • Fields may return null when data is unavailable. Ensure your application handles null values.
Update Frequency:
As fast as ~10 seconds for large-cap and actively traded coins.

Data Payload


1. Establish Connection

You can also pass the key as a header: x-cg-pro-api-key: YOUR_KEY
Output:

2. Subscribe to CGSimplePrice

Input:
Output:

3. Stream Price Data

Input:
Output:
Streaming output:
Output keys may appear in any order.

4. Unsubscribe

Unsubscribe from a specific token:
Unsubscribe from the channel entirely:

x_cg_pro_api_key
type:httpApiKey

CoinGecko API key

Subscribe to CGSimplePrice
type:object

Subscribe to the CGSimplePrice channel

command
type:enum
required

Subscription command

Available options: subscribe
identifier
type:string
required

JSON string specifying the target channel

Stream CGSimplePrice Data
type:object

Set coins to receive price updates for

command
type:enum
required

Message command

Available options: message
identifier
type:string
required

JSON string specifying the target channel

data
type:string
required

JSON string with coin_id array (required) and vs_currencies array (optional, defaults to ["usd"])

CGSimplePrice Update
type:object

Real-time coin price update from server

c
type:string

Channel type

i
type:string

Coin identifier

vs
type:string

Target vs_currency

p
type:number

Price in vs_currency

pp
type:number

24h price change percentage

pp7d
type:number

7d price change percentage

pp30d
type:number

30d price change percentage

pp60d
type:number

60d price change percentage

pp1y
type:number

1y price change percentage

m
type:number

Market cap in vs_currency

cs
type:number

Circulating supply

fdv
type:number

Fully diluted valuation in vs_currency

v
type:number

24h trading volume in vs_currency

t
type:integer

UNIX timestamp in seconds