API Reference

This section documents how to connect to Market SQL and which tables each dataset exposes.

Market SQL has a single endpoint. What you receive depends on the dataset you select and the SQL you send. Each dataset has its own page below listing every table and what it contains.

Quickstart

Inspect five PumpSwap trades on Solana:

bashcurl --fail-with-body \
  --user "<USER-ID>:<API-KEY>" \
  "https://market-sql.eu-central-1.getblock.io?database=solana&default_format=JSONEachRow" \
  --data-binary "SELECT block_time, direction, base_token, quote_token FROM pumpswap_all_swaps LIMIT 5"
javascriptimport { createClient } from '@clickhouse/client'

const client = createClient({
  host: 'https://market-sql.eu-central-1.getblock.io',
  username: process.env.GETBLOCK_USER_ID,
  password: process.env.GETBLOCK_API_KEY,
  database: 'solana'
})

const rows = await client.query({
  query: 'SELECT block_time, direction, base_token, quote_token FROM pumpswap_all_swaps LIMIT 5',
  format: 'JSONEachRow'
})

console.log(await rows.json())
pythonimport os
import clickhouse_connect

client = clickhouse_connect.get_client(
    host='market-sql.eu-central-1.getblock.io',
    port=443,
    username=os.environ['GETBLOCK_USER_ID'],
    password=os.environ['GETBLOCK_API_KEY'],
    database='solana',
    secure=True,
)

print(client.query_df(
    'SELECT block_time, direction, base_token, quote_token FROM pumpswap_all_swaps LIMIT 5'
))

Response

json{"block_time":"2025-10-09 17:00:00","direction":"B","base_token":"HdbQVdtTh3gFuvmvVqHCh37w9ADPCiE9f24EX63npump","quote_token":"So11111111111111111111111111111111111111112"}
{"block_time":"2025-10-09 17:00:00","direction":"S","base_token":"So11111111111111111111111111111111111111112","quote_token":"2oyFNVveXsgPZGgwSPMSASriv59M5ZqZ9CCewanK38Q8"}
{"block_time":"2025-10-09 17:00:00","direction":"B","base_token":"So11111111111111111111111111111111111111112","quote_token":"5Dyr4rWsqGxJEtVRUM7HzgS6UQE93Babqot8mgevvHPh"}
{"block_time":"2025-10-09 17:00:00","direction":"S","base_token":"2ktfSdqv5Te5XRFo4Do5U21RNGKiyuWbQatXp7p8pump","quote_token":"So11111111111111111111111111111111111111112"}
{"block_time":"2025-10-09 17:00:00","direction":"S","base_token":"So11111111111111111111111111111111111111112","quote_token":"2rP2qcdjv3LFYvwU9Rp89TDm7EAf3Zv9iuRXP6Uckw2T"}

Endpoint

bashhttps://market-sql.eu-central-1.getblock.io

Authentication

Credentials go in HTTP Basic Auth on every request, not in the URL.

FieldValue
UsernameYour GetBlock user ID
PasswordA GetBlock API key in gb_… format

Parameters

ParameterTypeRequiredDescription
databasestringYesDataset to query: solana, polymarket, hyperliquid, or robinhood.
default_formatstringNoOutput format, for example JSONEachRow. A FORMAT clause in the SQL takes precedence.

Datasets

DatasetDescriptionTables
solanaSwaps, launches, transfers, funding, blocks, and Jito tips21
polymarketPrediction-market fills, events, and markets3
hyperliquidPerpetual fills, wallet analytics, and positions4
robinhoodLaunchpads, Uniswap v3/v4, and token metadata on Robinhood Chain25

Choosing a dataset

If you needUse
Solana DEX swaps, token launches, and migrationssolana
Wallet funding paths and token transfers on Solanasolana
Perpetual fills, wallet PnL, and open positionshyperliquid
Launchpad and Uniswap activity on Robinhood Chainrobinhood
Prediction-market fills and outcomespolymarket

Concepts that apply to every query

  1. One dataset per plan: Access is purchased per dataset. A query to a dataset your API key has no access to is rejected.
  2. Read-only: The gateway runs every query under a managed, read-only identity. Only statements that read data are accepted.
  3. Execution limits: Trials allow one concurrent query and 10 seconds of execution. Monthly access allows 60 seconds with higher query limits.
  4. Errors: A failed query returns a non-2xx HTTP status with the error message in the response body. Use curl --fail-with-body to see the message while still failing the command.
SymptomCauseResolution
Authentication is rejectedThe user ID and API key belong to different accounts, or the key is invalidUse the user ID of the account that owns the key
Access to a dataset is deniedNo active trial or subscription for that databaseActivate the dataset on the Pricing tab
A query stops before finishingThe query exceeded the plan's execution limitAdd filters, select fewer columns, add LIMIT, or upgrade the plan
A driver or IDE cannot connectThe client uses the native TCP protocolConnect over HTTPS on port 443
A second query fails during a trialTrials allow one concurrent queryRun queries one after another