Skip to main content
Casts in the Farcaster protocol are pruned when user runs out of storage. This guide demonstrates how to archive casts of a specific FID with the Neynar SDK. Check out this Getting started guide to learn how to set up your environment and get an API key. Check out this example repository to see the code in action. First, initialize the client:
Next, let’s make a function to clean the incoming casts:
Then, the function to archive the casts:
Finally, let’s fetch the casts and archive them:
Result: a file called data.ndjson with all the casts of the user with FID 194. It looks something like this:
That’s it! You now can save that in S3 or IPFS for long-term archival!

Ready to start building?

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