Skip to main content

API endpoint

This tutorial uses the GET v2/feed endpoint
To get the feed for a farcaster user, you traditionally, you have to run a hub or get access to a hosted indexer. You have to fetch the graph of the user, the raw cast data from that graph, mentioned profiles, reactions, profile of the authors, (long list of things…), and stitch it back into the final feed object before you can render it. Thankfully, Neynar’s SDK and APIs make this much simpler!
feed

Fetch feed for a user easily with Neynar SDK

In this example, we will try to get rish’s feed who’s fid is 194. If you know someone’s username, you can find their fid from our user endpoint.

Ensure you have the right environment setup

Make sure to have node.js, typescript (ts) and yarn installed on your machine

Create a new typescript file with the right imports

Initialize the client

Call fetchFeedPage function to get feed

Run your new .ts file

  • Navigate to the right folder in your terminal e.g. cd ./test-sdk
  • Run script by typing yarn start into the terminal

You should now see an output like this

You get all the data in one request, making it easy to display or use in your next operation. If you want to try getting a live response, head over to our API page for v2/feed. You can take the cursor from the output and pass it in the next request to the SDK to page to the next set of results.

Ready to start building?

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