Skip to main content

Introduction

PriceSignal provides a powerful GraphQL API for accessing real-time cryptocurrency price data, managing price alerts, and subscribing to live market updates. The API supports queries, mutations, and WebSocket-based subscriptions.

Endpoint

The GraphQL API is available at a single endpoint:
POST /graphql
For WebSocket subscriptions:
WS /graphql
All API requests require authentication using Firebase JWT tokens. See the Authentication guide for details.

Core Features

Queries

Retrieve cryptocurrency price data with flexible filtering, sorting, and pagination:
  • getPrices - Fetch historical price candles across multiple timeframes (1m, 5m, 10m, 15m, 1h)
  • Instruments - Query available trading pairs and cryptocurrencies
  • Price Rules - Retrieve user-defined price alerts and conditions
  • Exchanges - Get supported exchange information

Mutations

Manage price alerts and user preferences:
  • createPriceRule - Set up custom price alerts with conditions
  • updatePriceRule - Modify existing alert rules
  • deletePriceRule - Remove price alerts
  • togglePriceRule - Enable or disable alerts

Subscriptions

Receive real-time price updates via WebSocket:
  • onPriceUpdated - Subscribe to live price changes for specific symbols

GraphQL Features

Pagination

All paginated queries support cursor-based pagination:
first
integer
default:"10"
Number of items to return (max: 500)
after
string
Cursor for pagination forward
last
integer
Number of items to return from the end
before
string
Cursor for pagination backward

Filtering & Sorting

The API supports advanced filtering and sorting on most queries using HotChocolate conventions:
query {
  prices(interval: ONE_MIN, where: { symbol: { eq: "BTCUSDT" } }, order: { bucket: DESC }) {
    nodes {
      symbol
      close
      bucket
    }
  }
}

Automatic Persisted Queries

The API supports Automatic Persisted Queries (APQ) to reduce bandwidth:
  1. Send the query hash instead of the full query
  2. If the server doesn’t recognize the hash, it will request the full query
  3. Subsequent requests can use just the hash

Example Query

query GetBitcoinPrices {
  prices(interval: ONE_MIN, first: 10, where: { symbol: { eq: "BTCUSDT" } }) {
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
    nodes {
      symbol
      open
      high
      low
      close
      volume
      bucket
      exchange
    }
  }
}

Price Intervals

The API supports the following timeframes for price candles:
ONE_MIN
enum
1-minute candles
FIVE_MIN
enum
5-minute candles
TEN_MIN
enum
10-minute candles
FIFTEEN_MIN
enum
15-minute candles
ONE_HOUR
enum
1-hour candles

GraphQL Introspection

You can explore the full schema using GraphQL introspection or by visiting the GraphQL Playground in development mode.

Next Steps

Authentication

Learn how to authenticate your API requests with Firebase JWT

WebSocket Subscriptions

Set up real-time price updates using WebSocket subscriptions

Build docs developers (and LLMs) love