Lens Profile APIs

APIs for Profile Scores and Ranking

All profiles in the Lens ecosystem are scored and ranked every hour. The scores and rankings are then made available through 5 different APIs that clients can call depending on their use case.

For details on each strategy ID, see Profile Scoring Strategies

Profile Score

Purpose: Retrieve a single profile score on the Lens ecosystem

The /profile/score endpoint retrieves a single profile score. Each profile score ranges between 0 and 1, with 0 being the lowest score and 1 being the highest score.

This endpoint requires a strategy parameter as described in the Scoring Strategies section. This strategy simplifies the developer experience abstracting away the EigenTrust Local-Trust and Pre-Trust strategies. Each strategy is pre-computed on a daily basis and applied to each Lens profile.

By using the date parameter, you can choose a particular day when the strategies were generated. This is helpful to get a snapshot in time of where each profile scores and ranks are, to help develop time series metrics dashboards for each profile to see how their scores trend over time.

You can try out this API at this OpenAPI interfacehttps://openapi.lens.k3l.io

Profile Scores

Purpose: Retrieve a list of global profile scores on the Lens ecosystem

The /profile/scores endpoint retrieves a list of numeric profile scores and ranks in relations with all other profiles, ordered by the highest score. Each profile score ranges between 0 and 1, with 0 being the lowest score and 1 being the highest score.

This endpoint also returns a rank position, starting with 1 as the top-ranked profile calculated for the day, and n being the lowest ranked, with n being the number of profiles included in the converged scoring calculations for the day.

This endpoint requires a strategy parameter as described in the Scoring Strategies section. This strategy simplifies the developer experience abstracting away the EigenTrust Local-Trust and Pre-Trust strategies. Each strategy is pre-computed on a daily basis and applied to each Lens profile.

The results returned are paginated to 50 profiles per response by default. This can be managed with a limit parameter with pagination alongside an offset parameter (first record at offset position 0). To help with pagination, you can use the Profile Count endpoint to retrieve the total number of profiles available.

By using the date parameter, you can choose a particular day when the strategies were generated. This is helpful to get a snapshot in time of where each profile scores and ranks are, to help develop time series metrics dashboards for each profile to see how their scores trend over time.

Profile Scores by Users

Purpose: Retrieve a list of global profile scores of a subset of users in the Lens ecosystem.

The /profile/scores_by_users endpoint retrieves a list of profile scores of a subset of users requested, and it will return with profile scores ranked in relations with all other profiles, ordered by the highest score. Each profile score ranges between 0 and 1, with 0 being the lowest score and 1 being the highest score.

This endpoint also returns a rank position, starting with 1 as the top-ranked profile calculated for the day, and n being the lowest ranked, with n being the number of profiles included in the converged scoring calculations for the day.

This endpoint requires a strategy parameter as described in the Scoring Strategies section. This strategy simplifies the developer experience abstracting away the EigenTrust Local-Trust and Pre-Trust strategies. Each strategy is pre-computed on a daily basis and applied to each Lens profile.

The results returned are paginated to 50 profiles per response by default. This can be managed with a limit parameter with pagination alongside an offset parameter (first record at offset position 0). To help with pagination, you can use the Profile Count endpoint to retrieve the total number of profiles available.

By using the date parameter, you can choose a particular day when the strategies were generated. This is helpful to get a snapshot in time of where each profile scores and ranks are, to help develop time series metrics dashboards for each profile to see how their scores trend over time.

Profile Count

Purpose: Retrieve the total number of profiles found on the Lens ecosystem

This /profile/count endpoint retrieves the total number of profiles scored for a particular strategy. The returned value is an unsigned integer.

This endpoint requires a strategy parameter as described in the Scoring Strategies section. This strategy simplifies the developer experience abstracting away the EigenTrust Local-Trust and Pre-Trust strategies. Each strategy is pre-computed on a daily basis and applied to each Lens profile.

There's a option to choose a particular day of how many profiles are available when the strategies were generated using the date parameter.

Profile Rank

Purpose: Retrieve a profile's score position, in relations to all other profiles, on the Lens ecosystem

This /profile/rank endpoint retrieves a particular profile's score position (ranked) for a particular strategy, in relations to all the other profiles in the Lens ecosystem. The returned value is an unsigned integer starting with 1.

This endpoint requires a strategy parameter as described in the Scoring Strategies section. This strategy simplifies the developer experience abstracting away the EigenTrust Local-Trust and Pre-Trust strategies. Each strategy is pre-computed on a daily basis and applied to each Lens profile.

There's a option to choose a particular day of how many profiles are available when the strategies were generated using the date parameter.

API Documentation

Tryout the APIs here! — https://openapi.lens.k3l.io

Last updated

Logo

Copyright 2024