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 Content APIs

APIs for Content Recommendations

Posts by profiles are scored (value between 0 and 1), classified (recommendable, maybe recommendable, not recommendable) and ranked every hour. The posts can then be retrieved by clients through any of the following 4 APIs.

As an example, the /feed endpoint returns a JSON array of posts using the Popular algorithm as a default algorithm. To choose a different algorithm, specify the algorithm as a path parameter.

Let's walk through all the Global and Personalized content feed recommendation APIs next.

Global Feed

As for generalized (non-personalized) feed of posts according to each algorithm, we now have the following pre-computed algorithms. These algorithms are:

  • /feed/recent to choose the Recent algorithm.

  • /feed/popular to explicitly choose the Popular algorithm.

  • /feed/recommended to choose the Recommended algorithm.

  • /feed/crowdsourced to choose the Crowdsourced algorithm.

In addition to the algorithm path parameter, the endpoint also takes an optional limit query parameter. All the algorithms return a max of 100 posts. To get a smaller set of posts, specify the limit parameter. Example: /feed/recent?limit=10

Personalized Feed

Personalized content feed algorithms are meant to generate lists of posts that are most relevant to each user. These algorithms crawl a user's social graph and activity when recommending posts. There's a time decay element in this as well.

These algorithm deployed is:

  • /feed/personal/{profile}/following which uses the Following strategy

In addition to the algorithm path parameter, the endpoint also takes an optional limit query parameter. All the algorithms return a max of 100 posts. To get a smaller set of posts, specify the limit parameter. Example: /feed/personal/karma3labs.lens/following?limit=10

API Documentation

PreviousLens Profile APIsNextLens Profile Insights

Last updated 1 year ago

Tryout the APIs here! โ€”

You can try out this API at this OpenAPI interface โ€”

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

Personalized content feed

get

Returns a list of posts based on a strategy that is personalized for the given profile.

Path parameters
profilestringRequired

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

strategystring ยท enumRequired

The strategy name to use such as 'following'.

Possible values:
Query parameters
limitintegerOptional

Number of entries to return. Defaults to 100.

offsetintegerOptional

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

languagestringOptional

The language of the posts to be retrieved.

rankLimitintegerOptional

Limite to top N ranked profiles. Defaults to 10000.

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 /feed/personal/{profile}/{strategy} HTTP/1.1
Host: lens-api.k3l.io
Accept: */*
[
  {
    "postId": "0x05-0x1e5a-DA-76b7ad36",
    "handle": "stani.lens",
    "mirrorsCount": 0,
    "commentsCount": 10,
    "collectsCount": 0,
    "upvotesCount": 57,
    "v": 0.8563457328149917,
    "createdAt": "2023-06-13T17:38:04.000Z",
    "contentUri": "ar://-aYLr71AMyMnjtvjq0daDWDg3SrDytTWPMd4GMw8W98"
  }
]

Non-personalized content feed

get

Returns a list of posts based on a strategy that is not personalized.

Path parameters
strategystring ยท enumRequired

The strategy name to use such as 'recent', 'popular', 'recommended', or 'crowdsourced'.

Possible values:
Query parameters
limitintegerOptional

Number of entries to return. Defaults to 100.

offsetintegerOptional

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

languagestringOptional

The language of the posts to be retrieved.

rankLimitintegerOptional

Limite to top N ranked profiles. Defaults to 10000.

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 /feed/{strategy} HTTP/1.1
Host: lens-api.k3l.io
Accept: */*
[
  {
    "postId": "0x05-0x1e5a-DA-76b7ad36",
    "handle": "stani.lens",
    "mirrorsCount": 0,
    "commentsCount": 10,
    "collectsCount": 0,
    "upvotesCount": 57,
    "v": 0.8563457328149917,
    "createdAt": "2023-06-13T17:38:04.000Z",
    "contentUri": "ar://-aYLr71AMyMnjtvjq0daDWDg3SrDytTWPMd4GMw8W98"
  }
]
  • Global Feed
  • Personalized Feed
  • API Documentation
  • GETPersonalized content feed
  • GETNon-personalized content feed