LogoLogo
  • OpenRank
    • Ranking and Reputation
    • Use Cases
  • The Reputation Stack
    • Data
    • OpenRank Protocol
    • Apps and Clients
  • Integrations
    • Farcaster
      • Openrank Scores Onchain
      • Ranking Strategies on Farcaster
      • Global Profile Ranking
        • 🔵Top Profiles (based on Following)
        • 🔵Top Profiles (based on Engagement)
        • 🟢Profile Rank (based on Following)
        • 🟢Profile Rank (based on Engagement)
      • Channel User Rankings
        • 🔵Top Profiles in Channel
        • 🟢Profile Rank in Channel
      • Personalized Network
        • Direct Network
          • 🟢Get Direct Following
          • 🟢Get Direct Engagement
        • Extended Network
          • 🟢Personalized Following
          • 🟢Personalized Engagement
      • Frames
        • 🔵Top Frames
        • 🟢Personalized Recommended Frames
      • Feeds
        • For You Feed
          • 🔵For You
          • 🔵For You (by Authorship)
        • Channel Feed
          • 🔵Channel Trending Casts
      • Metadata
        • 🟢Get FIDs for Addresses
        • 🟢Get Handles For Addresses
        • 🟢Get Addresses for FIDs
        • 🟢Get Addresses for Handles
      • Ideas to Build using OpenRank APIs
      • Neynar x OpenRank Guides (WIP)
        • Build "For You" Feeds for your Client, using Neynar and OpenRank
        • Build "User Search" using Neynar and OpenRanks' Global Ranking API
        • Build "Suggested follow list" based on OpenRank and Neynar
        • Build Channel Trending Feeds for your Client using Neynar and OpenRank APIs
        • Build "Discover New Users Feed" using Neynar and OpenRanks Global Ranking API
        • Build Power Badges for your Client using Global & Personalized Ranking APIs by OpenRank
        • Build "Sort Replies" on a cast using Neynar and OpenRanks' Global Ranking API
    • Clanker OpenRank Scores
    • Lens Protocol
      • Ranking Strategies on Lens
      • Lens Profile APIs
      • Lens Content APIs
      • Lens Profile Insights
    • Metamask SPD
    • Onchain Graphs and Feeds
    • Upcoming Integrations
    • GitHub Developers & Repo Ranking
  • Reputation Algorithms
    • EigenTrust
    • Hubs and Authorities
    • Latent Semantic Analysis
  • OpenRank SDK
    • Introduction
    • Creating your first reputation graph
    • Publishing Rankings with OpenRank SDK
    • Guides
      • Tipping based User Rankings powered by OpenRank
    • Installation
    • SDK References
      • EigenTrust
        • Installation and Use
        • Examples for using EigenTrust
      • Hubs & Authorities
        • Installation and Use
        • Examples for using Hubs & Authorities (Coming soon)
      • Latent Semantic Analysis (Coming soon)
Powered by GitBook
LogoLogo

SOCIALS

  • Github
  • Farcaster

Copyright 2024

On this page
  1. Integrations
  2. Lens Protocol

Lens Profile APIs

APIs for Profile Scores and Ranking

PreviousRanking Strategies on LensNextLens Content APIs

Last updated 1 year ago

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 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 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 interface —

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 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.

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.

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.

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

This endpoint requires a strategy parameter as described in the 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.

This endpoint requires a strategy parameter as described in the 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.

This endpoint requires a strategy parameter as described in the 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.

Tryout the APIs here! —

Scoring Strategies
Scoring Strategies
Scoring Strategies
https://openapi.lens.k3l.io
Scoring Strategies
https://openapi.lens.k3l.io
Scoring Strategies

Return a paginated list of all profile scores

get

Returns the global profile scores, ordered by the highest scoring profiles, according to a given strategy.

Query parameters
strategystringRequired

The strategy name to use such as 'followship', 'engagement', 'influencer', or 'creator'.

offsetintegerOptional

