| title | Getting Started |
|---|---|
| description | Get started with the SolixDB REST/JSON-RPC API in minutes |
This guide will help you get started with the SolixDB API and make your first request to query Solana DeFi data.
- HTTP client (curl, Postman, or your preferred tool)
- API key from dashboard.solixdb.xyz
- Basic understanding of JSON-RPC 2.0 or SQL
POST https://api.solixdb.xyz/v1/rpc
POST https://api.solixdb.xyz/v1/query
The simplest way to get started is with a basic JSON-RPC request:
```bash curl curl -X POST "https://api.solixdb.xyz/v1/rpc" \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTransactions", "params": [{ "limit": 10, "filters": { "protocols": ["drift_v2"] } }] }' ```const response = await fetch('https://api.solixdb.xyz/v1/rpc', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getTransactions',
params: [{
limit: 10,
filters: {
protocols: ['drift_v2']
}
}]
})
});
const data = await response.json();
console.log(data.result.data);import requests
response = requests.post(
'https://api.solixdb.xyz/v1/rpc',
headers={
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
json={
'jsonrpc': '2.0',
'id': 1,
'method': 'getTransactions',
'params': [{
'limit': 10,
'filters': {
'protocols': ['drift_v2']
}
}]
}
)
data = response.json()
print(data['result']['data'])Alternatively, you can use SQL queries:
```bash curl curl -X POST "https://api.solixdb.xyz/v1/query" \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "query": "SELECT signature, protocol_name, fee FROM transactions WHERE protocol_name = '\''jupiter_v6'\'' LIMIT 10", "format": "json" }' ```const response = await fetch('https://api.solixdb.xyz/v1/query', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
query: 'SELECT signature, protocol_name, fee FROM transactions WHERE protocol_name = \'jupiter_v6\' LIMIT 10',
format: 'json'
})
});
const data = await response.json();
console.log(data.data);import requests
response = requests.post(
'https://api.solixdb.xyz/v1/query',
headers={
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
json={
'query': 'SELECT signature, protocol_name, fee FROM transactions WHERE protocol_name = \'jupiter_v6\' LIMIT 10',
'format': 'json'
}
)
data = response.json()
print(data['data'])JSON-RPC responses follow the JSON-RPC 2.0 specification:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"signature": "5VERv8NMxzbPDohNpJhHopN2C9R4G5GaPevYf5hLJ8Z7",
"slot": "123456789",
"blockTime": 1735689600,
"protocolName": "jupiter_v6",
"fee": 5000,
"computeUnits": 200000,
"success": true
}
]
}
}SQL query responses:
{
"data": [
{
"signature": "5VERv8NMxzbPDohNpJhHopN2C9R4G5GaPevYf5hLJ8Z7",
"protocol_name": "jupiter_v6",
"fee": "5000"
}
],
"count": 10,
"query": "SELECT signature, protocol_name, fee FROM transactions WHERE protocol_name = 'jupiter_v6' LIMIT 10"
}If there's an error, the response will include error information:
JSON-RPC:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "Server error",
"data": "Invalid filter parameter"
}
}SQL Query:
{
"error": "Invalid query",
"message": "Query must be a non-empty string"
}Query transactions for a specific Solana address:
const response = await fetch('https://api.solixdb.xyz/v1/rpc', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getTransactionsForAddress',
params: [
'YOUR_ADDRESS_HERE',
{
transactionDetails: 'full',
sortOrder: 'asc',
limit: 100,
filters: {
blockTime: {
gte: 1735689600, // Jan 1, 2025
lte: 1738368000 // Jan 31, 2025
},
status: 'succeeded'
}
}
]
})
});
const data = await response.json();
console.log('Transactions:', data.result.data);Get a specific transaction by its signature:
const response = await fetch('https://api.solixdb.xyz/v1/rpc', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getTransaction',
params: ['TRANSACTION_SIGNATURE_HERE']
})
});
const data = await response.json();
console.log('Transaction:', data.result);Use SQL for complex queries:
const response = await fetch('https://api.solixdb.xyz/v1/query', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
query: `
SELECT
protocol_name,
COUNT(*) as count,
AVG(fee) as avg_fee
FROM transactions
WHERE protocol_name IN ('jupiter_v6', 'pump_fun')
AND date >= '2025-01-01'
AND date <= '2025-01-31'
GROUP BY protocol_name
ORDER BY count DESC
`,
format: 'json'
})
});
const data = await response.json();
console.log('Results:', data.data);Currently, we support the following DEX protocols:
jupiter_v4- Jupiter Aggregator V4jupiter_v6- Jupiter Aggregator V6raydium_amm_v3- Raydium AMM V3raydium_cp_swap- Raydium CP Swappump_fun- Pump.funpump_amm- Pump AMMwhirlpool- Orca Whirlpool
All API endpoints require an API key. Include it in the x-api-key header or as an api-key query parameter.
Now that you've made your first request, explore these resources:
Explore all available methods and parameters. See real-world examples for common use cases. Learn about API keys and security. Understand how to handle errors gracefully. Learn about plan-based rate limits. Learn about SQL query execution.