Skip to Content

市场接口

Signal Feed 提供完整的市场数据接口,支持大盘指数、资金流向、市场热力图、资金面分析、全球指数等功能。

基础信息

  • Base URL: http://localhost:4000/api/v1
  • 认证方式: Bearer Token
  • 数据格式: JSON
  • 接口前缀: /market

主要接口

大盘指数

GET /api/v1/market/indices

获取主要股指实时数据。

资金流向

GET /api/v1/market/flow?type=1

按类型获取资金流向数据。type:1 地域 / 2 行业 / 3 概念。

资金流向列表

GET /api/v1/market/flow/list?type=1

按类型获取资金流向明细列表。

市场热力图

GET /api/v1/market/hotmap?quotedata_hash=

获取全市场热力图数据,可选传 quotedata_hash 增量更新。

资金面分析

GET /api/v1/market/fund-analysis

获取资金面分析数据。

全球指数

GET /api/v1/market/global-index

获取全球主要指数行情。

使用示例

const API_TOKEN = 'your_api_token'; const BASE_URL = 'http://localhost:4000/api/v1'; // 获取大盘指数 async function getMarketIndices() { const response = await fetch(`${BASE_URL}/market/indices`, { headers: { 'Authorization': `Bearer ${API_TOKEN}` } }); return response.json(); } // 获取资金流向(按行业) async function getFundFlow(type = 2) { const params = new URLSearchParams({ type: type.toString() }); const response = await fetch(`${BASE_URL}/market/flow?${params}`, { headers: { 'Authorization': `Bearer ${API_TOKEN}` } }); return response.json(); } // 获取市场热力图 async function getMarketHotmap(quotedataHash = '') { const params = quotedataHash ? new URLSearchParams({ quotedata_hash: quotedataHash }) : ''; const url = `${BASE_URL}/market/hotmap${params ? '?' + params : ''}`; const response = await fetch(url, { headers: { 'Authorization': `Bearer ${API_TOKEN}` } }); return response.json(); } // 获取资金面分析 async function getFundAnalysis() { const response = await fetch(`${BASE_URL}/market/fund-analysis`, { headers: { 'Authorization': `Bearer ${API_TOKEN}` } }); return response.json(); } // 获取全球指数 async function getGlobalIndex() { const response = await fetch(`${BASE_URL}/market/global-index`, { headers: { 'Authorization': `Bearer ${API_TOKEN}` } }); return response.json(); }

响应格式

所有接口统一返回以下格式:

{ "success": true, "data": { // 具体数据内容 } }
Last updated on