To access the Airstack APIs in other languages, you can use https://api.airstack.xyz/gql as your GraphQL endpoint.
Get All Replies By A Farcaster User
You can use FarcasterReplies API to fetch all the replies casted by a given Farcaster user by specifying the user's identity in repliedBy input filter:
{"data": {"FarcasterReplies": {"Reply": [ {"castedAtTimestamp":"2024-05-06T16:30:01Z","embeds": [],"url":"https://warpcast.com/betashop.eth/0xde71bb21","text":"more thinking on this \n\nPreferred widgets/Actions at user and channel level \n\nallow more shopify-type experiences to emergeâ always on my page \n\nAllows meme coins and nft projects to always have perm buy and mint actions \n\nAllows users to easily play favorite games together","numberOfRecasts":0,"numberOfLikes":0,"channel":null,"mentions": [] }, ] } }}
Get Farcaster Reply Details By Reply Cast Hash
You can use FarcasterReplies API to fetch a Farcaster reply details of a given Farcaster reply cast hash by specifying the reply cast in hash input filter:
If the cast is a root cast and not a reply, then you should use this query here.
Try Demo
Code
queryMyQuery { FarcasterReplies( input: {filter: { # specify the reply cast hashhash: {_eq: "0x20c4102f0cbcb6175af1d08005be0158f54977d7"} },blockchain: ALL } ) { Reply { castedAtTimestamp embeds url text numberOfRecasts numberOfLikes channel { channelId } mentions { fid position } } }}
Get All Casts Replied By A User In A Certain Channel
You can use the FarcasterReactions API to get all the casts replied by a user in a certain channel by providing the user's identity to reactedBy and the channel ID to channelId input filter:
{"data": {"FarcasterReactions": {"Reaction": [ {"castHash":"0xf8c7f6c0fea967f335287348d264b5e29a1b4d0c","cast": {"text":"is there a way to rank channels by median SCV score of casts in channel (say in the past week)? by 20th or 80th percentile SCV score?\n\nin full disclosure, I am most interested to compare perceived /spanish /japanese /korean channel conversation qualities under this metric" } },// Other casts replied by FID 602 in /airstack channel ] } }}
Get All Replies Of A Certain Cast By Cast Hash
You can use FarcasterReplies API to fetch all replies of a given cast by specifying the cast hash in parentHash input filter:
{"data": {"FarcasterReplies": {"Reply": [ {"fid":"274034","castedAtTimestamp":"2024-05-06T14:25:37Z","embeds": [],"url":"https://warpcast.com/spd/0x3d913531","text":"Minted","numberOfRecasts":0,"numberOfLikes":0,"channel": {"channelId":"farcards" },"mentions": [] },// Other replies for cast hash 0x4c0f2172836b14a57d35f5d096ced49049b1d92d ] } }}
Get All Replies From A Cast Casted By A Farcaster User
You can use FarcasterReplies API to fetch all the replies from any casts casted by a given Farcaster user by specifying the user's identity in parentCastedBy input filter:
You can use the FarcasterReactions API to check if a user replied to a certain cast by providing the user's identity in reactedBy and the cast hash in castHash input filter:
{"data": {"FarcasterReactions": {"Reaction": [ {// if not null, then user replied to this cast"castHash":"0xfb41e8ada70ee2da9a21023ec77469a03c4bcea9" } ] } }}
Check If User A Replied Any Cast By User B
You can use FarcasterReplies API to check if user A replied to any cast by user B:
Try Demo
Code
queryMyQuery { FarcasterReplies( input: {filter: {repliedBy: {_eq: "fc_fid:2602"}, # user AparentCastedBy: {_eq: "fc_fid:602"} # user B },blockchain: ALL,limit: 1 } ) { Reply { castedAtTimestamp } }}
{"data": {"FarcasterReplies": {"Reply": [ {// if not null, then user A replied to a cast by user B"castedAtTimestamp":"2024-05-05T20:48:08Z" } ] } }}
Check If A User Replied Any Cast In A Channel
You can use the FarcasterReactions APi to check if a user replied any cast in a certain channel by providing the channel ID to channelID and the user's identity to the reactedBy input filter:
{"data": {"FarcasterReactions": {// If not `null`, then the user liked one of the cast in /airstack channel"Reaction": [ {"castHash":"0xf8c7f6c0fea967f335287348d264b5e29a1b4d0c" } ] } }}
Developer Support
If you have any questions or need help regarding fetching Farcaster replies data, please join our Airstack's Telegram group.