Skip to content

Indexer Built‐in API

Peter edited this page Mar 20, 2024 · 1 revision

The indexer repository provides a built in API for querying the data that has been indexed.

API Endpoints - Data Retrieval

Data retrieval consists of hitting API endpoints with an on-chain address and a tax software format. The two main endpoints provided by the API for data retrieval are:

  1. /events.csv: provides a CSV file for a given tax software format
  2. /events.json: provides a JSON blob with rows for a given format

Address Usage Tracking

The API provides a built-in method for tracking usage of the API. This consists of:

  1. Pre-validation to determine which blockchain addresses should be added as a usage event
    • The pre-validation ensures that only addresses that have been indexed from the blockchain will be tracked. This will filter out noise or improper usage of the API.
  2. Database models for CSV and JSON API address usage.

The models for each API endpoint type consist of:

AddressUsage {
    Address
    RowsRetrieved
    Timestamp
}

This data can be used for determining:

  1. How often the API is called for an on-chain address
  2. How many rows are returned for a given address over time
  3. Overall usage of the API over a given time period