Archive Casts
Archiving Farcaster data with Neynar
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 Telegram with any questions!