Skip to main content
Create a new saved Explorer query programmatically. This allows you to define and save SQL queries without using the Allium App interface.

Key Parameters

  • title - A descriptive name for your query
  • config.sql - The SQL query to execute
  • config.limit - Maximum number of rows to return (default: 1000)
  • config.parameters - Optional parameter definitions for templated queries using {{parameter_name}} syntax
  • config.compute_profile - Optional compute profile identifier for query execution

Query Response

The endpoint returns a query_id that you can use to:

Example: Creating a Parameterized Query

curl -X POST "https://api.allium.so/api/v1/explorer/queries" \
  -H "X-API-KEY: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Ethereum Transactions by Date Range",
    "config": {
      "sql": "SELECT * FROM ethereum.raw.transactions WHERE block_timestamp > {{start_date}} LIMIT {{limit}}",
      "limit": 1000,
      "parameters": {
        "start_date": "2024-01-01",
        "limit": "1000"
      }
    }
  }'

Data Export Limit

Maximum Rows: 250,000Queries created through the API follow the same export limits as queries created in the Allium App. The maximum number of rows that can be exported is 250,000. This limit can be increased on request.

Next Steps

After creating a query:
  1. Save the returned query_id for future reference
  2. Execute the query to get results
  3. Update the query if you need to modify it later