Skip to main content
Pinata gives you the ability to query uploaded files based on different filters and attributes such as name, key-values, date, and more. This is different from retrieving the actual contents of a file, which you can learn more about here.

Basic Usage

You can either use the SDK or the API as see in the examples below.
This will return an array of file objects

Filters

When listing files there a few ways you can filter the results

name

  • Type: string
Filter results based on name

group

  • Type: string
Filter results based on group ID

noGroup

  • Type: boolean
Filter results to only show files that are not part of a group

cid

  • Type: string
Filter results based on CID

mimeType

  • Type: string
Filter results based on mime type

keyvalues

  • Type: Record<string | string>
Filter results based on keyvalue pairs in metadata

order

  • Type: "ASC" | "DESC"
Order results either ascending or descending by created date

limit

  • Type: number
Limit the number of results

cidPending

  • Type: boolean
Filters results and only returns files where cid is still pending

Auto Paginate (SDK)

The list method has an auto pagination feature that is triggered when used inside a for await iterator
Works like magic ✨