Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
linxiaowu-stock-api
Advanced tools
Readme
在原有的功能上加上支持基金查询,目前测试了一下只有腾讯的接口支持,所以暂时加在腾讯的接口上 使用 FUND100032 即可查到对应的基金
一款聚焦在 股票实时数据
和 周边相关服务
的接口小助手。
名称 | 接口名 | 搜索股票代码 | 获取股票实时数据 | 获取股票组实时数据 | 官网 |
---|---|---|---|---|---|
网易财经 | netease | 已实现 | 已实现 | 已实现 | 传送门 |
雪球 | xueqiu | 已实现 | 已实现 | 已实现 | 传送门 |
新浪股票 | sina | 已实现 | 已实现 | 已实现 | 传送门 |
腾讯股票 | tencent | 已实现 | 已实现 | 已实现 | 传送门 |
npm install stock-api
yarn add stock-api
由于每个交易所数据规则不一样,为了能统一规范对代码定义了规则 交易所+股票代码
。
交易所 | 代号 | 实例 |
---|---|---|
上海交易所 | SH | SH000001 |
深圳交易所 | SZ | SZ399001 |
香港交易所 | HK | HKHSI |
美国交易所 | US | USDJI |
import { stocks } from "stock-api";
// 数据源
const sina = stocks.sina;
const xueqiu = stocks.xueqiu;
const netease = stocks.netease;
const tencent = stocks.tencent;
import { stocks } from "stock-api";
// 获取股票组实时数据
stocks.sina.searchStocks(["510500"]).then(console.log);
[{
code: 'SH510500',
name: '500ETF',
percent: 0.028383,
now: 7.174,
low: 6.93,
high: 7.184,
yesterday: 6.976
}]
import { stocks } from "stock-api";
// 获取股票实时数据
stocks.sina.getStock("SH510500").then(console.log);
{
code: 'SH510500',
name: '500ETF',
percent: 0.028383,
now: 7.174,
low: 6.93,
high: 7.184,
yesterday: 6.976
}
import { stocks } from "stock-api";
// 获取股票组实时数据
stocks.sina.getStocks(["SH510500"]).then(console.log);
[{
code: 'SH510500',
name: '500ETF',
percent: 0.028383,
now: 7.174,
low: 6.93,
high: 7.184,
yesterday: 6.976
}]
韭菜小猪也有暴富梦~
FAQs
The npm package linxiaowu-stock-api receives a total of 4 weekly downloads. As such, linxiaowu-stock-api popularity was classified as not popular.
We found that linxiaowu-stock-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.