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_namespecifies which table to filter on. Possible values fortable_nameare given below. - Each
conditionis a key-value pair that has format<operator>:<field_name>=<value>. Multiple filter conditions are combined with&. optionis used to specify the number of records to return and/or the order in which to return them.
| Type | Format | Description |
|---|---|---|
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. |
option | size=<size> | size controls the number of records to return. The maximum is 100,000. The default is 100. |
option | sort=<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
The above request returns the 5 most recent token transfers made by wallet 0x004baeac693aac11dcd1d7139338d32fbd87898a.
Possible values for operator
operator| Operator | Type | Description |
|---|---|---|
eq | string, integer, double | The "equals to" operator. Used to retrieve records match a specific value of a field. |
gt | integer, double | The "greater than" operator. Use on numeric fields to retrieve records for which values are greater than a specific number. |
gte | integer, double | The "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. |
lt | integer,double | The "less than" operator. Use on numeric fields to retrieve records for which values are less than a specific number. |
lte | integer, double | The "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
table_nameThe possible values for table_name you can use are provided the Filter API reference here.
Possible values for field_name and value
field_name and valueAll 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.
