Guides

Profile Interests

Lens Profile owners can set their interests so that the experience layer can filter and provide content that is more relevant and engaging to their audience.

The Lens API supports the following interests categories, and subcategories:

  • Arts & Entertainment
    • Books & Literature
    • Art
    • Design
    • Photography
    • Fashion
    • Anime
    • Memes
    • Film & TV
    • Music
  • Business
    • Creator Economy
    • Finance
    • Marketing
  • Technology
    • AI & ML
    • Science
    • Programming
    • Tools
    • Biotech
  • Health & Fitness
    • Exercise
    • Biohacking
  • Food & Drink
    • Restaurants
    • Cooking
    • Cocktails
    • Beer
    • Wine
  • Hobbies & Interests
    • Arts & Crafts
    • Gaming
    • Travel
    • Collecting
    • Sports
    • Cars
  • News
  • Family & Parenting
  • Education
  • Career
  • Home & Garden
    • Nature
    • Animals
    • Home Improvement
    • Gardening
  • Law, Government and Politics
    • Regulation
  • Crypto
    • NFT
    • DeFi
    • Web3
    • Web3 Social
    • Governance
    • DAOs
    • gm
    • Metaverse
    • Rekt
    • Ethereum
    • Bitcoin
    • L1s
    • L2s
    • Scaling
  • Lens
  • NSFW

Keep in mind that profile interests are offchain and will be used only to curate the way that API serves content.

In addition, the API wants to stay unopinionated in terms of i18n and of how you choose to display interests to your users, so all interests are returned in english capitalised format, words are separated with underscore _ and subcategories with double underscore __.

Fetch a Profile's Interests

Request

A profile's interests are available on the Profile type as profileInterests. This means you can access this information on any method that returns a Profile object.

Here is an example of how to query the onchain identity of a profile on the profile method.

  • profileId: string (required)
    • The identifier of the profile to fetch the interests for.

Invocation

const { profileInterests } = await lensClient.profile.fetch({
  profileId: "PROFILE_ID",
})
query Profile {
  profile(request: { profileId: "PROFILE_ID" }) {
    profileInterests
  }
}

Response

{
  // ... other profile fields omitted
  "profileInterests": [
    "ART_ENTERTAINMENT",
    "ART_ENTERTAINMENT__BOOKS",
    "ART_ENTERTAINMENT__ART",
    "ART_ENTERTAINMENT__DESIGN",
    "ART_ENTERTAINMENT__PHOTOGRAPHY",
    "ART_ENTERTAINMENT__FASHION",
    "ART_ENTERTAINMENT__ANIME",
    "ART_ENTERTAINMENT__MEMES",
    "ART_ENTERTAINMENT__FILM_TV",
    "ART_ENTERTAINMENT__MUSIC",
    "BUSINESS",
    "BUSINESS__CREATOR_ECONOMY",
    "BUSINESS__FINANCE",
    "BUSINESS__MARKETING",
    "TECHNOLOGY",
    "TECHNOLOGY__AI_ML",
    "TECHNOLOGY__SCIENCE",
    "TECHNOLOGY__PROGRAMMING",
    "TECHNOLOGY__TOOLS",
    "TECHNOLOGY__BIOTECH",
    "CAREER",
    "EDUCATION",
    "FAMILY_PARENTING",
    "HEALTH_FITNESS",
    "HEALTH_FITNESS__EXERCISE"
  ]
}

Add Interests to a Profile

Profiles can have up to 12 interests at this time. The call must be authorized and the interests will be added to the authenticated profile.

Request

  • interests: string[] (required)
    • The interests to add to the profile.

Invocation

await lensClient.profile.addInterests({
  profileId: "PROFILE_ID",
  interests: ["NFTS"],
})
mutation AddProfileInterest {
  addProfileInterests(request: { interests: ["NFTS"] })
}

Response

Will return null if successful, otherwise error.

Remove Interests From a Profile

This call must be authorized and the interests will be removed from the authenticated profile.

Request

  • interests: string[] (required)
    • The interests to remove from the profile.

Invocation

await lensClient.profile.removeInterests({
  profileId: "PROFILE_ID",
  interests: ["NFTS"],
})
mutation RemoveProfileInterest {
  removeProfileInterests(request: { profileId: "0x01", interests: ["NFTS"] })
}

Full Lens Client Example

// add interests
await lensClient.profile.addInterests({
  interests: ["NFTS"],
})

// fetch all interests
const { interests } = await lensClient.profile.fetch({
  profileId: "PROFILE_ID",
})

console.log(`Profile interests`, interests)

// remove interests
await lensClient.profile.removeInterests({
  interests: ["NFTS"],
})

πŸ“˜

Profile Interests: GraphQL API Examples

Add Interests
Remove Interests