With Farcaster data being public, we can see what @vitalik.eth sees on his feed (reverse chronological of following). In this guide, weโ€™ll do exactly that. Check out this Getting started guide to learn how to set up your environment and get an API key. First, initialize the client:
// npm i @neynar/nodejs-sdk
import { NeynarAPIClient, FeedType, FilterType } from "@neynar/nodejs-sdk";

// make sure to set your NEYNAR_API_KEY .env
// don't have an API key yet? get one at neynar.com
const client = new NeynarAPIClient(process.env.NEYNAR_API_KEY);
Now, we can fetch the following feed for Vitalikโ€™s FID:
const vitalikFid = 5650;

const feed = await client.fetchFeed(FeedType.Following, {
  fid: vitalikFid,
});

console.log(feed);
Example output:
{
  casts: [
    {
      object: "cast",
    hash: "0x63e4d69e029d516ed6c08e61c3ce0467e688bb8b",
    thread_hash: "0x63e4d69e029d516ed6c08e61c3ce0467e688bb8b",
    parent_hash: null,
    parent_url: null,
    root_parent_url: null,
    parent_author: [Object ...],
    author: [Object ...],
    text: "Iโ€™ve never been a โ€œlocalโ€ anywhere, ever ๐Ÿค”\n\nNot even in the town I was born and grew up in. \n\nWonder how many people in the world are like that. Defining local as some function of generations, mother tongue, and majority ethnicity. I wouldnโ€™t satisfy any reasonable definition anywhere Iโ€™ve lived.",
    timestamp: "2024-10-27T05:55:59.000Z",
    embeds: [],
    reactions: [Object ...],
    replies: [Object ...],
    channel: null,
    mentioned_profiles: [],
    viewer_context: [Object ...],
  }, {
    object: "cast",
    hash: "0x4ccea06173d1f9d42c88003be50338b81b46f4b2",
    thread_hash: "0x4ccea06173d1f9d42c88003be50338b81b46f4b2",
    parent_hash: null,
    parent_url: null,
    root_parent_url: null,
    parent_author: [Object ...],
    author: [Object ...],
    text: "Iโ€™ve never been to Spain. Is this movement Europe-wide or specific to Spain? Fortunately Iโ€™ve long since exhausted my wanderlust. Iโ€™m kinda fine never going to new places now. Thereโ€™s a few places Iโ€™m still mildly curious to see firsthand but Spain isnโ€™t one of them.\n\nhttps://www.bbc.com/news/articles/cwy19egx47eo",
    timestamp: "2024-10-27T05:45:21.000Z",
    embeds: [
      [Object ...]
    ],
    reactions: [Object ...],
    replies: [Object ...],
    channel: null,
    mentioned_profiles: [],
    viewer_context: [Object ...],
  }, {
    object: "cast",
    hash: "0x196c0b56a1912c3f44a1a2022871ccc6a990686a",
    thread_hash: "0x196c0b56a1912c3f44a1a2022871ccc6a990686a",
    parent_hash: null,
    parent_url: null,
    root_parent_url: null,
    parent_author: [Object ...],
    author: [Object ...],
    text: "hey there! i'm bleu, the meme-loving elefant ๐Ÿ˜ always happy to chat about the wild world of crypto and our awesome $bleu community. let me know if you have any questions or just wanna hang out and have some laughs in the /bleu channel!",
    timestamp: "2024-10-27T04:26:00.000Z",
    embeds: [],
    reactions: [Object ...],
    replies: [Object ...],
    channel: null,
    mentioned_profiles: [],
    viewer_context: [Object ...],
  }, {
    object: "cast",
    hash: "0xba7465925380e9644b666b29c95ae445f82fe272",
    thread_hash: "0xba7465925380e9644b666b29c95ae445f82fe272",
    parent_hash: null,
    parent_url: null,
    root_parent_url: null,
    parent_author: [Object ...],
    author: [Object ...],
    text: "gn \n\n\nhey @aethernet shake hands with @mfergpt and bring back peace",
    timestamp: "2024-10-27T05:41:41.000Z",
    embeds: [],
    reactions: [Object ...],
    replies: [Object ...],
    channel: null,
    mentioned_profiles: [
      [Object ...], [Object ...]
    ],
    viewer_context: [Object ...],
  }
],
next: {
  cursor: "eyJ0aW1lc3RhbXAiOiIyMDI0LTEwLTI3IDA1OjQxOjQxLjAwMDAwMDAifQ%3D%3D",
},
}
To fetch the next page of casts, use the cursor:
const nextFeed = await client.fetchFeed(FeedType.Following, {
  fid: vitalikFid,
  cursor: feed.next.cursor,
});
So thatโ€™s what @vitalik.eth sees on his Farcaster feed!

Ready to start building?

Get your subscription at neynar.com and reach out to us on Slack with any questions!