To access the Airstack APIs in other languages, you can use https://api.airstack.xyz/gql as your GraphQL endpoint.
Get All Farcaster Users Sorted By Social Capital Scores
You can use the Socials API to fetch all Farcaster users sorted by social capital scores by adding socialCapitalScore to the order field and set it to DESC value to sort in descending order:
Try Demo
Code
queryMyQuery { Socials( input: {filter: {dappName: {_eq: farcaster} },blockchain: ethereum,order: {socialCapitalScore: DESC}, # Add this to sort by SCSlimit: 200 } ) { Social { profileNamefid: userIdcustodyAddress: userAddress connectedAddresses { address blockchain } farcasterScore { farScore } } }}
{"data": {"Socials": {"Social": [ {"profileName":"dwr.eth","fid":"3","custodyAddress":"0x6b0bda3f2ffed5efc83fa8c024acff1dd45793f1","connectedAddresses": [ {"address":"0x8fc5d6afe572fefc4ec153587b63ce543f6fa2ea","blockchain":"ethereum" }, {"address":"0xd7029bdea1c17493893aafe29aad69ef892b8ff2","blockchain":"ethereum" } ],"farcasterScore": {"farScore":279.70459538175 } }// Other highly influential user on Farcaster network ] } }}
Get All Farcaster Users With Social Capital Scores > X
You can use the Socials API to fetch all Farcaster users with social capital scores above certain number by using the socialCapitalScore input field and provide the X value to the _gt filter (for other comparators, check out here).
In the example below, X is 50:
If you would like to also sort the result by social capital score, simply add socialCapitalScore to the order field and set the value to DESC.
To learn more how to do it, click here.
Get All Farcaster Users Sorted By Social Capital Rank
You can use the Socials API to fetch all Farcaster users sorted by social capital rank by adding socialCapitalRank to the order field and set it to ASC value to sort in ascending order:
Try Demo
Code
queryMyQuery { Socials( input: { # Order by social capital rank in ascending orderorder: {socialCapitalRank: ASC},filter: {dappName: {_eq: farcaster } },blockchain: ethereum } ) { Social { profileNamefid: userIdcustodyAddress: userAddress connectedAddresses { address blockchain } farcasterScore { farScore } } }}
{"data": {"Socials": {"Social": [ {"profileName":"dwr.eth","fid":"3","custodyAddress":"0x6b0bda3f2ffed5efc83fa8c024acff1dd45793f1","connectedAddresses": [ {"address":"0x8fc5d6afe572fefc4ec153587b63ce543f6fa2ea","blockchain":"ethereum" }, {"address":"0xd7029bdea1c17493893aafe29aad69ef892b8ff2","blockchain":"ethereum" } ],"farcasterScore": {"farRank":1 } }// Other Farcaster users ranked by social capital rank ] } }}
Get All Farcaster Users With Social Capital Rank < X
You can use the Socials API to fetch all Farcaster users with social capital rank below certain value by using the socialCapitalRank input field and the _lte operator. If you prefer other comparator for your logic, you can use other available comparator that suits you need (check more here).
If you would like to also sort the result by social capital rank, simply add socialCapitalRank to the order field and set the value to ASC.
To learn more how to do it, click here.
Try Demo
Code
queryMyQuery { Socials( input: {filter: {dappName: {_eq: farcaster },socialCapitalRank: {_lte: 100 # less than or equal to 100 } },blockchain: ethereum } ) { Social { profileNamefid: userIdcustodyAddress: userAddress connectedAddresses { address blockchain } farcasterScore { farScore } } }}
{"data": {"Socials": {"Social": [ {"profileName":"corbin.eth","fid":"358","custodyAddress":"0x3bcadeaef7f8e3bf5ec9ca5212cc9c72556c43ed","connectedAddresses": [ {"address":"0x869ec00fa1dc112917c781942cc01c68521c415e","blockchain":"ethereum" } ],"farcasterScore": {"farRank":82 } }// Other user with social capital rank below or equal to 100 ] } }}
Get All Farcaster Users Starting With Given Words
You can fetch all Farcaster users that starts with given words by providing the regex pattern "^<given-words>" to the _regex operator in Socials API:
Try Demo
Code
queryMyQuery { Socials( input: {filter: { # This regex pattern will search all Farcaster users # starting with "a"profileName: {_regex: "^a"},dappName: {_eq: farcaster} },blockchain: ethereum } ) { Social { dappName profileName } }}
{"data": {"Socials": {"Social": [ {"dappName":"farcaster","profileName":"atty" }, {"dappName":"farcaster","profileName":"anita-mpf" }, {"dappName":"farcaster","profileName":"amarraghu" }// Other Farcaster users starting with "a" ] } }}
Get All Farcaster Users Containing Given Words
You can fetch all Farcaster users 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 Farcaster users # containing "abc"profileName: {_regex: "abc"},dappName: {_eq: farcaster} },blockchain: ethereum } ) { Social { dappName profileName } }}
{"data": {"Socials": {"Social": [ {"dappName":"farcaster","profileName":"abcabc" }, {"dappName":"farcaster","profileName":"krabchinski" }, {"dappName":"farcaster","profileName":"861213abcc" }// Other Farcaster users containing with "abc" ] } }}
Get All Farcaster Users That Has Certain Number of Letters
You can fetch all Farcaster users 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 Farcaster users that have 1-3 # letters in its profile nameprofileName: {_regex: "^.{1,3}$"}dappName: {_eq: farcaster} },blockchain: ethereum } ) { Social { dappName profileName } }}
{"data": {"Socials": {"Social": [ {"dappName":"farcaster","profileName":"977" }, {"dappName":"farcaster","profileName":"nem" }, {"dappName":"farcaster","profileName":"vw" }// Other Farcaster users with less than 3 letters ] } }}
Developer Support
If you have any questions or need help regarding searching for Farcaster users, please join our Airstack's Telegram group.