How to Use Parameters
Replace any value in your query with{{param_name}}
to create a parameter. The query editor will automatically detect these parameters and provide input fields for them.
1
Write a Query with Parameters
Use double curly braces to define parameters in your SQL query:
2
Set Parameter Values
The query editor automatically detects parameters and displays input fields. Enter your desired values:
- last_n_days:
3
- chain:
solana

3
Run and Iterate
Click Run to execute the query with your parameter values. You can modify the parameters and re-run the query to analyze different chains, time periods, or other variables without rewriting the SQL.
Advanced Parameter Techniques
- API Integration
- Dynamic SQL
Parameters become even more powerful when using the Explorer API to run queries programmatically. You can dynamically set parameter values in your API requests to create flexible data pipelines and applications.This enables:
- Automated data pulls with variable filters
- User-driven dashboards and reports
- Dynamic data exports based on business logic