# Crypto Fear & Greed + BTC Price, Funding & Risk Signals (`automatic/crypto-fear-greed`) Actor

Daily crypto sentiment and risk panel: Fear & Greed history joined to BTC closes, 1/7/30-day returns, perpetual funding, current open interest, sentiment percentiles and divergence flags. Keyless sources, graceful partial coverage, optional Telegram alerts.

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

## Pricing

from $0.50 / 1,000 daily index readings

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 Fear & Greed + BTC Price, Funding & Risk Signals

Collect the daily Crypto Fear & Greed index (0–100) published by alternative.me, with the provider's classification and a derived regime label for each day. Each run returns up to a year of daily readings plus a summary with the latest value, the change since yesterday and the 7-day average. Use it for sentiment dashboards, market-timing research and extreme-sentiment alerts on Telegram.

Market enrichment is ON by default (`enrichMarket: false` restores index-only collection). Coinbase Exchange public BTC-USD daily candles add completed UTC daily closes and exact calendar 1/7/30-day percentage returns. Hyperliquid public info adds the mean hourly perpetual funding rate (decimal, not annualized), sample count and completeness, plus current open interest in BTC. No keys or paid sources are needed. Source failures preserve every sentiment row with null market values and `enrichmentStatus` notes.

Each row adds `btc` (closeUsd, returnsPct, fundingRateDailyMean, fundingSamples, fundingDayComplete, openInterestBtc, openInterestAsOf, divergence), `sentimentPercentile`, `regimeChanged`, and `enrichmentStatus`. Percentile is the percentage of returned sentiment readings less than or equal to this reading (ties included); it uses only returned readings up to and including that day. `sentimentPercentileBasis` gives the number of readings used; the basis depends on the requested window. Regime change compares adjacent calendar days; the first day or gaps yield null. Divergence flags fear (<=46) with a positive 7-day return or greed (>=55) with a negative return; otherwise aligned, or null without prices.

Limits: reading D uses the candle stamped D-1, which closes at D 00:00 UTC, and 1/7/30-day returns ending at that close. Funding covers the 24 hours before D 00:00 UTC. Today’s row therefore has price and returns when the sources supply those completed candles. Funding means use available hourly samples, with 24 required for a complete day. Venue retention or missing candles leaves gaps; no forward filling. Open interest is only a current snapshot on today's row, with collection timestamp, never historical backfill. Market data sources may be slow or unavailable. If index collection cannot finish, the run fails clearly; unavailable market enrichment retains index rows with warnings. Signals are descriptive research data, not investment advice.

Billing remains one daily row = one default dataset-item charge, including partial rows; there are no extra market rows or custom charge events.

### Quick Start

```json
{"limit": 30, "enrichMarket": true}
```

### Input

| Name | Type | Default | Meaning |
| --- | --- | --- | --- |
| `enrichMarket` | boolean | `true` | Add BTC price, funding and risk signals; unavailable sources yield nulls. |
| `limit` | integer | `10` | Days of history to return, 1–365. |
| `alertExtreme` | boolean | `false` | When true and a Telegram chat is set, sends one alert if the latest day is extreme fear or extreme greed. |
| `telegramBotToken` | string | empty | Secret Telegram bot token for alerts; the `TELEGRAM_BOT_TOKEN` secret environment variable also works. |
| `telegramChatId` | string | empty | Chat that receives the alerts. |

### What it returns

One dataset row per day, oldest to newest:

| Field | Meaning |
| --- | --- |
| `recordKey` | Stable key, `fng:{date}`. |
| `source`, `kind` | Record source and type. |
| `date`, `timestamp` | UTC day of the reading and its Unix timestamp. |
| `value` | Index value, 0–100. |
| `classification` | The provider's own label, unchanged. |
| `regime` | Derived label from `extreme-fear` to `extreme-greed`. |
| `sourceUrl` | Where the reading was published. |
| `collectedAt` | UTC time the reading was collected. |

The run summary (`OUTPUT`) reports the latest reading, the change since yesterday, the 7-day average with its regime, the alert result and any warnings.

### Output example

Illustrative record:

```json
{"recordKey":"fng:2026-09-08","source":"alternative.me","kind":"fear_greed","date":"2026-09-08","timestamp":1788825600,"value":22,"classification":"Extreme Fear","regime":"extreme-fear","sourceUrl":"https://api.alternative.me/fng/","collectedAt":"2026-09-08T12:00:03Z"}
```

### FAQ

**How fresh is the data?** One reading per UTC day, published around 00:00 UTC. Each run returns the newest days available.

**How much history is available?** The series starts on 2018-02-01; each run returns up to 365 days.

**How are the labels chosen?** `classification` is the provider's label, unchanged; `regime` uses boundaries calibrated on the full published history. A mismatch between the two is reported as a warning, never a failure.

**What happens on bad rows?** Malformed days are skipped and named in the run warnings; the rest of the run completes.

### Price

See the Actor's Pricing tab on Apify for current rates.

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

# Actor input Schema

## `limit` (type: `integer`):

How many days of index history to emit (default 10). One request per run returns exactly this many newest daily rows, oldest → newest in the dataset.

## `alertExtreme` (type: `boolean`):

When true and telegramChatId is set, a run whose LATEST day is extreme (value ≤ 25 extreme-fear or ≥ 76 extreme-greed) sends one inline Telegram alert ('Crypto Fear & Greed 2026-09-08: 22/100 Extreme Fear (extreme-fear)'). The daily Apify Schedule is the monitoring loop — one message per extreme day, never per history row. false (the default) disables alerts entirely.

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

Bot token for the extreme-day 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 extreme-day alerts. With alertExtreme true and the latest day extreme, the run sends one inline message. A failed or skipped send is a warning, never a failed run.

## `enrichMarket` (type: `boolean`):

Join Coinbase prices and Hyperliquid funding; source failures retain sentiment rows with null market values.

## Actor input object example

```json
{
  "limit": 10,
  "alertExtreme": false,
  "telegramBotToken": "",
  "telegramChatId": "",
  "enrichMarket": true
}
```

# 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 = {
    "limit": 10,
    "alertExtreme": false,
    "telegramBotToken": "",
    "telegramChatId": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/crypto-fear-greed").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 = {
    "limit": 10,
    "alertExtreme": False,
    "telegramBotToken": "",
    "telegramChatId": "",
}

# Run the Actor and wait for it to finish
run = client.actor("automatic/crypto-fear-greed").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 '{
  "limit": 10,
  "alertExtreme": false,
  "telegramBotToken": "",
  "telegramChatId": ""
}' |
apify call automatic/crypto-fear-greed --silent --output-dataset

```

## MCP server setup

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

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/6jJUPCv3rKsD4xtA5/builds/d4EHZy5rREI3NtgMg/openapi.json
