Skip to main content

Data API

Create an API that runs in Kubernetes to query QuestDB for candlesticks. Several API frameworks can be used for this purpose, such as Hapi, Express, or others based on project requirements.

Routes

API routes should use QuestDB's REST API to query candlesticks. Here's an example query similar to what would be used with Grafana:

Candlestick Query

  • Note that because tables can't have certain symbols, underscores must be replaced with '/'.
  • Use SAMPLE BY to downsample to different timeframes
  • Add a LIMIT to the query to limit the amount of data returned
  • Use encodeURIComponent to ensure the query is properly parameterized

QuestDb