介绍
# Crypto Sentiment Widget
**一目了然的市场情绪。** 适用于加密货币仪表板和交易应用的可嵌入“恐惧与贪婪”指数。
即插即用的 React 和 HTML 组件。实时更新。无需 API 密钥。由 Strykr PRISM 提供支持。
## 快速使用
```bash # Get current Fear & Greed value ./fear-greed.sh
# Get JSON output ./fear-greed.sh --json
# Get historical data ./fear-greed.sh --history ```
## PRISM 端点
| 端点 | 描述 | 速度 | |----------|-------------|-------| | `GET /market/fear-greed` | 当前指数 | 229ms |
## 指数值
| 范围 | 标签 | 含义 | |-------|-------|---------| | 0-25 | 极度恐惧 | 买入机会? | | 26-45 | 恐惧 | 谨慎 | | 46-55 | 中性 | 观望 | | 56-75 | 贪婪 | 获利了结? | | 76-100 | 极度贪婪 | 可能见顶 |
## 输出格式
### 终端(默认) ``` 📊 Crypto Fear & Greed Index
┌─────────────────────┐ │ │ │ 72 │ │ GREED │ │ │ │ ████████████████░░ │ │ │ └─────────────────────┘
Last updated: 2026-01-28 13:15 UTC ```
### JSON ```json { "value": 72, "label": "Greed", "timestamp": "2026-01-28T13:15:00Z" } ```
## 组件变体
### 1. 仪表盘(圆形) ``` ╭───────╮ ╱ 72 ╲ │ GREED │ ╲ ╱ ╰───────╯ ```
### 2. 进度条(水平) ``` Fear & Greed: 72 (Greed) ████████████████░░░░░░░░░░ ```
### 3. 徽章(紧凑) ``` ┌────────┐ │ FG: 72 │ │ 😀 │ └────────┘ ```
## 嵌入选项
### React 组件 ```jsx import { FearGreedGauge } from '@strykr/fear-greed-widget';
function Dashboard() { return ( <FearGreedGauge theme="dark" size="md" variant="gauge" refreshInterval={300000} // 5 minutes /> ); } ```
### HTML 嵌入 ```html <div id="fear-greed-widget"></div> <script src="https://cdn.strykr.com/fear-greed.js"></script> <script> StrykrWidget.FearGreed({ element: '#fear-greed-widget', theme: 'dark', variant: 'gauge' }); </script> ```
### iframe ```html <iframe src="https://widgets.strykr.com/fear-greed?theme=dark&variant=gauge" width="200" height="200" frameborder="0" ></iframe> ```
## 主题
| 主题 | 背景 | 文本 | |-------|------------|------| | `dark` | #0D0D0D | #F5F3EF | | `light` | #FFFFFF | #1A1A1A | | `transparent` | none | auto |
## 自动刷新
组件默认每 5 分钟自动刷新一次。
```javascript // Custom refresh interval (in milliseconds) FearGreedGauge({ refreshInterval: 60000 }) // 1 minute ```
## 用例
1. **交易仪表板** — 快速情绪检查 2. **博客/通讯** — 嵌入市场更新 3. **Discord 服务器** — 每日情绪机器人 4. **投资组合应用** — 上下文指标
## 环境变量
```bash PRISM_URL=https://strykr-prism.up.railway.app ```
---
由 [@NextXFrontier](https://x.com/NextXFrontier) 构建