Return results starting from this offset position. Defaults to start at 0, the first result.

limitintegerOptional

Number of entries to return. Defaults to 50.

datestringOptional

A date, in YYYY-MM-DD format, for which to return the historic result. Defaults to the most recent date.

Responses
200
Query succeeded.
application/json
400
Invalid request, ex: wrong parameters.
application/json
500
Internal server error, not caused by issues with the request.
application/json
get
GET /profile/scores HTTP/1.1
Host: lens-api.k3l.io
Accept: */*
[
  {
    "id": 5,
    "handle": "stani.lens",
    "followersCount": 49371,
    "score": 0.06392881,
    "rank": 0
  }
]

Display a user's profile score

get

Returns the global profile score of a user based on a strategy.

Query parameters
strategystringRequired

The strategy name to use such as 'followship', 'engagement', 'influencer', or 'creator'.

handlestringRequired

The Lens profile handle (with or without the .lens extension).

datestringOptional

A date, in YYYY-MM-DD format, for which to return the historic result. Defaults to the most recent date.

Responses
200
Query succeeded.
application/json
400
Invalid request, ex: wrong parameters.
application/json
500
Internal server error, not caused by issues with the request.
application/json
get
GET /profile/score HTTP/1.1
Host: lens-api.k3l.io
Accept: */*
{
  "score": 1
}

All scores for a given list of users

get

Returns the global profile scores of a list of users, ordered by the highest scoring profiles, according to a given strategy.

Query parameters
strategystringRequired

The strategy name to use such as 'followship', 'engagement', 'influencer', or 'creator'.

handlesstringOptional

A list of comma separated profile handles (with or without the .lens extension).

datestringOptional

A date, in YYYY-MM-DD format, for which to return the historic result. Defaults to the most recent date.

Responses
200
Query succeeded.
application/json
400
Invalid request, ex: wrong parameters.
application/json
500
Internal server error, not caused by issues with the request.
application/json
get
GET /profile/scores_by_users HTTP/1.1
Host: lens-api.k3l.io
Accept: */*
[
  {
    "id": 5,
    "handle": "stani.lens",
    "followersCount": 49371,
    "score": 0.06392881,
    "rank": 0
  }
]

Return the total population size of profiles scored

get

Returns the number of profiles available for a given strategy.

As an example, this can be used to display the number of pages on a paginated dashboard.

Query parameters
strategystringRequired

The strategy name to use such as 'followship', 'engagement', 'influencer', or 'creator'.

datestringOptional

A date, in YYYY-MM-DD format, for which to return the historic result. Defaults to the most recent date.

Responses
200
Query succeeded.
application/json
400
Invalid request, ex: wrong parameters.
application/json
500
Internal server error, not caused by issues with the request.
application/json
get
GET /profile/count HTTP/1.1
Host: lens-api.k3l.io
Accept: */*
{
  "count": 1
}

Provide the ranked position of a given profile

get

Retrieves a particular profile's position ranked in relations to the result set of a strategy.

Query parameters
strategystringRequired

The strategy name to use such as 'followship', 'engagement', 'influencer', or 'creator'.

handlestringRequired

The Lens profile handle (with or without the .lens extension).

datestringOptional

A date, in YYYY-MM-DD format, for which to return the historic result. Defaults to the most recent date.

Responses
200
Query succeeded.
application/json
400
Invalid request, ex: wrong parameters.
application/json
500
Internal server error, not caused by issues with the request.
application/json
get
GET /profile/rank HTTP/1.1
Host: lens-api.k3l.io
Accept: */*
{
  "rank": 1
}
  • Profile Score
  • Profile Scores
  • Profile Scores by Users
  • Profile Count
  • Profile Rank
  • API Documentation
  • GETReturn a paginated list of all profile scores
  • GETDisplay a user's profile score
  • GETAll scores for a given list of users
  • GETReturn the total population size of profiles scored
  • GETProvide the ranked position of a given profile
Profile Scoring Strategies