Airstack provides easy-to-use APIs for enriching Farcaster applications and integrating on-chain and off-chain data with Farcaster.
Table Of Contents
In this guide you will learn how to use Airstack to:
Pre-requisites
Basic knowledge of GraphQL
Get Started
JavaScript/TypeScript/Python
If you are using JavaScript/TypeScript or Python, Install the Airstack SDK:
npm yarn pnpm pip
React
Copy npm install @airstack/airstack-react
Node
Copy npm install @airstack/node
React
Copy yarn add @airstack/airstack-react
Node
Copy yarn add @airstack/node
React
Copy pnpm install @airstack/airstack-react
Node
Copy pnpm install @airstack/node
Then, add the following snippets to your code:
React Node Python
Copy 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 >;
}
};
Copy 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);
Copy 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.
Get Farcaster Following of Farcaster User(s)
You can get the list of Farcaster following of Farcaster user(s) by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID:
Try Demo
Show me Farcaster following of fc_fname:dwr.eth, fc_fid:602, varunsrin.eth, and 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
dappName : { _eq : farcaster }
identity : {
_in : [
"fc_fname:dwr.eth"
"fc_fid:602"
"varunsrin.eth"
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
]
}
}
blockchain : ALL
limit : 200
}
) {
Following {
followingAddress {
addresses
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
}
followerProfileId
}
}
}
Copy {
"data" : {
"SocialFollowings" : {
"Following" : [
{
"followingAddress" : {
"addresses" : [
"0x5beaf49e8ee203ef1023e9b1b716c07016f399a1" ,
"0x223f2db258234f7fa164a9e4c0929318feb3b550"
] ,
"socials" : [
{
"profileName" : "vm" ,
"userId" : "325" ,
"userAssociatedAddresses" : [
"0x5beaf49e8ee203ef1023e9b1b716c07016f399a1" ,
"0x223f2db258234f7fa164a9e4c0929318feb3b550"
]
}
]
} ,
"followingProfileId" : "325" ,
"followerAddress" : {
"addresses" : [
"0x74232bf61e994655592747e20bdf6fa9b9476f79" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2"
] ,
"domains" : [
{
"name" : "dwr.eth"
} ,
{
"name" : "noun124.eth"
} ,
{
"name" : "dwr.mirror.xyz"
} ,
{
"name" : "danromero.eth"
}
] ,
"socials" : [
{
"profileName" : "dwr.eth" ,
"userId" : "3" ,
"userAssociatedAddresses" : [
"0x74232bf61e994655592747e20bdf6fa9b9476f79" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2"
]
}
]
} ,
"followerProfileId" : "3"
}
// more following
]
}
}
}
Get The Most Recent Farcaster Following of Farcaster User(s)
You can get the list of most recent Farcaster following of Farcaster user(s) by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID:
Try Demo
Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
dappName : { _eq : farcaster }
identity : {
_in : [
"lens/@stani"
"lens_id:0x024"
"vitalik.eth"
"0xeaf55242a90bb3289dB8184772b0B98562053559"
]
}
}
blockchain : ALL
limit : 200
order : { followerSince : DESC }
}
) {
Following {
followingAddress {
addresses
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
Get The Earliest Farcaster Following of Farcaster User(s)
You can get the list of the earliest Farcaster following of Farcaster user(s) by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID:
Try Demo
Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
dappName : { _eq : farcaster }
identity : {
_in : [
"lens/@stani"
"lens_id:0x024"
"vitalik.eth"
"0xeaf55242a90bb3289dB8184772b0B98562053559"
]
}
}
blockchain : ALL
limit : 200
order : { followerSince : ASC }
}
) {
Following {
followingAddress {
addresses
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
profileTokenId
profileTokenIdHex
}
}
followerProfileId
followerTokenId
}
}
}
Get Farcaster Following of Farcaster User(s) that has ENS Domain
You can get the list of Farcaster following of Farcaster user(s) and check if they have any ENS domain by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID:
Try Demo
Code
Query
Copy query MyQuery {
SocialFollowings(
input: {filter: {dappName: {_eq: farcaster}, 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 : farcaster}}}) {
profileName
profileTokenId
profileTokenIdHex
}
}
followingProfileId
followingTokenId
followerAddress {
addresses
domains {
name
}
socials(input: { filter : { dappName : { _eq : farcaster}}}) {
profileName
profileTokenId
profileTokenIdHex
}
}
followingProfileId
}
}
}
You can use the followerAddress.domains
that will return an array to see if there's any domain owned by the follower.
If the length of the followerAddress.domains
array is non-zero, then the follower has at least one ENS domain. Otherwise, it does not have any ENS domain.
Get Farcaster Following of Farcaster User(s) that has XMTP Enabled
You can get the list of Farcaster following of Farcaster user(s) and check if each following have XMTP enabled or not by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID:
Try Demo
Show me Farcaster following of fc_fname:dwr.eth, fc_fid:602, varunsrin.eth, and 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 and if XMTP is enabled Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
dappName : { _eq : farcaster }
identity : {
_in : [
"fc_fname:dwr.eth"
"fc_fid:602"
"varunsrin.eth"
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
]
}
}
blockchain : ALL
limit : 200
}
) {
Following {
followingAddress {
addresses
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
xmtp {
isXMTPEnabled
}
}
followingProfileId
followerAddress {
addresses
domains {
name
}
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
}
followerProfileId
}
}
}
Copy {
"data" : {
"SocialFollowings" : {
"Following" : [
{
"followingAddress" : {
"addresses" : [
"0x5beaf49e8ee203ef1023e9b1b716c07016f399a1" ,
"0x223f2db258234f7fa164a9e4c0929318feb3b550"
] ,
"socials" : [
{
"profileName" : "vm" ,
"userId" : "325" ,
"userAssociatedAddresses" : [
"0x5beaf49e8ee203ef1023e9b1b716c07016f399a1" ,
"0x223f2db258234f7fa164a9e4c0929318feb3b550"
]
}
] ,
"xmtp" : [
{
"isXMTPEnabled" : true
}
]
} ,
"followingProfileId" : "325" ,
"followerAddress" : {
"addresses" : [
"0x74232bf61e994655592747e20bdf6fa9b9476f79" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2"
] ,
"domains" : [
{
"name" : "dwr.eth"
} ,
{
"name" : "noun124.eth"
} ,
{
"name" : "dwr.mirror.xyz"
} ,
{
"name" : "danromero.eth"
}
] ,
"socials" : [
{
"profileName" : "dwr.eth" ,
"userId" : "3" ,
"userAssociatedAddresses" : [
"0x74232bf61e994655592747e20bdf6fa9b9476f79" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2"
]
}
]
} ,
"followerProfileId" : "3"
}
// more following
]
}
}
}
Get Farcaster Users that have a certain amount of Following
You can get the list of Farcaster users that have a certain amount of following, e.g. at least 1000 following:
Try Demo
Show me all Farcaster users that have at least 1000 following Code
Query Response
Copy query MyQuery {
Socials(
input: {
filter : { followingCount : { _gte : 1000 }, dappName : { _eq : farcaster } }
blockchain : ethereum
limit : 200
}
) {
Social {
profileName
userId
userAssociatedAddresses
followingCount
}
}
}
Copy {
"data" : {
"Socials" : {
"Social" : [
{
"profileName" : "jayme" ,
"userId" : "373" ,
"userAssociatedAddresses" : [
"0x1ca66c990e86b750ea6b2180d17fff89273a5c0d" ,
"0x9eab9d856a3a667dc4cd10001d59c679c64756e7"
] ,
"followingCount" : 1443
} ,
{
"profileName" : "aydasayer" ,
"userId" : "14993" ,
"userAssociatedAddresses" : [
"0xf009162e2495dd1dd54b5470e03004010f931a9f" ,
"0x022fe87e83f3d6662862ed51ef74de33ed16ff25"
] ,
"followingCount" : 1245
} ,
{
"profileName" : "reiri" ,
"userId" : "17626" ,
"userAssociatedAddresses" : [
"0x5f948ad313f280eb71d038f72d932f3b335458de" ,
"0x688d0cef9d2ad572e2b889ea595a042a1821e5ff"
] ,
"followingCount" : 1054
}
]
}
}
}
Get Farcaster and Lens Following of Lens Profile(s)
You can get the list of Farcaster and Lens following of Farcaster user(s) by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID :
Try Demo
Show me the Farcaster and Lens following of fc_fname:dwr.eth, fc_fid:602, varunsrin.eth, and 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
identity : {
_in : [
"fc_fname:dwr.eth"
"fc_fid:602"
"varunsrin.eth"
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
]
}
}
blockchain : ALL
limit : 200
}
) {
Following {
followingAddress {
addresses
domains {
name
}
socials {
dappName
profileName
profileTokenId
profileTokenIdHex
userId
userAssociatedAddresses
}
}
followingProfileId
followerAddress {
addresses
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
}
followerProfileId
}
}
}
Copy {
"data" : {
"SocialFollowings" : {
"Following" : [
{
"followingAddress" : {
"addresses" : [
"0x5beaf49e8ee203ef1023e9b1b716c07016f399a1" ,
"0x223f2db258234f7fa164a9e4c0929318feb3b550"
] ,
"domains" : [
{
"name" : "victorma.eth"
}
] ,
"socials" : [
{
"dappName" : "farcaster" ,
"profileName" : "vm" ,
"profileTokenId" : "325" ,
"profileTokenIdHex" : "" ,
"userId" : "325" ,
"userAssociatedAddresses" : [
"0x5beaf49e8ee203ef1023e9b1b716c07016f399a1" ,
"0x223f2db258234f7fa164a9e4c0929318feb3b550"
]
} ,
{
"dappName" : "lens" ,
"profileName" : "lens/@victorma" ,
"profileTokenId" : "118319" ,
"profileTokenIdHex" : "" ,
"userId" : "0x223f2db258234f7fa164a9e4c0929318feb3b550" ,
"userAssociatedAddresses" : [
"0x223f2db258234f7fa164a9e4c0929318feb3b550"
]
}
]
} ,
"followingProfileId" : "325" ,
"followerAddress" : {
"addresses" : [
"0xff3174d9f52f8c24f9c884600ac80c2b2dda4556" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0x74232bf61e994655592747e20bdf6fa9b9476f79"
] ,
"socials" : [
{
"profileName" : "dwr.eth" ,
"userId" : "3" ,
"userAssociatedAddresses" : [
"0xff3174d9f52f8c24f9c884600ac80c2b2dda4556" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0x74232bf61e994655592747e20bdf6fa9b9476f79"
]
}
]
} ,
"followerProfileId" : "3"
}
// more following
]
}
}
}
Get All Farcaster Followings That Also Have A Power Badge
You can fetch all Farcaster followings of a Farcaster user and check if they have a power badge by using the SocialFollowings
API:
Try Demo
Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
identity : { _eq : "betashop.eth" },
dappName : { _eq : farcaster}
},
blockchain : ALL,
order : { followingSince : DESC}
}
) {
Following {
followingProfileId
followingAddress {
addresses
socials {
profileName
isFarcasterPowerUser
}
}
}
}
}
Copy {
"data" : {
"SocialFollowings" : {
"Following" : [
{
"followingProfileId" : "378310" ,
"followingAddress" : {
"addresses" : [
"0x765f844900da37dbc6f3c82e0ccdea5e01a303dc" ,
"2TkvxGAuEXWFeYB7qP2MY2MSjhmcsnsCotyxu7fQyKH3"
] ,
"socials" : [
{
"profileName" : "0xbuildr" ,
"isFarcasterPowerUser" : false // This user have no power badge
}
]
}
} ,
]
}
}
}
Get Farcaster Following of Farcaster User(s) that Hold ERC20 Token(s)
You can get the list of Farcaster following of Farcaster user(s) and check if each following hold ERC20 token(s), e.g. USDC , by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID:
Try Demo
Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
identity : {
_in : [
"fc_fname:dwr.eth"
"fc_fid:602"
"varunsrin.eth"
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
]
}
dappName : { _eq : farcaster }
}
blockchain : ALL
limit : 200
}
) {
Following {
followingAddress {
addresses
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
tokenBalances(
input: {
filter : {
tokenAddress : {
_in : [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ]
}
tokenType : { _eq : ERC20 }
}
}
) {
formattedAmount
}
}
followerAddress {
addresses
domains {
name
}
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
}
followerProfileId
}
}
}
Copy {
"data" : {
"SocialFollowings" : {
"Following" : [
{
"followingAddress" : {
"addresses" : [
"0x5beaf49e8ee203ef1023e9b1b716c07016f399a1" ,
"0x223f2db258234f7fa164a9e4c0929318feb3b550"
] ,
"socials" : [
{
"profileName" : "vm" ,
"userId" : "325" ,
"userAssociatedAddresses" : [
"0x5beaf49e8ee203ef1023e9b1b716c07016f399a1" ,
"0x223f2db258234f7fa164a9e4c0929318feb3b550"
]
}
] ,
"tokenBalances" : [
{
"formattedAmount" : 12
}
]
} ,
"followerAddress" : {
"addresses" : [
"0x74232bf61e994655592747e20bdf6fa9b9476f79" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2"
] ,
"domains" : [
{
"name" : "dwr.eth"
} ,
{
"name" : "noun124.eth"
} ,
{
"name" : "dwr.mirror.xyz"
} ,
{
"name" : "danromero.eth"
}
] ,
"socials" : [
{
"profileName" : "dwr.eth" ,
"userId" : "3" ,
"userAssociatedAddresses" : [
"0x74232bf61e994655592747e20bdf6fa9b9476f79" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2"
]
}
]
} ,
"followerProfileId" : "3"
}
// more following
]
}
}
}
Get Farcaster Following of Farcaster User(s) that Hold ERC721/1155 NFT(s)
You can get the list of Farcaster following of Farcaster user(s) and check if each following hold ERC721/1155 NFT(s), e.g. BAYC , by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID:
Try Demo
Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
identity : {
_in : [
"fc_fname:dwr.eth"
"fc_fid:602"
"varunsrin.eth"
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
]
}
dappName : { _eq : farcaster }
}
blockchain : ALL
limit : 200
}
) {
Following {
followingAddress {
addresses
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
tokenBalances(
input: {
filter : {
tokenAddress : {
_in : [ "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D" ]
}
tokenType : { _in : [ERC721, ERC1155] }
}
}
) {
formattedAmount
}
}
followerAddress {
addresses
domains {
name
}
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
}
followerProfileId
}
}
}
Copy {
"data" : {
"SocialFollowings" : {
"Following" : [
{
"followingAddress" : {
"addresses" : [
"0xb5b2da92350efdc6250b74bccf24f4ec9e5bb0ce" ,
"0x695626a661831a618ae846482fe8abf6c8d4529c"
] ,
"socials" : [
{
"profileName" : "ivanhodl" ,
"userId" : "14240" ,
"userAssociatedAddresses" : [
"0xb5b2da92350efdc6250b74bccf24f4ec9e5bb0ce" ,
"0x695626a661831a618ae846482fe8abf6c8d4529c"
]
}
] ,
"tokenBalances" : [
{
"formattedAmount" : 1 // following have BAYC
}
]
} ,
"followerAddress" : {
"addresses" : [
"0x66bd69c7064d35d146ca78e6b186e57679fba249" ,
"0xeaf55242a90bb3289db8184772b0b98562053559"
] ,
"domains" : [
{
"name" : "jasongoldberg.eth"
} ,
{
"name" : "betashop.eth"
}
] ,
"socials" : [
{
"profileName" : "betashop.eth" ,
"userId" : "602" ,
"userAssociatedAddresses" : [
"0x66bd69c7064d35d146ca78e6b186e57679fba249" ,
"0xeaf55242a90bb3289db8184772b0b98562053559"
]
}
]
} ,
"followerProfileId" : "602"
} ,
// more following
]
}
}
}
Get Farcaster Following of Farcaster User(s) that Hold POAP(s)
You can get the list of Farcaster following of Farcaster user(s) and check if each following hold POAP(s), e.g. EthCC[6] â Attendee POAP , by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID:
Try Demo
Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
identity : {
_in : [
"fc_fname:dwr.eth"
"fc_fid:602"
"varunsrin.eth"
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
]
}
dappName : { _eq : farcaster }
}
blockchain : ALL
limit : 200
}
) {
Following {
followingAddress {
addresses
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
poaps(input: { filter : { eventId : { _eq : "141910" } } }) {
mintHash
mintOrder
}
}
followerAddress {
addresses
domains {
name
}
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
}
followerProfileId
}
}
}
Copy {
"data" : {
"SocialFollowings" : {
"Following" : [
{
"followingAddress" : {
"addresses" : [
"0x6d7af15b43f897403004c5e14a70022f5625d801" ,
"0xd383eeeb6912036f36d0d1878e2dec6dd3eb80ba"
] ,
"socials" : [
{
"profileName" : "rdl" ,
"userId" : "652" ,
"userAssociatedAddresses" : [
"0x6d7af15b43f897403004c5e14a70022f5625d801" ,
"0xd383eeeb6912036f36d0d1878e2dec6dd3eb80ba"
]
}
] ,
"poaps" : [
// Hold an EthCC[6] - Attendee POAP
{
"mintHash" : "0xccd861db65ffb63f20d458bcbc1d1a0282e4bd7a606ef1226121abe21429d00e" ,
"mintOrder" : 732
}
]
} ,
"followerAddress" : {
"addresses" : [
"0x4114e33eb831858649ea3702e1c9a2db3f626446" ,
"0x182327170fc284caaa5b1bc3e3878233f529d741" ,
"0x91031dcfdea024b4d51e775486111d2b2a715871"
] ,
"domains" : [
{
"name" : "varunsrin.eth"
}
] ,
"socials" : [
{
"profileName" : "varunsrin.eth" ,
"userId" : "2" ,
"userAssociatedAddresses" : [
"0x4114e33eb831858649ea3702e1c9a2db3f626446" ,
"0x182327170fc284caaa5b1bc3e3878233f529d741" ,
"0x91031dcfdea024b4d51e775486111d2b2a715871"
]
}
]
} ,
"followerProfileId" : "2"
} ,
// more following
]
}
}
}
Get Farcaster Following of Farcaster User(s) that Hold Certain Amount of ERC20 Token(s)
You can get the list of Farcaster following of Farcaster user(s) and check if each following hold a certain amount of ERC20 token(s), e.g. at least 1000 USDC , by inputting 0x address , ENS domain, Farcaster Name , or Farcaster ID:
Try Demo
Code
Query Response
Copy query MyQuery {
SocialFollowings(
input: {
filter : {
identity : {
_in : [
"fc_fname:dwr.eth"
"fc_fid:602"
"varunsrin.eth"
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
]
}
dappName : { _eq : farcaster }
}
blockchain : ALL
limit : 200
}
) {
Following {
followingAddress {
addresses
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
tokenBalances(
input: {
filter : {
tokenAddress : {
_in : [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ]
}
tokenType : { _eq : ERC20 }
formattedAmount : { _gte : 1000 }
}
}
) {
formattedAmount
}
}
followerAddress {
addresses
domains {
name
}
socials(input: { filter : { dappName : { _eq : farcaster } } }) {
profileName
userId
userAssociatedAddresses
}
}
followerProfileId
}
}
}
Copy {
"data" : {
"SocialFollowings" : {
"Following" : [
{
"followingAddress" : {
"addresses" : [
"0x30a838dfc03968b5e0a64796547db42f64aa4de5" ,
"0xf0fbaaa7ece80ac41508e442929b81a4c8c8543b"
] ,
"socials" : [
{
"profileName" : "0xjoyce" ,
"userId" : "1660" ,
"userAssociatedAddresses" : [
"0x30a838dfc03968b5e0a64796547db42f64aa4de5" ,
"0xf0fbaaa7ece80ac41508e442929b81a4c8c8543b"
]
}
] ,
"tokenBalances" : [
{
"formattedAmount" : 3283.180666
}
]
} ,
"followerAddress" : {
"addresses" : [
"0x74232bf61e994655592747e20bdf6fa9b9476f79" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2"
] ,
"domains" : [
{
"name" : "dwr.eth"
} ,
{
"name" : "noun124.eth"
} ,
{
"name" : "dwr.mirror.xyz"
} ,
{
"name" : "danromero.eth"
}
] ,
"socials" : [
{
"profileName" : "dwr.eth" ,
"userId" : "3" ,
"userAssociatedAddresses" : [
"0x74232bf61e994655592747e20bdf6fa9b9476f79" ,
"0xb877f7bb52d28f06e60f557c00a56225124b357f" ,
"0xa14b4c95b5247199d74c5578531b4887ca5e4909" ,
"0xd7029bdea1c17493893aafe29aad69ef892b8ff2"
]
}
]
} ,
"followerProfileId" : "3"
}
// more following
]
}
}
}
Developer Support
If you have any questions or need help regarding fetching Farcaster Followings data, please join our Airstack's Telegram group.
More Resources