# Crypto ETF Flows - Bitcoin & Ether Spot ETF Daily Flows (`automatic/crypto-etf-flows`) Actor

BTC and ETH spot-ETF flow tracker: daily net inflows and outflows per issuer plus daily totals over a lookback window, with latest-day snapshot, window aggregates and reconciliation in the run summary. The institutional-demand signal for bitcoin and ether. Fresh data every run.

- **URL**: https://apify.com/automatic/crypto-etf-flows.md
- **Developed by:** [Philip Kirkbride](https://apify.com/automatic) (community)
- **Categories:** Business
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 90.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 result rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Crypto ETF Flows

### Quick Start

Collect daily net flows for BTC and ETH spot ETFs, broken down by issuer, plus each day's total.
Use it to track institutional demand for Bitcoin and Ethereum in dashboards, research, and alerts.
Start with this minimal input:

```json
{"asset": "btc", "days": 30}
```

Data comes from Farside Investors' published ETF flow tables.

### Input

| Name | Type | Default | What it does |
| --- | --- | --- | --- |
| `asset` | string | `btc` | Which ETF flow table to read: `btc` (12 issuers) or `eth` (11 issuers). |
| `days` | integer | `30` | Calendar days of history to emit, anchored on the newest published row. |
| `alertAbsTotalFlowM` | number | `0` | When > 0, each day whose total net flow magnitude reaches this many USD millions sends one Telegram alert. Each crossing day alerts once, ever. `0` disables alerts. |
| `telegramBotToken` | string | empty | Secret bot token for alerts; falls back to the `TELEGRAM_BOT_TOKEN` environment variable. |
| `telegramChatId` | string | empty | Chat that receives the alerts. |

### Output

One dataset record per trading day (oldest to newest): `recordKey`, `source`, `kind`, `asset`, `date`, per-issuer flow fields in USD millions (`flowIBIT`, `flowFBTC`, …; negative = outflow), `totalNetFlowM`, `sourceUrl`, `collectedAt`.

The run summary (KeyValue store `OUTPUT`) reports the latest-day snapshot, window aggregates (inflow/outflow/zero days), a totals reconciliation, the alert report, and any warnings. `records` counts only the rows stored in the dataset; if your maximum charge per run stops the run early, `stoppedBy` is `chargeLimit` and the summary line says how many flow records were stored.

### Output example

A real record from a run with the Quick Start input:

```json
{"recordKey":"farside:btc:2026-09-23","source":"farside.co.uk","kind":"etf_flow","asset":"BTC","date":"2026-09-23","flowIBIT":166.3,"flowFBTC":143.2,"flowBITB":0,"flowARKB":5,"flowBTCO":0,"flowEZBC":0,"flowBRRR":0,"flowHODL":0,"flowBTCW":0,"flowMSBT":32.4,"flowGBTC":0,"flowBTC":0,"totalNetFlowM":346.9,"sourceUrl":"https://farside.co.uk/bitcoin-etf-flow-all-data/","collectedAt":"2026-10-21T06:06:58.773239+00:00"}
```

### FAQ

**How fresh is the data?** Flows publish per trading day (US market hours). Weekends and US holidays have no rows, and the newest row can lag "today" by a business day.

**How far back does history go?** BTC since 2024-01-11 and ETH since 2024-07-23; set `days` up to 1096.

**What if an issuer has no data for a day?** It is returned as explicit `null`, never guessed. Newly launched ETFs appear as new columns and are handled gracefully.

**Do alerts repeat?** No. Each threshold-crossing day is delivered once; scheduled runs never re-alert historical crossings still inside the window.

### Price

**$0.002 per result row** (one trading day), plus **$0.005 per run start**. The run-start event is charged per GB of memory; the default 512 MB run is one start event. The start is charged even if the run saves no rows. You are charged only for result rows that are actually saved to the dataset; if fetching or validation fails, no rows are saved and none are charged. Platform usage is included in these prices.

For support, contact Apify support and include the Actor run ID.

# Actor input Schema

## `asset` (type: `string`):

Which Farside ETF flow table to parse: btc (12 issuers, history since 2024-01-11) or eth (10 issuers, since 2024-07-23).

## `days` (type: `integer`):

How many calendar days of flow rows to emit, anchored on the newest published row (weekends have no rows; 30 days ≈ 21-22 flow rows). One request returns the whole history either way — a longer window never costs another request.

## `alertAbsTotalFlowM` (type: `number`):

When > 0, every flow day in the window whose total net flow magnitude is at or above this many USD millions sends one inline Telegram alert ('BTC ETF flows 2026-09-04: +174.6M USD (top inflow IBIT +117.4M, …)'). The threshold is symmetric: big outflow days count too. 0 (the default) disables alerts entirely.

## `telegramBotToken` (type: `string`):

Bot token for the flow alerts — a secret: never share runs or datasets that expose it. Falls back to the TELEGRAM_BOT_TOKEN secret environment variable when empty. Never printed; masked in any warning line.

## `telegramChatId` (type: `string`):

Telegram chat id for the flow alerts. With telegramBotToken (or TELEGRAM_BOT_TOKEN) and alertAbsTotalFlowM > 0, each threshold-crossing day sends one inline message. A failed or skipped send is a warning, never a failed run.

## Actor input object example

```json
{
  "asset": "btc",
  "days": 30,
  "alertAbsTotalFlowM": 0,
  "telegramBotToken": "",
  "telegramChatId": ""
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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 = {
    "asset": "btc",
    "days": 30,
    "alertAbsTotalFlowM": 0,
    "telegramBotToken": "",
    "telegramChatId": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/crypto-etf-flows").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 = {
    "asset": "btc",
    "days": 30,
    "alertAbsTotalFlowM": 0,
    "telegramBotToken": "",
    "telegramChatId": "",
}

# Run the Actor and wait for it to finish
run = client.actor("automatic/crypto-etf-flows").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 '{
  "asset": "btc",
  "days": 30,
  "alertAbsTotalFlowM": 0,
  "telegramBotToken": "",
  "telegramChatId": ""
}' |
apify call automatic/crypto-etf-flows --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automatic/crypto-etf-flows"
        }
    }
}
```

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/vvXsv1Q2qxpS8J6Je/builds/5Gg7GtZFMBcDXSpos/openapi.json
