站长专用组件 & API
一行代码为任何网站添加实时加密行情。免费、开源、支持跨域。
CORSiframeREST API无需注册免费
快速开始
复制以下代码到你的 HTML 中:
<script src="https://orbit.biyijia.com/widget.js" data-mode="inline" data-coins="BTC,ETH,SOL" data-tf="24h"> </script>
使用示例
配置参数
| 属性 | 可选值 | 默认 | 说明 |
|---|---|---|---|
| data-mode | "inline" | "sidebar" | "floating" | "hooks" | "inline" | 组件显示模式 |
| data-coins | "BTC,ETH,SOL,..." | Top 30 | 逗号分隔的币种符号 |
| data-tf | "1h" | "24h" | "7d" | "1y" | "24h" | 涨跌幅时间周期 |
| data-width | number (px) | 700 | 内嵌模式宽度 |
| data-height | number (px) | 450 | 内嵌模式高度 |
| data-position | "left" | "right" | "bottom-left" | "bottom-right" | "right" | 面板/按钮位置 |
| data-label | string | "📈 Crypto" | 浮动按钮文字 |
| data-sidebar | "true" | "false" | "false" | hooks 模式是否显示侧边栏 |
API 接口
所有 API 接口支持跨域请求(CORS),无需 API Key 或认证。
GET
https://orbit.biyijia.com/api/coins参数:
per_page=60实时币价、交易量、1h/24h/7d 涨跌幅
GET
https://orbit.biyijia.com/api/klines参数:
symbol=BTC&interval=1h&limit=24OHLCV K线数据
GET
https://orbit.biyijia.com/api/fng恐惧贪婪指数
币种数据结构
{
"id": "btc",
"symbol": "BTC",
"name": "Bitcoin",
"current_price": 67432.50,
"market_cap": 1325678900000, // 24h交易量作为代理值
"market_cap_rank": 1,
"total_volume": 1325678900000,
"price_change_percentage_1h_in_currency": 0.35,
"price_change_percentage_24h_in_currency": 2.18,
"price_change_percentage_7d_in_currency": -1.42,
"price_change_percentage_1y_in_currency": null,
"high_24h": 68100.00,
"low_24h": 66200.00,
"circulating_supply": null,
"total_supply": null,
"ath": null,
"ath_change_percentage": null
}注意事项
- 数据每 60 秒自动刷新。
- 数据源:币安现货市场,价格以 USDT 计价。
- 所有接口免费使用,无需 API Key。
- 完整支持 CORS 跨域 — 可从任何域名调用,包括 file:// 协议。
- 组件脚本轻量(约 30KB),异步加载不阻塞页面。
- 建议将 script 标签放在你希望组件出现的位置。
- 同一页面可放置多个组件,各自使用不同配置。