> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Create query

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:

* [Run the query](/api/explorer/run-query)
* [Update the query](/api/explorer/update-query)
* Reference in your application

## Example: Creating a Parameterized Query

```bash theme={null}
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

<Info>
  **Maximum Rows: 250,000**

  Queries 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.
</Info>

## Next Steps

After creating a query:

1. Save the returned `query_id` for future reference
2. [Execute the query](/api/explorer/run-query) to get results
3. [Update the query](/api/explorer/update-query) if you need to modify it later
