Skip to main content

Lens Protocol

Access Lens Protocol profiles, publications, followers, and social graph data.

Endpointsโ€‹

EndpointDescriptionPrice
GET /api/lens/{identifier}Profile lookup$0.01
GET /api/lens/{profileId}/publicationsUser posts$0.01
GET /api/lens/{profileId}/followersFollowers$0.01
GET /api/lens/{profileId}/followingFollowing$0.01
GET /api/lens/publication/{pubId}Single post$0.001

GET /api/lens/{identifier}โ€‹

Get Lens profile by handle, profile ID, or connected wallet.

Identifiersโ€‹

  • Handle: stani.lens or @stani
  • Profile ID: 0x01 (hex format)
  • Address: 0x... (connected wallet)
  • ENS: vitalik.eth (if connected to Lens)

Requestโ€‹

curl https://api.web3identity.com/api/lens/stani.lens

Responseโ€‹

{
"profileId": "0x05",
"handle": "stani.lens",
"displayName": "Stani",
"bio": "Building @LensProtocol @AaveAave",
"avatar": "https://lens-storage.io/...",
"coverPicture": "https://lens-storage.io/...",
"stats": {
"followers": 125000,
"following": 450,
"posts": 2340,
"comments": 8900,
"mirrors": 1200,
"collects": 45000
},
"ownedBy": "0x7241DDDec3A6aF367882eAF9651b87E1C7549Dff",
"isDefault": true,
"attributes": [
{ "key": "website", "value": "https://lens.xyz" },
{ "key": "twitter", "value": "StaniKulechov" }
],
"onChainIdentity": {
"ens": "stani.eth",
"worldcoin": true,
"sybilDotOrg": true
}
}

SDKโ€‹

const profile = await client.getLensProfile('stani.lens');

GET /api/lens/{profileId}/publicationsโ€‹

Get publications (posts, comments, mirrors) from a profile.

Query Parametersโ€‹

ParamTypeDefaultDescription
limitnumber25Max results (1-50)
cursorstringโ€”Pagination cursor
typestringallpost, comment, mirror, all

Requestโ€‹

curl "https://api.web3identity.com/api/lens/0x05/publications?type=post&limit=10"

Responseโ€‹

{
"publications": [
{
"id": "0x05-0x01",
"type": "post",
"content": "Excited to announce Lens V2...",
"createdAt": "2026-02-08T10:30:00Z",
"stats": {
"reactions": 5230,
"comments": 423,
"mirrors": 892,
"collects": 156
},
"metadata": {
"name": "Lens V2 Announcement",
"content": "Excited to announce...",
"media": [],
"tags": ["lens", "announcement"]
},
"collectModule": {
"type": "FreeCollectModule"
}
}
],
"pageInfo": {
"next": "eyJvZmZzZXQiOjEwfQ==",
"prev": null
}
}

GET /api/lens/{profileId}/followersโ€‹

Get profile followers.

Requestโ€‹

curl "https://api.web3identity.com/api/lens/0x05/followers?limit=50"

Responseโ€‹

{
"followers": [
{
"profileId": "0x0a",
"handle": "aave.lens",
"displayName": "Aave",
"avatar": "https://...",
"followedAt": "2023-05-15T00:00:00Z"
}
],
"total": 125000,
"pageInfo": {
"next": "eyJvZmZzZXQiOjUwfQ=="
}
}

GET /api/lens/publication/{pubId}โ€‹

Get a single publication by ID.

Requestโ€‹

curl https://api.web3identity.com/api/lens/publication/0x05-0x01

Responseโ€‹

{
"id": "0x05-0x01",
"type": "post",
"profile": {
"id": "0x05",
"handle": "stani.lens"
},
"content": "Excited to announce Lens V2...",
"createdAt": "2026-02-08T10:30:00Z",
"stats": {
"reactions": 5230,
"comments": 423,
"mirrors": 892,
"collects": 156
},
"reactions": [
{ "type": "UPVOTE", "count": 4800 },
{ "type": "LOVE", "count": 430 }
],
"referenceModule": null,
"collectModule": {
"type": "FreeCollectModule",
"contractAddress": "0x..."
}
}

GET /api/lens/searchโ€‹

Search for profiles or publications.

# Search profiles
curl "https://api.web3identity.com/api/lens/search?q=ethereum&type=profiles"

# Search publications
curl "https://api.web3identity.com/api/lens/search?q=defi&type=publications"

Responseโ€‹

{
"type": "profiles",
"results": [
{
"profileId": "0x12",
"handle": "ethereum.lens",
"displayName": "Ethereum",
"followers": 89000
}
],
"count": 25,
"total": 142
}

Social Graphโ€‹

GET /api/lens/{profileId}/mutualโ€‹

Find mutual followers between two profiles.

curl "https://api.web3identity.com/api/lens/0x05/mutual?with=0x0a"

GET /api/lens/{profileId}/following-statusโ€‹

Check if one profile follows another.

curl "https://api.web3identity.com/api/lens/0x05/following-status?target=0x0a"
{
"from": "0x05",
"to": "0x0a",
"follows": true,
"followedAt": "2023-05-15T00:00:00Z"
}

GET /api/lens/{handle}/connectedโ€‹

Find connected identities.

curl https://api.web3identity.com/api/lens/stani.lens/connected
{
"lens": {
"handle": "stani.lens",
"profileId": "0x05"
},
"ens": "stani.eth",
"farcaster": {
"fid": 1234,
"username": "stani"
},
"twitter": "StaniKulechov",
"wallets": [
"0x7241DDDec3A6aF367882eAF9651b87E1C7549Dff"
]
}

Collect Dataโ€‹

GET /api/lens/publication/{pubId}/collectorsโ€‹

Get who collected a publication.

curl "https://api.web3identity.com/api/lens/publication/0x05-0x01/collectors?limit=50"
{
"collectors": [
{
"profileId": "0x0a",
"handle": "alice.lens",
"collectedAt": "2026-02-08T12:00:00Z",
"transactionHash": "0x..."
}
],
"total": 156
}

SDK Examplesโ€‹

JavaScriptโ€‹

import { Web3IdentityClient } from '@web3identity/sdk';

const client = new Web3IdentityClient();

// Get profile
const profile = await client.getLensProfile('stani.lens');

// Get publications
const posts = await client.getLensPublications('0x05', {
type: 'post',
limit: 20
});

// Check following
const status = await client.getLensFollowingStatus('0x05', '0x0a');

Pythonโ€‹

from web3identity import Client

client = Client()

# Get profile
profile = client.get_lens_profile('stani.lens')

# Get followers
followers = client.get_lens_followers('0x05', limit=50)

Errorsโ€‹

CodeHTTPDescription
PROFILE_NOT_FOUND404Handle/ID doesn't exist
PUBLICATION_NOT_FOUND404Publication ID not found
INVALID_PROFILE_ID400Invalid hex profile ID