Query events on any indexed rollup
Conduit Indexing simplifies the experience querying smart contract data onchain. This guide will walk you through getting an API key and sending your first query.
Sign in
Log into the Conduit app and head to the Indexing
tab.
Set up billing
Click Get started
and enter your billing details and subscribe to the Indexing Pro plan to send queries without limits. For pricing details, check out Pricing & Costs.
How To Query Events
Once you’ve finished setting up billing you can begin querying events with your newly created API key.
There are two ways to query; with the Query builder on the Indexing dashboard, or directly via the API.
Using the Indexing API directly
The base API url to use is https://indexing.conduit.xyz/v2/query
.
To use your API key you can either;
- Append the API key directly in a query parameter
?api-key=KEY
- Add a field to the request body
{ "api-key": "KEY", ... }
using aPOST
request - Submit an
api-key
input value as part of a multipart form request to the above base url.
You can copy the API url with your key appended in the API keys section at the bottom of the Indexing page in the Conduit app.
An example query is:
curl 'https://indexing.conduit.xyz/v2/query?api-key=SECRET_KEY' \
-G \
--data-urlencode 'query=select "from", "to", tokens from transfer where chain = 8453 limit 1' \
--data-urlencode 'signatures=Transfer(address indexed from, address indexed to, uint tokens)' | jq .
The response would look like:
[
{
"cursor": "8453-30138481",
"columns": [
{
"name": "from",
"pgtype": "bytea"
},
{
"name": "to",
"pgtype": "bytea"
},
{
"name": "tokens",
"pgtype": "numeric"
}
],
"rows": [
[
"0x0000000000000000000000000000000000000000",
"0x0cf966857325db9a9b4dada66e80ce581c18aca1",
"0"
]
]
}
]
There is also an official Typescript SDK for Index Supply, which you can find here .