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 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.