# Balancer Scraper (`dadhalfdev/balancer-scraper`) Actor

Scrape Balancer liquidity pools from balancer.fi. Use filters or paste a Balancer URL — the URL wins when set. Returns TVL, volume, fees, APR, tokens, and chain.

- **URL**: https://apify.com/dadhalfdev/balancer-scraper.md
- **Developed by:** [Marco Rodrigues](https://apify.com/dadhalfdev) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## ⚖️ Balancer Scraper

Want [Balancer](https://balancer.fi/pools) liquidity pools in a spreadsheet? This scraper makes it easy.

Use **structured filters** (chain, pool type, v2/v3, tags, min TVL) — structured filters work better for AI agents — **or** paste an **`input_url`** from Balancer once you've already filtered in the browser. When `input_url` is set it overrides the filters below.

Balancer currently has about **9,800 live pools** across Ethereum and L2s. This actor returns up to 2000 rows per run. Blacklisted pools and Sepolia are excluded.

### 💡 Perfect for...

- **LPs:** Compare Weighted, Stable, Gyro, CoW AMM, and AutoRange pools by TVL and APR.
- **Dashboards:** Track Balancer TVL, 24h volume, fees, and APR without clicking the table.
- **Market research:** Slice Balancer by chain, protocol version, or tags like incentivized / boosted / RWA.
- **Data analysts:** Export structured Balancer pool rows with public pool URLs.
- **🤖 AI Agents:** Power bots and OpenClaw workflows with live Balancer results.
- **📚 RAG Systems:** Feed pool titles, tokens, and metrics into retrieval pipelines.
- **🔗 AI Workflows:** Plug into LangChain, AutoGPT, CrewAI, and similar stacks.

### ✨ Why you'll love this scraper

- 🔗 **Input URL or Filters:** Paste a Balancer `/pools` URL (`input_url`) if you already filtered in the browser, or use structured filters (better for AI agents). `input_url` always wins when set.
- 🎯 **Website-Matched Filters:** Same networks, pool types, tags, min TVL, and TVL / Volume / APR sort as balancer.fi/pools.
- 🌐 **Multi-chain DEX:** Ethereum, Arbitrum, Base, Optimism, Polygon, Gnosis, and the rest of Balancer (~9,800 pools).

### 📦 What's inside the data?

Every row includes all of these fields:

- **Core:** `id`, `url`, `title`, `symbol`, `address`, `chain`, `chain_id`, `pool_type`, `type`, `protocol_version`
- **Tokens:** `tokens`, `token_addresses`, `token_weights`
- **Liquidity:** `tvl_usd`, `volume_24h_usd`, `fees_24h_usd`, `swap_fee`, `holders`, `total_shares`
- **Returns:** `apr`
- **Meta:** `tags`, `factory`, `created_at`

### 🚀 Quick start

**Option A — Input URL**

1. Open [Balancer pools](https://balancer.fi/pools), apply filters, copy the URL — e.g. `https://balancer.fi/pools?networks=MAINNET&poolTypes=WEIGHTED&minTvl=10000&orderBy=totalLiquidity`.
2. Paste it into `input_url`.
3. Set `max_results` and click **Start**.

**Option B — Structured filters (better for AI agents)**

1. Leave `input_url` empty.
2. Optionally pick chain, pool type, v2/v3, tag, and min TVL.
3. Set `max_results` (up to 2000) and click **Start**.

***

#### Tech details for developers 🧑‍💻

**Input Example (filters):**

```json
{
  "chain_name": "mainnet",
  "pool_type": "weighted",
  "min_tvl": 10000,
  "sort": "totalLiquidity",
  "max_results": 100
}
```

**Input Example (URL override):**

```json
{
  "input_url": "https://balancer.fi/pools?networks=BASE&poolTypes=STABLE&orderBy=apr",
  "max_results": 50
}
```

**Output Example:**

```json
{
  "id": "0x3de27efa2f1aa663ae5d458857e731c129069f29000200000000000000000588",
  "url": "https://balancer.fi/pools/ethereum/v2/0x3de27efa2f1aa663ae5d458857e731c129069f29000200000000000000000588",
  "title": "20wstETH-80AAVE",
  "symbol": "20wstETH-80AAVE",
  "address": "0x3de27efa2f1aa663ae5d458857e731c129069f29",
  "chain": "Ethereum",
  "chain_id": "MAINNET",
  "pool_type": "Weighted",
  "type": "WEIGHTED",
  "protocol_version": 2,
  "tokens": ["wstETH", "AAVE"],
  "token_addresses": ["0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0", "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9"],
  "token_weights": [0.2, 0.8],
  "tvl_usd": 10368081.22,
  "volume_24h_usd": 156823.42,
  "fees_24h_usd": 457.92,
  "apr": 1.24,
  "swap_fee": 0.00292,
  "holders": 57,
  "total_shares": "52543.413385706400275722",
  "tags": [],
  "factory": "0x897888115ada5773e02aa29f775430bfb5f34c51",
  "created_at": "2023-07-10T12:58:23+00:00"
}
```

**Output fields:**

| Field | Description |
|-------|-------------|
| `id` | Balancer pool id (used in the public URL). |
| `url` | Public pool page on balancer.fi. |
| `title` | Pool name. |
| `symbol` | Pool symbol. |
| `address` | Pool contract address. |
| `chain` | Human chain name, e.g. `Ethereum`. |
| `chain_id` | Balancer chain enum, e.g. `MAINNET`. |
| `pool_type` | Website label, e.g. `Weighted`, `Stable`, `Gyro`. |
| `type` | Raw Balancer type, e.g. `WEIGHTED`. |
| `protocol_version` | `2` or `3`. |
| `tokens` | Token symbols in the pool. |
| `token_addresses` | Token contracts. |
| `token_weights` | Token weights (0–1) when the pool has them. |
| `tvl_usd` | Total value locked in USD. |
| `volume_24h_usd` | 24-hour volume in USD. |
| `fees_24h_usd` | 24-hour fees in USD. |
| `apr` | Sum of Balancer APR items, as a percent. |
| `swap_fee` | Swap fee as a decimal (0.0025 = 0.25%). |
| `holders` | Number of LP holders. |
| `total_shares` | Total LP shares. |
| `tags` | Pool tags such as `INCENTIVIZED` or `BOOSTED`. |
| `factory` | Factory contract. |
| `created_at` | Pool create time (UTC ISO). |

### 📋 Input reference (detailed)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `input_url` | string | No | — | Paste a Balancer `/pools` or pool-detail URL; overrides filters when set. |
| `search` | string | No | — | Name, symbol, or token search. |
| `chain_name` | string enum | No | all | Network slug, e.g. `mainnet`, `base`, `arbitrum`. |
| `pool_type` | string enum | No | all | `weighted`, `stable`, `gyro`, `cow_amm`, `fx`, `quant_amm_weighted`, `autorange`, `liquidity_bootstrapping`. |
| `protocol_version` | string enum | No | all | `2` or `3`. |
| `tag` | string enum | No | all | `incentivized`, `ve8020`, `points`, `boosted`, `rwa`, `dynamic_eclp`. |
| `min_tvl` | integer | No | — | Minimum TVL in USD. |
| `sort` | string enum | No | `totalLiquidity` | `totalLiquidity`, `volume24h`, `apr`, or `fees24h`. |
| `sort_direction` | string enum | No | `desc` | `desc` or `asc`. |
| `max_results` | integer | No | `50` | Maximum rows (`1`–`2000`). |

#### Notes on filters

- Prefer exact enum strings from the Apify input dropdowns (same labels as balancer.fi/pools).
- `input_url` always wins over filters when provided.
- Query params such as `networks=MAINNET`, `poolTypes=WEIGHTED`, `minTvl=10000`, and `orderBy=apr` are mapped automatically.
- Blacklisted pools are always excluded. Sepolia is excluded unless you open a Sepolia pool URL.

# Actor input Schema

## `input_url` (type: `string`):

Paste a Balancer pools URL (e.g. https://balancer.fi/pools?networks=MAINNET\&poolTypes=WEIGHTED\&minTvl=10000\&orderBy=totalLiquidity) or a pool URL like https://balancer.fi/pools/ethereum/v2/0x…. Overrides every filter when set.

## `search` (type: `string`):

Same idea as the pools search box (name, symbol, or token). Ignored when input\_url is set.

## `chain_name` (type: `string`):

Same network filter as on balancer.fi/pools. Sepolia is excluded. Ignored when input\_url is set.

## `pool_type` (type: `string`):

Same pool-type chips as on balancer.fi/pools. Ignored when input\_url is set.

## `protocol_version` (type: `string`):

Balancer v2 or v3, same as the site version filter. Ignored when input\_url is set.

## `tag` (type: `string`):

Same pool tags as on balancer.fi/pools (incentivized, boosted, RWA, and so on). Ignored when input\_url is set.

## `min_tvl` (type: `integer`):

Same idea as the site min TVL filter. Ignored when input\_url is set.

## `sort` (type: `string`):

Same idea as clicking TVL, Volume (24h), or APR on the pools table.

## `sort_direction` (type: `string`):

High to low or low to high.

## `max_results` (type: `integer`):

How many rows to return (1–2000). Balancer has about 9,800 live pools.

## Actor input object example

```json
{
  "chain_name": "",
  "pool_type": "",
  "protocol_version": "",
  "tag": "",
  "sort": "totalLiquidity",
  "sort_direction": "desc",
  "max_results": 50
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view of scraped pools using the dataset 'overview' view.

## `results` (type: `string`):

All scraped pools from the default dataset without view transformation.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("dadhalfdev/balancer-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("dadhalfdev/balancer-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call dadhalfdev/balancer-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dadhalfdev/balancer-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/hQKGcfq8wMalF1QmM/builds/oCQBZTSMGbYYg5t5o/openapi.json
