The Crypto Fear and Greed Index from alternative.me, a daily score from 0 (extreme fear) to 100 (extreme greed).
No keys needed.
api.alternative.me
Use in Studio adds this version to your Data Feeds and opens a Strategy chat with it. It runs on your own Runner when you test it or deploy a Strategy that reads it, in Paper and Live, not in Backtests. Your copy is yours to edit, and later changes to this example don't change it.
# /// turbine-edge-source
# { "contract": 1, "name": "btc_fear_greed", "mode": "hosted", "refresh": "10m", "max_age": "1h",
# "fields": {
# "score": { "type": "number" },
# "mood": { "type": "text", "values": ["extreme_fear", "fear", "neutral", "greed", "extreme_greed"] }
# } }
# ///
# The Crypto Fear and Greed Index from alternative.me: one score from 0
# (extreme fear) to 100 (extreme greed). alternative.me publishes a new score
# once a day; each fetch reports today's score, so it stays fresh while the
# feed is reachable. No key needed.
import json
import urllib.request
URL = "https://api.alternative.me/fng/?limit=1"
MOODS = {
"extreme fear": "extreme_fear",
"fear": "fear",
"neutral": "neutral",
"greed": "greed",
"extreme greed": "extreme_greed",
}
def fetch():
req = urllib.request.Request(URL, headers={"User-Agent": "Turbine Data Feed", "Accept": "application/json"})
with urllib.request.urlopen(req, timeout=8) as resp:
latest = json.load(resp)["data"][0]
out = {"score": float(latest["value"])}
mood = MOODS.get(str(latest.get("value_classification", "")).strip().lower())
if mood:
out["mood"] = mood
return out