Only fetch trending casts that have the most engagement within the chosen time frame, e.g. one_hour will fetch trending Farcaster casts with the most engagement for the last 1 hour.
Social Capital Value & Social Capital Scores
A new metric, Social Capital Value (SCV), has been introduced to identify high-quality trending broadcasts. SCV incorporates the authority of users, measured by another metric, Social Capital Scores (SCS), who engage with the broadcast based on on-chain data.
For additional information on SCV and SCS, please refer to the following section here.
To access the Airstack APIs in other languages, you can use https://api.airstack.xyz/gql as your GraphQL endpoint.
Fetch Trending Casts Of Certain Farcaster Channel
Once you have the criteria, channelUrl, and timeFrame parameters prepared, simply use the query below and add the parameters as variables:
If you don't know the channel's URL, then find the channel's URL with this query here. The url field will return you the channel's URL associated with the given channel ID.
{"data": {"TrendingCasts": {"TrendingCast": [ {"criteria":"social_capital_value","criteriaCount":3.662080821405,"hash":"0x0a57a54058eacf39b72f89a4f8fa3452cfd7b792","id":"0x0a57a54058eacf39b72f89a4f8fa3452cfd7b792","castValueFormatted":3.662080821405,"castValueRaw":"366208082138","timeFrom":"2024-05-15T13:50:00Z","timeTo":"2024-05-15T14:10:00Z","cast": { "text": "Airstack is building a ton of tools for channels hosts and users right now \n\nUser facing tools/products not just APIs\n\nWe believe thereβs a lot we can uniquely contribute in this area and we hope to make a helpful impact",
"mentions": [],"embeds": [],"url":"https://warpcast.com/betashop.eth/0x0a57a540" } }// Other trending Farcaster casts on /airstack channel ] } }}
π π₯³ Congratulations you've just fetched all the trending Farcaster casts of a certain Farcaster channel and integrate it into your application!
Developer Support
If you have any questions or need help regarding integrating or building trending casts of a certain channel into your application, please join our Airstack's Telegram group.
This will calculate and sort the Farcaster casts based on the chosen criteria:
- social_capital_value(Recommended): the associated with the cast
- likes: number of likes on the cast
- recasts: number of recasts on the cast
- replies: number of replies on the cast
- likes_recasts_replies: number of total likes, recasts, and replies on the cast combined
Specify the channel URL where you want to fetch the trending cast.
If you don't know the channel's URL, then find the channel's URL with this query . The url field will return you the channel's URL associated with the given channel ID.