@d3fc/d3fc-financial-feed

中文文档
7.1.0发布于 2021/04/29MITTypeScriptESM + CJS零依赖近 30 天下载 6.1万

An API for fetching financial time-series data from different sources including GDAX

原始使用文档
文档目录3 节
  1. Installing
  2. API Reference
  3. GDAX

d3fc-financial-feed

An API for fetching financial time-series data from different sources including GDAX.

Main D3FC package

Installing

npm install @d3fc/d3fc-financial-feed

API Reference

GDAX

import { feedGdax } from 'd3fc-financial-feed';

const gdax = feedGdax()
  .product('BTC-GBP');

gdax()
  .then(data => { console.log(data); });

// [
//   {
//     date: 2016-05-11T08:51:00.000Z,
//     open: 317.99,
//     high: 317.99,
//     low: 317.99,
//     close: 317.99,
//     volume: 0.24
//   },
//   ...
// ]

https://docs.gdax.com/#get-historic-rates

# fc.feedGdax()

Constructs a new GDAX feed.

# feedGdax()

Makes a request to the GDAX API, returns a Promise which resolves with data. Data returned from the API is mapped to an array of objects with numeric open, high, low, close and volume properties, and a Date instance date property.

# feedGdax.product([value])

If value is specified, sets the product id to the specified string and returns this feed instance. If value is not specified, returns the current product id, which defaults to "BTC-USD".

# feedGdax.start([value])

If value is specified, sets the start date to the specified Date object and returns this feed instance. If value is not specified, returns the current start date, which defaults to null.

# feedGdax.end([value])

If value is specified, sets the end date to the specified Date object and returns this feed instance. If value is not specified, returns the current end date, which defaults to null.

# feedGdax.granularity([value])

If value is specified, sets the granularity to the specified number of seconds and returns this feed instance. If value is not specified, returns the current granularity, which defaults to null.

版本与发布记录

@d3fc/d3fc-financial-feed 共发布 17 个版本,首次发布于 2018/08/02;过去 12 个月发布了 0 个版本。

版本发布日期距今
7.1.0latest2021/04/295 年前
7.0.12020/07/146 年前
7.0.02020/04/166 年前
6.1.02020/03/196 年前
6.0.42019/11/286 年前
6.0.32019/09/047 年前

关于 @d3fc/d3fc-financial-feed 的常见问题

@d3fc/d3fc-financial-feed 是什么?

An API for fetching financial time-series data from different sources including GDAX

如何安装 @d3fc/d3fc-financial-feed?

在项目目录运行 npm install @d3fc/d3fc-financial-feed,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:d3-fetch(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@d3fc/d3fc-financial-feed 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@d3fc/d3fc-financial-feed 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@d3fc/d3fc-financial-feed 可以商用吗?

@d3fc/d3fc-financial-feed 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@d3fc/d3fc-financial-feed 的下载量有多少?

根据 npm 官方下载统计,@d3fc/d3fc-financial-feed 在 2026/10/11 – 2026/11/09 这 30 天内被下载 61,420 次,日均约 2,047 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@d3fc/d3fc-financial-feed 还在维护吗?

最新版本 7.1.0 发布于 2021/04/29(5 年前);至今共发布 17 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/08/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。