API Reference
gregat provides a free, public JSON API. No authentication or API key required. Base URL:
https://gregat.com
GET /api/quote
Fetch price quotes from all venues (CEX + DEX) for a trading pair.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
pair | string | Yes | Trading pair, e.g. BTC/USDT |
Example Request
curl https://gregat.com/api/quote?pair=SOL/USDT
Example Response
{
"pair": "SOL/USDT",
"quotes": [
{
"venue": "Raydium (Solana)",
"type": "dex",
"askPrice": "85.05",
"bidPrice": "85.05",
"askSize": "7540207",
"bidSize": "7540207",
"midPrice": 85.05,
"spreadBps": 0,
"timestamp": 1773228010866
},
{
"venue": "Binance",
"type": "cex",
"askPrice": "85.20",
"bidPrice": "85.19",
"askSize": "127.22",
"bidSize": "664.10",
"midPrice": 85.195,
"spreadBps": 1.17,
"timestamp": 1773228010832
}
],
"timestamp": 1773228011263
}
Response Fields
| Field | Type | Description |
|---|---|---|
pair | string | The requested trading pair |
quotes | array | Sorted by best ask price (lowest first) |
quotes[].venue | string | Exchange or DEX name with chain |
quotes[].type | string | "cex" or "dex" |
quotes[].askPrice | string | Best ask price |
quotes[].bidPrice | string | Best bid price |
quotes[].askSize | string | Size at ask (CEX) or liquidity USD (DEX) |
quotes[].bidSize | string | Size at bid (CEX) or liquidity USD (DEX) |
quotes[].midPrice | number | Midpoint price |
quotes[].spreadBps | number | Spread in basis points (0 for DEX) |
quotes[].error | string? | Error message if venue failed |
timestamp | number | Response generation time (ms epoch) |
GET /api/quote/pairs
List all available trading pairs.
Example
curl https://gregat.com/api/quote/pairs
{
"pairs": [
"BTC/USDT", "ETH/USDT", "SOL/USDT",
"DOGE/USDT", "XRP/USDT", "ADA/USDT",
"AVAX/USDT", "LINK/USDT", "DOT/USDT",
"NEAR/USDT", "SUI/USDT", "PEPE/USDT"
]
}
Self-Hosting
gregat is open source. Deploy your own instance with custom fees.
1. Clone and install
git clone https://github.com/alexiuz/gregat.git cd gregat pnpm install pnpm build
2. Configure
Edit gregat.toml:
[fees] wallet = "your-wallet-address" bps = 30 # 0.30% platform fee [cex.binance] enabled = true base_url = "https://api.binance.com" # Add or remove exchanges as needed
3. Run
# API server PORT=3737 node packages/server/dist/index.js # Static frontend (deploy anywhere) # Built files in packages/client/dist/