Skip to main content

Overview

API Endpoints​

  • /api/v1/data/{topic}: Query historical data for a specific topic.
  • /api/v1/count/{topic}: Count number of events for a specific topic.

Topic Structure​

{author}.{connector}.{version}.{event_name}

Query Parameters​

  • limit (default: 100, min: 1, max: 1000): Retrieve a desired number of records.
  • offset (min: 0): Skip a certain number of records at the beginning before retrieving results.
  • order (default: desc, options: asc | desc): Control the sorting order of results. By default, entries are sorted by timestamp (newest first) in descending order. Use asc for oldest first.
  • format (default: json, options: json | raw): Choose the format for your returned data.

Data Filtering​

You can define a filter on the returned data with the following format:

(field_name)=(operator):(value)
  • field_name: The name of the field you want to filter by.
  • operator: A comparison operator. Supported operators include:
    • eq: Equal to (eq operator can be omitted).
    • ne: Not equal to.
    • gt: Greater than.
    • lt: Less than.
    • gte: Greater than or equal to.
    • lte: Less than or equal to.
  • value: The value to compare the field with.

Examples​

Retrieve the next 100 entries, skipping the first 100 and sorted by timestamp in ascending order:

https://api.starbloom.ai/api/v1/data/{author}.{connector}.{version}.{event_name}?limit=100&offset=100&order=asc

Find records with a specific block number range:

https://api.starbloom.ai/api/v1/data/{author}.{connector}.{version}.{event_name}?block_number=gte:3888220&block_number=lte:3888330

Find records with a specific transaction hash:

https://api.starbloom.ai/api/v1/data/{author}.{connector}.{version}.{event_name}?tx_hash=0xe8dae4c80b91283649a0a3622a8af7ca7c273d21a43b693c3ca838593da02b90

Retrieve records within a specific timestamp range:

https://api.starbloom.ai/api/v1/data/{author}.{connector}.{version}.{event_name}?ts=gte:2024-07-17T08:27:15.000000000Z&ts=lt:2024-07-17T08:51:53.000000000Z

Escaping Field Names​

If a field name conflicts with special keywords (api_key, limit, offset, order, format), you can escape it using the $ character.

https://api.starbloom.ai/api/v1/data/{topic}?$limit=100