đLens Following
Learn how to fetch Lens following data and its various use cases and combinations.
đ Lens Following
Airstack provides easy-to-use APIs for enriching Lens applications and integrating on-chain and off-chain data with Lens.
Table Of Contents
In this guide you will learn how to use Airstack to:
Pre-requisites
An Airstack account
Basic knowledge of GraphQL
Get Started
JavaScript/TypeScript/Python
If you are using JavaScript/TypeScript or Python, Install the Airstack SDK:
React
npm install @airstack/airstack-react
Node
npm install @airstack/node
React
yarn add @airstack/airstack-react
Node
yarn add @airstack/node
React
pnpm install @airstack/airstack-react
Node
pnpm install @airstack/node
pip install airstack
Then, add the following snippets to your code:
import { init, useQuery } from "@airstack/airstack-react";
init("YOUR_AIRSTACK_API_KEY");
const query = `YOUR_QUERY`; // Replace with GraphQL Query
const Component = () => {
const { data, loading, error } = useQuery(query);
if (data) {
return <p>Data: {JSON.stringify(data)}</p>;
}
if (loading) {
return <p>Loading...</p>;
}
if (error) {
return <p>Error: {error.message}</p>;
}
};
import { init, fetchQuery } from "@airstack/node";
init("YOUR_AIRSTACK_API_KEY");
const query = `YOUR_QUERY`; // Replace with GraphQL Query
const { data, error } = await fetchQuery(query);
console.log("data:", data);
console.log("error:", error);
import asyncio
from airstack.execute_query import AirstackClient
api_client = AirstackClient(api_key="YOUR_AIRSTACK_API_KEY")
query = """YOUR_QUERY""" # Replace with GraphQL Query
async def main():
execute_query_client = api_client.create_execute_query_object(
query=query)
query_response = await execute_query_client.execute_query()
print(query_response.data)
asyncio.run(main())
Other Programming Languages
To access the Airstack APIs in other languages, you can use https://api.airstack.xyz/gql as your GraphQL endpoint.
đ¤ AI Natural Languageâ
Airstack provides an AI solution for you to build GraphQL queries to fulfill your use case easily. You can find the AI prompt of each query in the demo's caption or title for yourself to try.
Get Lens Following of Lens Profile(s)
You can get the list of Lens following of Lens profile(s) by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {
filter: {
dappName: { _eq: lens }
identity: {
_in: [
"lens/@stani"
"lens_id:0x024"
"vitalik.eth"
"0xeaf55242a90bb3289dB8184772b0B98562053559"
]
}
}
blockchain: ALL
limit: 200
}
) {
Following {
followingAddress {
addresses
socials(input: { filter: { dappName: { _eq: lens } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: { filter: { dappName: { _eq: lens } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": [
"0x008b1ffe244bf31896c833bff4ad9009e7a0f4eb"
],
"socials": [
{
"profileName": "lens/@yummy",
"profileTokenId": "47982",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@abertog",
"profileTokenId": "3568",
"profileTokenIdHex": ""
}
]
},
"followingProfileId": "3568",
"followerAddress": {
"addresses": [
"0x8ec94086a724cbec4d37097b8792ce99cadcd520"
],
"domains": [
{
"name": "tiktoktopmoments.eth"
},
{
"name": "crimsonchin.eth"
},
{
"name": "levelsdigital.eth"
},
{
"name": "saintevie.eth"
},
{
"name": "bradorbradley.eth"
}
],
"socials": [
{
"profileName": "lens/@westlakevillage",
"profileTokenId": "99755",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@brad",
"profileTokenId": "116598",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@bradorbradley",
"profileTokenId": "36",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@hanimourra",
"profileTokenId": "116239",
"profileTokenIdHex": ""
}
]
},
"followerProfileId": "36",
"followerTokenId": "245"
},
// more following
]
}
}
}
Check If User(s) is Following A Given Lens Profile on Lens
You can use Airstack to check if user(s) is following a given Lens profile on Lens protocol.
This can be done by providing the given Lens profile on the Wallet
top-level query's identity
input and the user(s) in the socialFollowings
:
Try Demo
Code
query isFollowing {
Wallet(input: {identity: "lens/@shnoodles", blockchain: ethereum}) {
socialFollowings( # Check if these user identities is following lens/@shnoodles on Lens
input: {filter: {identity: {_in: ["0xeaf55242a90bb3289dB8184772b0B98562053559", "betashop.eth", "yosephks.cb.id", "lens/@deepesh", "lens_id:100275", "fc_fname:dawufi", "fc_fid:602"]}, dappName: {_eq: lens}}}
) {
Following {
dappName
dappSlug
followingProfileId
followerProfileId
followerAddress {
addresses
socials {
profileName
}
domains {
name
}
}
}
}
}
}
{
"data": {
"Wallet": {
"socialFollowings": {
"Following": [
{
"dappName": "lens",
"dappSlug": "lens_polygon",
"followingProfileId": "27561",
"followerProfileId": "122312",
"followerAddress": {
"addresses": [
"0x0964256674e42d61f0ff84097e28f65311786ccb"
],
"socials": [
{
"profileName": "lens/@dawufi" // lens/@dawufi is following ipeciura.eth's on Lens
},
{
"profileName": "dawufi"
}
],
"domains": [
{
"name": "cantos.testbrand.eth"
},
{
"name": "dawufi.eth"
}
]
}
}
]
}
}
}
}
If any of the user is following lens/@shnoodles
on Lens, then it will appear as a response in the Following
array as shown in the sample response.
Get The Most Recent Lens Following of Lens Profile(s)
You can get the list of most recent Lens following of Lens profile(s) by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {
filter: {
dappName: { _eq: lens }
identity: {
_in: [
"lens/@stani"
"lens_id:0x024"
"vitalik.eth"
"0xeaf55242a90bb3289dB8184772b0B98562053559"
]
}
}
blockchain: ALL
limit: 200
order: { followingSince: DESC }
}
) {
Following {
followingAddress {
addresses
socials(input: { filter: { dappName: { _eq: lens } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: { filter: { dappName: { _eq: lens } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": ["0x6db4d0682d7d7bb68bd00c774dbdd05b91925c13"],
"socials": [
{
"profileName": "lens/@unlonely",
"profileTokenId": "120779",
"profileTokenIdHex": ""
}
]
},
"followingProfileId": "120779",
"followerAddress": {
"addresses": ["0x8ec94086a724cbec4d37097b8792ce99cadcd520"],
"domains": [
{
"name": "tiktoktopmoments.eth"
},
{
"name": "crimsonchin.eth"
},
{
"name": "levelsdigital.eth"
},
{
"name": "saintevie.eth"
},
{
"name": "bradorbradley.eth"
}
],
"socials": [
{
"profileName": "lens/@westlakevillage",
"profileTokenId": "99755",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@brad",
"profileTokenId": "116598",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@bradorbradley",
"profileTokenId": "36",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@hanimourra",
"profileTokenId": "116239",
"profileTokenIdHex": ""
}
]
},
"followerProfileId": "36",
"followerTokenId": "68"
}
// more following
]
}
}
}
Get The Earliest Lens Following of Lens Profile(s)
You can get the list of the earliest Lens following of Lens profile(s) by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {
filter: {
dappName: { _eq: lens }
identity: {
_in: [
"lens/@stani"
"lens_id:0x024"
"vitalik.eth"
"0xeaf55242a90bb3289dB8184772b0B98562053559"
]
}
}
blockchain: ALL
limit: 200
order: { followingSince: ASC }
}
) {
Following {
followingAddress {
addresses
socials(input: { filter: { dappName: { _eq: lens } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: { filter: { dappName: { _eq: lens } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": ["0x6db4d0682d7d7bb68bd00c774dbdd05b91925c13"],
"socials": [
{
"profileName": "lens/@unlonely",
"profileTokenId": "120779",
"profileTokenIdHex": ""
}
]
},
"followingProfileId": "120779",
"followerAddress": {
"addresses": ["0x8ec94086a724cbec4d37097b8792ce99cadcd520"],
"domains": [
{
"name": "tiktoktopmoments.eth"
},
{
"name": "crimsonchin.eth"
},
{
"name": "levelsdigital.eth"
},
{
"name": "saintevie.eth"
},
{
"name": "bradorbradley.eth"
}
],
"socials": [
{
"profileName": "lens/@westlakevillage",
"profileTokenId": "99755",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@brad",
"profileTokenId": "116598",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@bradorbradley",
"profileTokenId": "36",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@hanimourra",
"profileTokenId": "116239",
"profileTokenIdHex": ""
}
]
},
"followerProfileId": "36",
"followerTokenId": "68"
}
// more following
]
}
}
}
Get Lens Following of Lens Profile(s) that has ENS Domain
You can get the list of Lens following of Lens profile(s) and check if they have any ENS domain by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {filter: {dappName: {_eq: lens}, identity: {_in: ["lens/@stani", "lens_id:0x024", "vitalik.eth", "0xeaf55242a90bb3289dB8184772b0B98562053559"]}}, blockchain: ALL, limit: 200}
) {
Following {
followingAddress {
addresses
domains { # Show all domains owned by followers
name
isPrimary
}
socials(input: {filter: {dappName: {_eq: lens}}}) {
profileName
profileTokenId
profileTokenIdHex
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: {filter: {dappName: {_eq: lens}}}) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": ["0x008b1ffe244bf31896c833bff4ad9009e7a0f4eb"],
"domains": [
{
"name": "abertog.eth",
"isPrimary": true
},
{
"name": "bertomeu.eth",
"isPrimary": false
}
],
"socials": [
{
"profileName": "lens/@yummy",
"profileTokenId": "47982",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@abertog",
"profileTokenId": "3568",
"profileTokenIdHex": ""
}
]
},
"followingProfileId": "3568",
"followerAddress": {
"addresses": ["0x8ec94086a724cbec4d37097b8792ce99cadcd520"],
"domains": [
{
"name": "tiktoktopmoments.eth"
},
{
"name": "crimsonchin.eth"
},
{
"name": "levelsdigital.eth"
},
{
"name": "saintevie.eth"
},
{
"name": "bradorbradley.eth"
}
],
"socials": [
{
"profileName": "lens/@westlakevillage",
"profileTokenId": "99755",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@brad",
"profileTokenId": "116598",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@bradorbradley",
"profileTokenId": "36",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@hanimourra",
"profileTokenId": "116239",
"profileTokenIdHex": ""
}
]
},
"followerProfileId": "36",
"followerTokenId": "245"
}
// more following
]
}
}
}
You can use the followingAddress.domains
that will return an array to see if there's any domain owned by the following.
If the length of the followingAddress.domains
array is non-zero, then the following has at least one ENS domain. Otherwise, it does not have any ENS domain.
Get Lens Following of Lens Profile(s) that has XMTP Enabled
You can get the list of Lens following of Lens profile(s) and check if they have XMTP enabled by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {filter: {dappName: {_eq: lens}, identity: {_in: ["lens/@stani", "lens_id:0x024", "vitalik.eth", "0xeaf55242a90bb3289dB8184772b0B98562053559"]}}, blockchain: ALL, limit: 200}
) {
Following {
followingAddress {
addresses
socials(input: {filter: {dappName: {_eq: lens}}}) {
profileName
profileTokenId
profileTokenIdHex
}
xmtp {
isXMTPEnabled # Indicate if following have XMTP enabled
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: {filter: {dappName: {_eq: lens}}}) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": [
"0x008b1ffe244bf31896c833bff4ad9009e7a0f4eb"
],
"socials": [
{
"profileName": "lens/@yummy",
"profileTokenId": "47982",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@abertog",
"profileTokenId": "3568",
"profileTokenIdHex": ""
}
],
"xmtp": [
{
"isXMTPEnabled": true // have XMTP enabled
}
]
},
"followingProfileId": "3568",
"followerAddress": {
"addresses": [
"0x8ec94086a724cbec4d37097b8792ce99cadcd520"
],
"domains": [
{
"name": "tiktoktopmoments.eth"
},
{
"name": "crimsonchin.eth"
},
{
"name": "levelsdigital.eth"
},
{
"name": "saintevie.eth"
},
{
"name": "bradorbradley.eth"
}
],
"socials": [
{
"profileName": "lens/@westlakevillage",
"profileTokenId": "99755",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@brad",
"profileTokenId": "116598",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@bradorbradley",
"profileTokenId": "36",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@hanimourra",
"profileTokenId": "116239",
"profileTokenIdHex": ""
}
]
},
"followerProfileId": "36",
"followerTokenId": "245"
},
// more following
]
}
}
}
Get Lens Profiles that have a certain amount of Following
You can get all the Lens profiles that have a certain amount of following, e.g. more than or equal to 1000 following counts on Lens:
Try Demo
Code
query MyQuery {
Socials(
input: {filter: {followingCount: {_gte: 1000}, dappName: {_eq: lens}}, blockchain: ethereum, limit: 200}
) {
Social {
profileName
profileTokenId
profileTokenIdHex
followingCount # Total following count
}
}
}
{
"data": {
"Socials": {
"Social": [
{
"profileName": "lens/@thedogist",
"profileTokenId": "45164",
"profileTokenIdHex": "0x0b06c",
"followingCount": 10507
},
{
"profileName": "lens/@9xkiwi",
"profileTokenId": "961",
"profileTokenIdHex": "0x03c1",
"followingCount": 4930
},
{
"profileName": "lens/@eth666",
"profileTokenId": "17693",
"profileTokenIdHex": "0x0451d",
"followingCount": 1165
}
]
}
}
}
Get Lens and Farcaster Following of Lens Profile(s)
You can get the list of Lens and Farcaster following of Lens profile(s) by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {
filter: {
identity: {
_in: [
"lens/@stani"
"lens_id:0x024"
"vitalik.eth"
"0xeaf55242a90bb3289dB8184772b0B98562053559"
]
}
}
blockchain: ALL
limit: 200
}
) {
Following {
followingAddress {
addresses
socials {
dappName
profileName
profileTokenId
profileTokenIdHex
userId
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: { filter: { dappName: { _eq: lens } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": ["0x008b1ffe244bf31896c833bff4ad9009e7a0f4eb"],
"socials": [
{
"dappName": "lens",
"profileName": "lens/@yummy",
"profileTokenId": "47982",
"profileTokenIdHex": "",
"userId": "0x008b1ffe244bf31896c833bff4ad9009e7a0f4eb"
},
{
"dappName": "lens",
"profileName": "lens/@abertog",
"profileTokenId": "3568",
"profileTokenIdHex": "",
"userId": "0x008b1ffe244bf31896c833bff4ad9009e7a0f4eb"
}
]
},
"followingProfileId": "3568",
"followerAddress": {
"addresses": ["0x8ec94086a724cbec4d37097b8792ce99cadcd520"],
"domains": [
{
"name": "tiktoktopmoments.eth"
},
{
"name": "crimsonchin.eth"
},
{
"name": "levelsdigital.eth"
},
{
"name": "saintevie.eth"
},
{
"name": "bradorbradley.eth"
}
],
"socials": [
{
"profileName": "lens/@westlakevillage",
"profileTokenId": "99755",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@brad",
"profileTokenId": "116598",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@bradorbradley",
"profileTokenId": "36",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@hanimourra",
"profileTokenId": "116239",
"profileTokenIdHex": ""
}
]
},
"followerProfileId": "36",
"followerTokenId": "245"
}
// more following
]
}
}
}
Get Lens Following of Lens Profile(s) that Hold ERC20 Token(s)
You can get the list of Lens following of Lens profile(s) that also hold certain ERC20 token(s), e.g. USDC, by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {filter: {identity: {_in: ["lens/@stani", "lens_id:0x024", "vitalik.eth", "0xeaf55242a90bb3289dB8184772b0B98562053559"]}, dappName: {_eq: lens}}, blockchain: ALL, limit: 200}
) {
Following {
followingAddress {
addresses
socials(input: {filter: {dappName: {_eq: lens}}}) {
profileName
profileTokenId
profileTokenIdHex
}
tokenBalances(
input: {filter: {tokenAddress: {_in: ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]}, tokenType: {_eq: ERC20}}}
) {
formattedAmount # Indicate if following have any USDC
}
}
followerAddress {
addresses
domains {
name
}
socials(input: {filter: {dappName: {_eq: lens}}}) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": [
"0x008b1ffe244bf31896c833bff4ad9009e7a0f4eb"
],
"socials": [
{
"profileName": "lens/@yummy",
"profileTokenId": "47982",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@abertog",
"profileTokenId": "3568",
"profileTokenIdHex": ""
}
],
"tokenBalances": [
{
"formattedAmount": 13.487059 // Hold some USDC
}
]
},
"followerAddress": {
"addresses": [
"0x8ec94086a724cbec4d37097b8792ce99cadcd520"
],
"domains": [
{
"name": "tiktoktopmoments.eth"
},
{
"name": "crimsonchin.eth"
},
{
"name": "levelsdigital.eth"
},
{
"name": "saintevie.eth"
},
{
"name": "bradorbradley.eth"
}
],
"socials": [
{
"profileName": "lens/@westlakevillage",
"profileTokenId": "99755",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@brad",
"profileTokenId": "116598",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@bradorbradley",
"profileTokenId": "36",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@hanimourra",
"profileTokenId": "116239",
"profileTokenIdHex": ""
}
]
},
"followerProfileId": "36",
"followerTokenId": "245"
},
// more following
]
}
}
}
Get Lens Following of Lens Profile(s) that Hold ERC721/1155 NFT(s)
You can get the list of Lens following of Lens profile(s) that also hold certain ERC721 or ERC1155 NFT(s), e.g. BAYC, by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {filter: {identity: {_in: ["lens/@stani", "lens_id:0x024", "vitalik.eth", "0xeaf55242a90bb3289dB8184772b0B98562053559"]}, dappName: {_eq: lens}}, blockchain: ALL}
) {
Following {
followingAddress {
addresses
socials {
profileName
profileTokenId
profileTokenIdHex
}
tokenBalances(
input: {filter: {tokenAddress: {_in: ["0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"]}, tokenType: {_in: [ERC721, ERC1155]}}}
) {
formattedAmount # Indicate if following have any BAYC
}
}
followerAddress {
addresses
domains {
name
}
socials(input: {filter: {dappName: {_eq: lens}}}) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": [
"0x008b1ffe244bf31896c833bff4ad9009e7a0f4eb"
],
"socials": [
{
"profileName": "lens/@yummy",
"profileTokenId": "47982",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@abertog",
"profileTokenId": "3568",
"profileTokenIdHex": ""
}
],
"tokenBalances": [
{
"formattedAmount": 1 // Hold 1 BAYC NFT
}
]
},
"followerAddress": {
"addresses": [
"0x8ec94086a724cbec4d37097b8792ce99cadcd520"
],
"domains": [
{
"name": "tiktoktopmoments.eth"
},
{
"name": "crimsonchin.eth"
},
{
"name": "levelsdigital.eth"
},
{
"name": "saintevie.eth"
},
{
"name": "bradorbradley.eth"
}
],
"socials": [
{
"profileName": "lens/@westlakevillage",
"profileTokenId": "99755",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@brad",
"profileTokenId": "116598",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@bradorbradley",
"profileTokenId": "36",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@hanimourra",
"profileTokenId": "116239",
"profileTokenIdHex": ""
}
]
},
"followerProfileId": "36",
"followerTokenId": "245"
},
// more following
]
}
}
}
Get Lens Following of Lens Profile(s) that Hold POAP(s)
You can get the list of Lens following of Lens profile(s) that also hold certain POAP(s), e.g. EthCC [6] Attendee POAP, by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {
filter: {
identity: {
_in: [
"lens/@stani"
"lens_id:0x024"
"vitalik.eth"
"0xeaf55242a90bb3289dB8184772b0B98562053559"
]
}
dappName: { _eq: lens }
}
blockchain: ALL
limit: 200
}
) {
Following {
followingAddress {
addresses
socials {
profileName
profileTokenId
profileTokenIdHex
}
poaps(input: { filter: { eventId: { _eq: "141910" } } }) {
mintHash
mintOrder
}
}
followerAddress {
addresses
domains {
name
}
socials(input: { filter: { dappName: { _eq: lens } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": [
"0x008b1ffe244bf31896c833bff4ad9009e7a0f4eb"
],
"socials": [
{
"profileName": "lens/@yummy",
"profileTokenId": "47982",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@abertog",
"profileTokenId": "3568",
"profileTokenIdHex": ""
}
],
"poaps": [ // attended the EthCC[6] POAP event
{
"mintHash": "0x8b0e8d3ca7ca205e797660469925f6ed5a7b2d539421d7331ff19081f7ec48e2",
"mintOrder": 789
}
]
},
"followerAddress": {
"addresses": [
"0x8ec94086a724cbec4d37097b8792ce99cadcd520"
],
"domains": [
{
"name": "tiktoktopmoments.eth"
},
{
"name": "crimsonchin.eth"
},
{
"name": "levelsdigital.eth"
},
{
"name": "saintevie.eth"
},
{
"name": "bradorbradley.eth"
}
],
"socials": [
{
"profileName": "lens/@westlakevillage",
"profileTokenId": "99755",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@brad",
"profileTokenId": "116598",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@bradorbradley",
"profileTokenId": "36",
"profileTokenIdHex": ""
},
{
"profileName": "lens/@hanimourra",
"profileTokenId": "116239",
"profileTokenIdHex": ""
}
]
},
"followerProfileId": "36",
"followerTokenId": "245"
},
// more following
]
}
}
}
Get Lens Following of Lens Profile(s) that Hold Certain Amount of ERC20 Token(s)
You can get the list of Lens following of Lens profile(s) that also hold certain amount of ERC20 token(s), e.g. more than or equal to 1000 USDC, by inputting either their 0x address, or Lens profile ID ( or ):
Try Demo
Code
query MyQuery {
SocialFollowings(
input: {
filter: {
identity: {
_in: [
"lens/@stani"
"lens_id:0x024"
"vitalik.eth"
"0xeaf55242a90bb3289dB8184772b0B98562053559"
]
}
dappName: { _eq: lens }
}
blockchain: ALL
limit: 200
}
) {
Following {
followingAddress {
addresses
socials {
profileName
profileTokenId
profileTokenIdHex
}
tokenBalances(
input: {
filter: {
tokenAddress: {
_in: ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]
}
tokenType: { _eq: ERC20 }
formattedAmount: { _gte: 1000 }
}
}
) {
formattedAmount
}
}
followerAddress {
addresses
domains {
name
}
socials(input: { filter: { dappName: { _eq: lens } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
{
"data": {
"SocialFollowings": {
"Following": [
{
"followingAddress": {
"addresses": ["0x6c1e581e4ea169c28b9ca03f17f7370e030548ac"],
"socials": [
{
"profileName": "camillionaire",
"profileTokenId": "12637",
"profileTokenIdHex": "0x0315d"
},
{
"profileName": "lens/@camillionaire",
"profileTokenId": "27299",
"profileTokenIdHex": "0x06aa3"
}
],
"tokenBalances": [
{
"formattedAmount": 2746.94
}
]
},
"followerAddress": {
"addresses": ["0x7241dddec3a6af367882eaf9651b87e1c7549dff"],
"domains": null,
"socials": [
{
"profileName": "lens/@stani",
"profileTokenId": "5",
"profileTokenIdHex": "0x05"
},
{
"profileName": "lens/@lilgho",
"profileTokenId": "110056",
"profileTokenIdHex": "0x01ade8"
},
{
"profileName": "lens/@lensofficial",
"profileTokenId": "47319",
"profileTokenIdHex": "0x0b8d7"
}
]
},
"followerProfileId": "5",
"followerTokenId": "22"
}
// more following
]
}
}
}
Developer Support
If you have any questions or need help regarding fetching Lens Following data, please join our Airstack's Telegram group.
More Resources
Last updated
Was this helpful?