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

# Get Top Gainers & Losers

Retrieves top gaining and losing cryptocurrencies by price change percentage (Pro plan exclusive). Returns up to 30 gainers and 30 losers; filterable by duration (1h-1y) and market cap rank. Ideal for: market movers alerts, identifying momentum plays, daily/weekly performance summaries.

![Get Top Gainers & Losers logo](https://ai-icon.b3.fun/logo/coingecko)
Catalog action Blockchain Data

Retrieves top gaining and losing cryptocurrencies by price change percentage (Pro plan exclusive). Returns up to 30 gainers and 30 losers; filterable by duration (1h-1y) and market cap rank. Ideal for: market movers alerts, identifying momentum plays, daily/weekly performance summaries.


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `coingecko-get-top-gainers-losers` |
| Category | Blockchain Data |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `coingecko`, `gainers`, `losers`, `movers`, `price-change`, `cryptocurrency`, `read` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `vsCurrency` | `string` | No | Target currency for prices \(e.g., 'usd', 'eur', 'btc'\). Default: 'usd'. Use token_lookup\(query_type='currencies'\) for valid options. |
| `duration` | `string` | No | Time duration for calculating price change percentage. Options: 1h \(1 hour\), 24h \(1 day\), 7d \(1 week\), 14d \(2 weeks\), 30d \(1 month\), 60d \(2 months\), 1y \(1 year\). Default: 24h |
| `topCoins` | `string` | No | Filter by market cap rank. Options: '300' \(top 300\), '500' \(top 500\), '1000' \(top 1000\), 'all' \(all coins\). Default: '1000'. Only includes coins with $50K+ 24h volume. |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `topGainers` | `array` | Yes | Top gaining coins \(up to 30\), sorted by price change percentage descending |
| `topLosers` | `array` | Yes | Top losing coins \(up to 30\), sorted by price change percentage ascending |

## Examples

**Workflow node**

```json
{
  "type": "coingecko-get-top-gainers-losers",
  "payload": {
    "vsCurrency": "usd",
    "duration": "24h",
    "topCoins": "1000"
  },
  "children": []
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/coingecko-get-top-gainers-losers/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "vsCurrency": "usd",
    "duration": "24h",
    "topCoins": "1000"
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.