Query data

This page shows how to query data from QuestDB using different programming languages or tools.

First things first#

Make sure you have QuestDB running and accessible, you can do so from Docker, the binaries or Homebrew for macOS users.


You can query data using the REST API, this will work with a very wide range of libraries and tools. The REST API is accessible on port 9000.

curl -G \
--data-urlencode "query=SELECT x FROM long_sequence(5);" \

Postgres compatibility#

You can query data using the Postgres endpoint that QuestDB exposes. This is accessible via port 8812.

const { Client } = require("pg")
const start = async () => {
try {
const client = new Client({
database: "qdb",
host: "",
password: "quest",
port: 8812,
user: "admin",
await client.connect()
const res = await client.query("SELECT x FROM long_sequence(5);")
await client.end()
} catch (e) {