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 All Lens Profiles
You can globally fetch all Lens profiles using the Socials API by specifying dappName to lens:
You can fetch all Lens profiles that starts with given words by providing the regex pattern "^lens/@<given-words>" to the _regex operator in Socials API:
Try Demo
Code
queryMyQuery { Socials( input: {filter: { # This regex pattern will search all Lens profile # starting with "a"profileName: {_regex: "^lens/@a"},dappName: {_eq: lens} },blockchain: ethereum } ) { Social { dappName profileName } }}
{"data": {"Socials": {"Social": [ {"dappName":"lens","profileName":"lens/@anastasia1337" }, {"dappName":"lens","profileName":"lens/@amg888" }, {"dappName":"lens","profileName":"lens/@alexdark" }// Other Lens profiles starting with "a" ] } }}
Get All Lens Profiles Containing Given Words
You can fetch all Lens profiles that contains given words by providing "<given-words>" directly to the _regex operator in Socials API:
Try Demo
Code
queryMyQuery { Socials( input: {filter: { # This regex pattern will search all Lens profiles # containing "abc"profileName: {_regex: "abc"},dappName: {_eq: lens} },blockchain: ethereum } ) { Social { dappName profileName } }}
{"data": {"Socials": {"Social": [ {"dappName":"lens","profileName":"lens/@abcoathup" }, {"dappName":"lens","profileName":"lens/@phabc" }, {"dappName":"lens","profileName":"lens/@abc888" }// Other Lens profiles containing with "abc" ] } }}
Get All Lens Profiles That Has Certain Number of Letters
You can fetch all Lens profiles that has certain number of letters in its profile name by providing "^.{min_number_of_letters, max_number_of_letters}$" directly to the _regex operator in Socials API, where the minimum should always be less than or equal to the maximum:
Try Demo
Code
queryMyQuery { Socials( input: {filter: { # This regex pattern search all Lens profiles that have 1-3 # letters in its profile nameprofileName: {_regex: "^lens/@.{1,3}$"},dappName: {_eq: lens} },blockchain: ethereum } ) { Social { dappName profileName } }}
{"data": {"Socials": {"Social": [ {"dappName":"lens","profileName":"lens/@emi" }, {"dappName":"lens","profileName":"lens/@dev" }, {"dappName":"lens","profileName":"lens/@bak" }// Other lens profiles with less than 3 letters ] } }}
Get All Lens Profiles Created In Specified Time
You can fetch all Lens profiles that are created in a specified time using the Socials API by specifying dappName to lens and profileCreatedAtBlockTimestamp to the desired block timestamp range:
{"data": {"Socials": {"Social": [ {"profileName":"lens/@sharmila","userAssociatedAddresses": ["0x027fe3f132403c1b59ddaba14b576d15865f69c0" ],"profileCreatedAtBlockNumber":50090941 }, {"profileName":"lens/@cryptobatman","userAssociatedAddresses": ["0xffadbedd39470d969c483ea031c67e1dd1690be8" ],"profileCreatedAtBlockNumber":49896947 }, {"profileName":"lens/@vaavi","userAssociatedAddresses": ["0x78e6d347c3820550cb9bb26aea4b43d4df1b4989" ],"profileCreatedAtBlockNumber":49944932 }// Other Lens profiles created between November 12 to 19, 2023 UTC ],"pageInfo": {"hasNextPage":true,"hasPrevPage":false, "nextCursor": "eyJMYXN0VmFsdWVzTWFwIjp7Il9pZCI6eyJWYWx1ZSI6IjcyN2JjMmNjYmZkOTFhN2EwMzEwMTI4YmUwZWM3MDMzZjNiMDY3M2Y4YmY5NTQxYmNlZDIxZGYyMTIwOTc0ZjMiLCJEYXRhVHlwZSI6InN0cmluZyJ9fSwiUGFnaW5hdGlvbkRpcmVjdGlvbiI6Ik5FWFQifQ==",
"prevCursor":"" } } }}
Get The Latest Lens Profiles Created
You can fetch all the latest Lens profiles created using the Socials API by specifying dappName to lens and sorting profileCreatedAtBlockTimestamp in descending order:
{"data": {"Socials": {"Social": [ {"profileName":"lens/@joshkmatt","userAssociatedAddresses": ["0xd987d775277dbb992e7d8831422c7ecd769caff6" ],"profileCreatedAtBlockNumber":50206929 }, {"profileName":"lens/@vkuma","userAssociatedAddresses": ["0xa8682e95c86d070f40c2f9a9b2b9b3ca8521d5d8" ],"profileCreatedAtBlockNumber":50206199 }, {"profileName":"lens/@digge","userAssociatedAddresses": ["0xfa6aa55f25c0cb728273d3ea4c261824821eb7aa" ],"profileCreatedAtBlockNumber":50204562 }// Other Lens profiles, ordered by the latest creation block number ],"pageInfo": {"hasNextPage":true,"hasPrevPage":false, "nextCursor": "eyJMYXN0VmFsdWVzTWFwIjp7Il9pZCI6eyJWYWx1ZSI6IjExOTg4N2U4ZDM4ZWVkOTM0YWM4OTI0ZmMxNDg0NDVhZThmZWNkOWFhMDhmMDg1ZDllMjRhY2ViMzQ0MjNjMTkiLCJEYXRhVHlwZSI6InN0cmluZyJ9LCJwcm9maWxlQ3JlYXRlZEF0QmxvY2tUaW1lc3RhbXAiOnsiVmFsdWUiOiIxNzAwMzk1MDY0IiwiRGF0YVR5cGUiOiJEYXRlVGltZSJ9fSwiUGFnaW5hdGlvbkRpcmVjdGlvbiI6Ik5FWFQifQ==",
"prevCursor":"" } } }}
Get The Earliest Lens Profiles Created
You can fetch all the latest Lens profiles created using the Socials API by specifying dappName to lens and sorting profileCreatedAtBlockTimestamp in ascending order:
{"data": {"Socials": {"Social": [ {"profileName":"lens/@lensprotocol","userAssociatedAddresses": ["0x05092cf69bdd435f7ba4b8ef97c9caecf2ba69ad" ],"followerCount":86634 }, {"profileName":"lens/@stani","userAssociatedAddresses": ["0x7241dddec3a6af367882eaf9651b87e1c7549dff" ],"followerCount":77366 }, {"profileName":"lens/@aaveaave","userAssociatedAddresses": ["0x24a6d858342aaa20f1d058b8961cd3e712c2f859" ],"followerCount":73733 }// other most followed lens profiles, sorted by number of followers in descending order ],"pageInfo": {"hasNextPage":true,"hasPrevPage":false, "nextCursor": "eyJMYXN0VmFsdWVzTWFwIjp7Il9pZCI6eyJWYWx1ZSI6Ijk3YzM0YmViZmJiNzcxNmVkYTRkMzJkMWFiZGQwZWVkMGYyMTY2MDFiYjRjZDYyOGQyMjRmNzYwYTE5MmFiM2YiLCJEYXRhVHlwZSI6InN0cmluZyJ9LCJmb2xsb3dlckNvdW50Ijp7IlZhbHVlIjoiNDY4OSIsIkRhdGFUeXBlIjoiaW50NjQifX0sIlBhZ2luYXRpb25EaXJlY3Rpb24iOiJORVhUIn0=",
"prevCursor":"" } } }}
Get The Least Followed Lens Profiles
You can fetch all the least followed Lens profiles using the Socials API by specifying dappName to lens and sorting followerCount in ascending order:
{"data": {"Socials": {"Social": [ {"profileName":"lens/@wattles","userAssociatedAddresses": ["0x7844ef57c6f7dcdd78169ce8983b246005298a76" ],"followerCount":0 }, {"profileName":"lens/@pastalavista","userAssociatedAddresses": ["0xb411e2fca5c6cdd9132672b70e7d76b9ea75775c" ],"followerCount":0 }, {"profileName":"lens/@oasisbigbrain","userAssociatedAddresses": ["0xc56bd5a8dbd6997686aa0c9e68bd5eeaf1145d86" ],"followerCount":0 }// other least followed lens profiles, sorted by number of followers in ascending order ],"pageInfo": {"hasNextPage":true,"hasPrevPage":false, "nextCursor": "eyJMYXN0VmFsdWVzTWFwIjp7Il9pZCI6eyJWYWx1ZSI6IjBkMzJlYjRhMGM3YmRhMDhlNTBmYTBkNjI1NDJlNDMyNTBjZTVkNjdjMTZmZmRiNGE5MGNkMDhjN2VhZTIxNGEiLCJEYXRhVHlwZSI6InN0cmluZyJ9LCJmb2xsb3dlckNvdW50Ijp7IlZhbHVlIjoiIiwiRGF0YVR5cGUiOiJzdHJpbmcifX0sIlBhZ2luYXRpb25EaXJlY3Rpb24iOiJORVhUIn0=",
"prevCursor":"" } } }}
Get Lens Profiles That Is Following Others The Most
You can fetch all Lens profiles that is following other profiles the most using the Socials API by specifying dappName to lens and sorting followingCount in descending order:
{"data": {"Socials": {"Social": [ {"profileName":"lens/@creatorfundincubator","userAssociatedAddresses": ["0x84c0430f3564520dcde45c3dfd7ceb79372e4fa3" ],"followingCount":39840 }, {"profileName":"lens/@ameerna17958863","userAssociatedAddresses": ["0x33425c7f31a089ea00441cf46de2487f7899fdd8" ],"followingCount":31767 }, {"profileName":"lens/@justinsunset","userAssociatedAddresses": ["0x48b61678ea8748b81abc677d1bd6050878a86d27" ],"followingCount":30021 }// Other Lens profiles that is following others the most, sorted by followingCount in descending order ],"pageInfo": {"hasNextPage":true,"hasPrevPage":false, "nextCursor": "eyJMYXN0VmFsdWVzTWFwIjp7Il9pZCI6eyJWYWx1ZSI6Ijc5NzQzMWY1MzIyMDZjZDVjNGJiYzViMWI1YmI1NDM1OTQ0NjQzNzJjZDViNWMxYjBiYjE1NTM0MTRlMTNjZWQiLCJEYXRhVHlwZSI6InN0cmluZyJ9LCJmb2xsb3dpbmdDb3VudCI6eyJWYWx1ZSI6IjE4MDQiLCJEYXRhVHlwZSI6ImludDY0In19LCJQYWdpbmF0aW9uRGlyZWN0aW9uIjoiTkVYVCJ9",
"prevCursor":"" } } }}
Get Lens Profiles That Is Following Others The Least
You can fetch all Lens profiles that is following other profiles the least using the Socials API by specifying dappName to lens and sorting followingCount in ascending order:
{"data": {"Socials": {"Social": [ {"profileName":"lens/@wattles","userAssociatedAddresses": ["0x7844ef57c6f7dcdd78169ce8983b246005298a76" ],"followingCount":0 }, {"profileName":"lens/@pastalavista","userAssociatedAddresses": ["0xb411e2fca5c6cdd9132672b70e7d76b9ea75775c" ],"followingCount":0 }, {"profileName":"lens/@oasisbigbrain","userAssociatedAddresses": ["0xc56bd5a8dbd6997686aa0c9e68bd5eeaf1145d86" ],"followingCount":0 }// Other Lens profiles that is following others the least, sorted by followingCount in ascending order ],"pageInfo": {"hasNextPage":true,"hasPrevPage":false, "nextCursor": "eyJMYXN0VmFsdWVzTWFwIjp7Il9pZCI6eyJWYWx1ZSI6IjBkNDg0OGI1N2JkZGE2N2RhOWRhYTA2MTk2ZDNhMmM5NTE4NzdiMmI2NzFiNjRiMmMyNjY0YWZiODkzMTYxOWEiLCJEYXRhVHlwZSI6InN0cmluZyJ9LCJmb2xsb3dpbmdDb3VudCI6eyJWYWx1ZSI6IiIsIkRhdGFUeXBlIjoic3RyaW5nIn19LCJQYWdpbmF0aW9uRGlyZWN0aW9uIjoiTkVYVCJ9",
"prevCursor":"" } } }}
Developer Support
If you have any questions or need help regarding searching for Lens profiles, please join our Airstack's Telegram group.