> ## Documentation Index
> Fetch the complete documentation index at: https://docs.resq.software/llms.txt
> Use this file to discover all available pages before exploring further.

# ResQ.Storage.PinataClient.ListPinsAsync(string,int,System.Threading.CancellationToken)

### [ResQ.Storage](./ResQ.Storage.md "ResQ.Storage").[PinataClient](./ResQ.Storage.PinataClient.md "ResQ.Storage.PinataClient")

## PinataClient.ListPinsAsync(string, int, CancellationToken) Method

Lists pinned files with optional name prefix filtering.

```csharp theme={null}
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<ResQ.Storage.PinMetadata>> ListPinsAsync(string? namePrefix=null, int limit=100, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
```

#### Parameters

<a name="ResQ.Storage.PinataClient.ListPinsAsync(string,int,System.Threading.CancellationToken).namePrefix" />

`namePrefix` [System.String](https://learn.microsoft.com/en-us/dotnet/api/system.string "System.String")

Optional prefix to filter pins by name. If null or empty, returns all pins.

<a name="ResQ.Storage.PinataClient.ListPinsAsync(string,int,System.Threading.CancellationToken).limit" />

`limit` [System.Int32](https://learn.microsoft.com/en-us/dotnet/api/system.int32 "System.Int32")

Maximum number of results to return (default 100).

<a name="ResQ.Storage.PinataClient.ListPinsAsync(string,int,System.Threading.CancellationToken).cancellationToken" />

`cancellationToken` [System.Threading.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken "System.Threading.CancellationToken")

Cancellation token for the operation.

Implements [ListPinsAsync(string, int, CancellationToken)](./ResQ.Storage.IStorageClient.ListPinsAsync\(string,int,System.Threading.CancellationToken\).md "ResQ.Storage.IStorageClient.ListPinsAsync(string, int, System.Threading.CancellationToken)")

#### Returns

[System.Threading.Tasks.Task\<](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 "System.Threading.Tasks.Task`1")[System.Collections.Generic.IReadOnlyList\<](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1 "System.Collections.Generic.IReadOnlyList`1")[PinMetadata](./ResQ.Storage.PinMetadata.md "ResQ.Storage.PinMetadata")[>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1 "System.Collections.Generic.IReadOnlyList`1")[>](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 "System.Threading.Tasks.Task`1")\
A read-only list of pin metadata matching the filter criteria.

#### Exceptions

[System.ArgumentOutOfRangeException](https://learn.microsoft.com/en-us/dotnet/api/system.argumentoutofrangeexception "System.ArgumentOutOfRangeException")\
Thrown when limit is less than 1.

[System.OperationCanceledException](https://learn.microsoft.com/en-us/dotnet/api/system.operationcanceledexception "System.OperationCanceledException")\
Thrown when the operation is cancelled.

### Example

```csharp theme={null}
// List all pins
var allPins = await storage.ListPinsAsync();

// List pins with specific prefix
var evidencePins = await storage.ListPinsAsync("evidence-", limit: 50);
foreach (var pin in evidencePins)
{
    Console.WriteLine($"{pin.Name}: {pin.Cid}");
}
```

### Remarks

This method queries the Pinata API for pinned content. Results include metadata
about each pin including CID, name, size, and custom key-value pairs.
