Skip to main content
Version: V1

Rankings

Rankings API is used for querying a ranked list of addresses on the blockchain network. You can retrieve a ranked list of users and their identities based on different connection types and different namespaces.

Definition

The definition of rankings query is:

rankings (network: Network, type: ConnectionType, namespaces: [String!], first: Int, after: String) [UserIdentityPage]!

For input params:

FieldTypeDescriptionRequired/Optional
networkNetworkThe blockchain network for the queried address.Optional. Default value is ETH.
typeConnectionTypeInput the connection type that serves as the basis of this ranking. You can use FOLLOW, LIKE, REPORT, WATCH, or VOTE.Optional. Default value is FOLLOW.
namespaces[String!]Rankings in several namespaces.Optional. Default value is [] which gets rank in global
firstIntInput the number of entries this query should return.Optional. Default is 20 and the maximum value is 50.
afterStringInput after which index this query should begin.Optional. Default value is -1.

For the usage of namespaces, please refer to Namespace section for more instructions. For the usage of first and after, please refer to Pagination section. For the concept of connection types, please read Connection section.

With correct inputs, you can retrieve a UserIdentityPage objects with the following fields:

FieldTypeDescription
pageInfoPageInfoOutput page information, including startCursor, endCursor, whether this page hasNextPage, and whether this page hasPreviousPage.
list[UserIdentity]Output a ranked list of user identities.

For the fields of a UserIdentity object, please refer to Identity section.

Example

In the following example, we demonstrate how to query information about the top five Ethereum addresses with the most followers under the CyberConnect namespace. You can play around with Rankings API in the Playground section.

query TopFiveRankings{
rankings(network: ETH, type: FOLLOW, namespaces: ["CyberConnect"], first: 5) {
pageInfo {
startCursor
endCursor
hasNextPage
hasPreviousPage
}
list {
address
domain
followerCount
}
}
}
Designed by