API Reference

How to use the Filter API

Method: GET

Endpoint: https://api.syve.ai/v1/filter-api

The format of a Filter API request is:

curl -X GET '<endpoint>/<table_name>?<condition_1>&...&<condition_n>&<option>'
  • Here table_name specifies which table to filter on. Possible values for table_name are given below.
  • Each condition is a key-value pair that has format <operator>:<field_name>=<value>. Multiple filter conditions are combined with &.
  • option is used to specify the number of records to return and/or the order in which to return them.
TypeFormatDescription
condition<operator>:<field_name>=<value>operator is used to specify how to filter.

field_name specifies the field to filter on.

value is the value to filter on.
optionsize=<size>size controls the number of records to return. The maximum is 100,000. The default is 100.
optionsort=<sort>sort is the time order in which to return records. If desc most recent records are returned first. If asc older records are returned first.

Example

Request: https://api.syve.ai/v1/filter-api/erc20?eq:from_address=0x004baeac693aac11dcd1d7139338d32fbd87898a&size=5&sort=desc

The above request returns the 5 most recent token transfers made by wallet 0x004baeac693aac11dcd1d7139338d32fbd87898a.

Possible values for operator

OperatorTypeDescription
eqstring, integer, doubleThe "equals to" operator. Used to retrieve records match a specific value of a field.
gtinteger, doubleThe "greater than" operator. Use on numeric fields to retrieve records for which values are greater than a specific number.
gteinteger, doubleThe "greater than or equal to" operator. Use on numeric fields to retrieve records for which values are greater than or equal to a specific number.
ltinteger,doubleThe "less than" operator. Use on numeric fields to retrieve records for which values are less than a specific number.
lteinteger, doubleThe "less than or equal to" operator. Use on numeric fields to retrieve records for which values are less than or equal to a specific number.

Possible values for table_name

The possible values for table_name you can use are provided the Filter API reference here.

Possible values for field_name and value

All fields of a table can be filtered on. The possible values of field_name are the fields of the selected table_name. An overview of all tables and their fields is given here.

The possible values for value depend on the type of field_name. If the field_name is numeric then value must be integer or double. If field_name is textual: value must be of type string.