API Endpoint
API Endpoint for SQL queries
API Endpoints allow you to access query results programmatically from Draxlr. Once created, you can use the endpoint in applications, scripts, or integrations to fetch data directly from your queries.
How to Create an API Endpoint
Follow these steps to create an API endpoint:
- Click Create API Endpoint to set up a new API integration.
- Choose the Query that should power this API endpoint.
- Click Create to finalize and create the API endpoint.
- Once created, Draxlr will generate:
- API URL
- API Key
You can now use these credentials to access the query results via HTTP requests.
API Request
Use the generated API URL to fetch query results.
Example cURL Request
curl https://api.draxlr.com/api/integrations/gW7AxKzIhqNebVTSQJFmb1sojGIwtH7S/result?page=1&pageSize=10&variables=%7B%7D -H "Authorization: wuIh2z8RBBdmy7IK5JiakrU29S1FNtfY"
Request Headers
| Header | Description |
|---|---|
| Authorization | API Key generated for the endpoint |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number for pagination |
| pageSize | integer | Number of records per page |
| variables | JSON | Query variables encoded as URL string |
Response
The API returns the query results in JSON format.
Example Response
{
"page": 1,
"pageSize": 10,
"total": 120,
"data": [
{
"month": "Jan 2026",
"orders": 73
},
{
"month": "Feb 2026",
"orders": 74
}
]
}
Tips
- Keep your API key secure and never expose it publicly.
- Use pagination for large datasets.
- Use query variables to dynamically filter results.
- API endpoints can be used in internal tools, dashboards, and automation scripts.