# selectProviders

> **selectProviders**(`options`): [`ResolvedLocation`](/reference/filoz/synapse-core/warm-storage/interfaces/resolvedlocation/)[]

Defined in: [packages/synapse-core/src/warm-storage/select-providers.ts:32](https://github.com/FilOzone/synapse-sdk/blob/840d7b2c6263846ac51b7558000e62dd68d33a44/packages/synapse-core/src/warm-storage/select-providers.ts#L32)

Select providers for storage from an eligible pool.

The eligible provider pool is determined by `endorsedIds`:
- Non-empty: only providers in this set are considered (use for primary selection)
- Empty: all providers in the `providers` list are considered (use for secondary selection)

Within the eligible pool, providers with an existing metadata-matching
dataset are preferred (reuses payment rail). Otherwise a provider
without a matching dataset is selected (new dataset created on commit).

Within matching datasets, compact datasets sort before legacy ones, then
those with existing pieces sort before empty ones, and older datasets
(lower ID) sort before newer ones.

With `providerId`, the pool is that one provider, whether or not it is
endorsed, and the result is its best matching dataset or a new-dataset
location. The result is empty when the provider is not in `providers` or is
listed in `excludeProviderIds`.

This function does NOT perform health checks. Use
selectReachableProviders() to select providers that answer a ping.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `options` | [`ProviderSelectionOptions`](/reference/filoz/synapse-core/warm-storage/interfaces/providerselectionoptions/) | Pre-fetched chain data and selection parameters |

## Returns

[`ResolvedLocation`](/reference/filoz/synapse-core/warm-storage/interfaces/resolvedlocation/)[]

Ranked array of locations up to `count` length.
  May be shorter if fewer providers are available.
  Empty if no providers match constraints.