đĢSocial Capital
Learn how to fetch Social Capital Scores and Ranks of Farcaster users, and how to fetch Social Capital Values of Farcaster casts.
Table Of Contents
In this guide you will learn how to use Airstack to:
Social Capital Scores
Social Capital Scores (SCS) are a measure of each Farcaster user's influence in the network.
This score is derived from a variety of onchain criteria (including Farcaster Hubs). Users with higher SCSs have more positive downstream influence, as their actions and engagements tends to result in higher quality overall engagement.
User's rank for their SCS is represented by Social Capital Rank (SCR).
Currently, the SCS is powered by a proprietary algorithm from Airstack. This algorithm is kept confidential to prevent manipulation.
Over time, we aim to refine the SCS based on its performance and eventually release it as an open-source protocol.
Social Capital Value
Social Capital Value (SCV) is a metric developed by Airstack to identify high-quality Trending Casts on Farcaster.
The SCS of a user impacts the SCV of a cast when the user engages with it. The type of engagement also plays a role. The accumulated SCS of all interactions contributes to the cast's overall SCV. Casts are then ranked by their SCV, promoting higher-quality casts.
Pre-requisites
An Airstack account
Basic knowledge of GraphQL
Get Started
JavaScript/TypeScript/Python
If you are using JavaScript/TypeScript or Python, Install the Airstack SDK:
React
Node
Then, add the following snippets to your code:
Other Programming Languages
To access the Airstack APIs in other languages, you can use https://api.airstack.xyz/gql as your GraphQL endpoint.
Get A Farcaster User's Social Capital Score
You can use Socials
API to fetch a Farcaster user's social capital score by providing the Farcaster user's fname or fid (check here for identity formats) to the identity
input:
Try Demo
Code
Get A Farcaster User's Social Capital Rank
You can use Socials
API to fetch a Farcaster user's social capital rank by providing the Farcaster user's fname or fid (check here for identity formats) to the identity
input:
Try Demo
Code
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
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.
Try Demo
Code
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
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
Get A Farcaster Casts's Social Capital Value
You can use FarcasterCasts
API to fetch a Farcaster cast's social capital value by providing the Warpcast URL to the url
input:
Alternatively, you can also use the hash
input filter and provide the cast hash if you have the cast hash value.
Try Demo
Code
Developer Support
If you have any questions or need help regarding fetching Social Capital data, please join our Airstack's Telegram group.
More Resources
Last updated
Was this helpful?