Related API: Allocation of user
- 100 cast messages
- 200 reaction messages
- 200 link messages
- 25 user_data messages
- 5 verifications messages
- 2 username_proof messages
lookupUserStorageAllocation function:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Fetch data about a userβs storage allocation on Farcaster network with Neynar
// npm i @neynar/nodejs-sdk
import { NeynarAPIClient, Configuration } 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 config = new Configuration({
apiKey: process.env.NEYNAR_API_KEY,
});
const client = new NeynarAPIClient(config);
const rishFID = 194;
const storageUsage = await client.lookupUserStorageUsage({fid:rishFID});
console.log(storageUsage);
{
object: "storage_usage",
user: {
object: "user_dehydrated",
fid: 194
},
total_active_units: 2,
casts: {
object: "storage",
used: 3707,
capacity: 10000
},
reactions: {
object: "storage",
used: 4984,
capacity: 5000
},
links: {
object: "storage",
used: 472,
capacity: 5000
},
verifications: {
used: 2,
capacity: 25
},
username_proofs: {
used: 1,
capacity: 5
},
signers: {
used: 17,
capacity: 1000
}
}
lookupUserStorageAllocation function:
const storageAllocation = await client.lookupUserStorageAllocations({fid:rishFID});
console.log(storageAllocation);
{
total_active_units: 2,
allocations: [
{
object: "storage_allocation",
user: [Object ...],
units: 2,
expiry: "2024-08-28T22:23:31.000Z",
timestamp: "2023-08-29T22:23:31.000Z"
}
]
}
Related topics
Buy storageReplicator SchemalookupUserStorageAllocationsStorage APISDK v1 to v2 migration guideWas this page helpful?