limit and offset.
Pagination limits and page size
Rated API v1 uses offset based pagination through thelimit and offset parameters. Both parameters accept an existing object ID value (see below) and return objects in chronological order. The limit parameter specifies how many records to fetch per page. The offset parameter indicates where to start fetching data or how many records to skip, defining the initial position within the list.
See details on the parameters below:
In the response, you will get the total number of
pages which signifies how many pages of data we have for the requested information.
For example, if you call https://api.rated.network/v1/eth/entities/Lido/effectiveness?entityType=pool&sortOrder=desc you will get about 120 pages of data which signifies about 1,200 days worth of data.
Example of a paginated response
Example of a paginated response
previous and next URLs. Just use the URL in next to continue fetching the rest of the data. You will also get a url in previous as you navigate throught pages 2,3,4… and so on. When there’s no more data left, the Rated API will stop giving you the link and show next: null.
Sorting and Filters
We have also introduced the ability to sort the response based on the day or date. You can use the sorting parameterssortBy and sortOrder to retrieve the response in chronological or reverse chronological order.
See details on the parameters below:
Additionally, you can filter what date range you wish to get your response for using the
fromDate and toDate or fromDay and toDay query parameters. To see how time works, head here for Ethereum.
See details on the parameters below:
Depending on the endpoint and time window aggregations you set using
granularity, the response will contain a list of items with startDate, endDate, fromDay and EndDay that collectively correspond to the filter you applied over a particular granularity.
See details on the parameters below:
For example, if you call
https://api.rated.network/v1/eth/entities/Lido/effectiveness?fromDate=2024-03-01&toDate=2024-03-31&granularity=week&entityType=pool&limit=2 you will get a paginated list of two items per page, with weekly aggregates of effectiveness for Lido (pool) from 1st March 2024 to 31st March 2024 with weekly start date/day and end date/day.
Example of a filtered response
Example of a filtered response