【原创】Coinbase 公共数据 API 探索(1):获取可用交易对列表


#1

简介:Coinbase,相信大家都知道,世界顶级数字货币交易所。Coinbase 有非常完备的 API 服务,包括允许开发人员使用OAuth2协议允许Coinbase用户授予第三方应用程序对其帐户的完全或部分访问权限,而无需共享帐户的API密钥或登录凭据。本篇文章介绍开发者如何使用 Coinbase 公共数据 API 获取可用交易对列表。

Coinbase,相信大家都知道,世界顶级数字货币交易所。Coinbase 有非常完备的 API 服务,包括允许开发人员使用OAuth2协议允许Coinbase用户授予第三方应用程序对其帐户的完全或部分访问权限,而无需共享帐户的API密钥或登录凭据。

Coinbase, which I believe everyone knows, is the world’s top digital currency exchange. Coinbase’s API services are very comprehensive, it allows developers to use the OAuth2 protocol to allow a Coinbase user to grant a 3rd party application full or partial access to his/her account, without sharing the account’s API key or login credentials.

使用 Coinbase API,可以在应用程序中轻松集成比特币,比特币现金,litecoin 和 ETH。使用 Coinbase API 可以完成这些操作:

Coinbase API makes it easy to integrate bitcoin, bitcoin cash, litecoin and ethereum into both new and existing applications.

1.生成比特币,比特币现金,litecoin和以太坊钱包和地址;

2.买/卖和发送/接收比特币,比特币现金,litecoin和以太坊;

3.安全地存储比特币,比特币现金,litecoin和以太坊;

4.检索实时或历史价格信息;

5.付款到达时收到通知。

1.Generate bitcoin, bitcoin cash, litecoin and ethereum wallets and addresses

2.Buy/sell and send/receive bitcoin, bitcoin cash, litecoin and ethereum

3.Securely store bitcoin, bitcoin cash, litecoin and ethereum

4.Retrieve real-time or historical price information

5.Receive notifications when payments arrive

在本篇文章中,我们将介绍 COINBASE PRO API。作为一个全功能交易 API,COINBASE PRO API 为开发人员提供了有效方式以构建数字资产交易应用程序,并提供相关功能。您可以构建工具以跟踪市场,查看交易历史,监控未结订单等。

In this article, we are introducing the COINBASE PRO API. Coinbase Pro’s fully featured trading API offers an efficient way for developers to build digital asset trading applications and to offer related functionality. You can build tools to track the market, view your trading history, monitor open orders, and more.

Coinbase Pro API 官方文档:https://docs.pro.coinbase.com/

Coinbase Pro API official documentation:https://docs.pro.coinbase.com/

coinbase%20GDAX

Market Data API 是 Coinbase Pro API 中不需要身份验证的公共信息端口,用于检索市场数据。它提供市场数据的快照。

The Market Data API is an unauthenticated set of endpoints for retrieving market data. These endpoints provide snapshots of market data.

获取可用交易对列表:

Get a list of available currency pairs for trading:

https://api-public.sandbox.pro.coinbase.com/products

Node.js 代码示例:

Code example (Node.js):

const fetch = require('node-fetch');

fetch('https://api-public.sandbox.pro.coinbase.com/products', {
    method: 'get',
}).then(response => response.json()
    .then(data => console.log(data)));

返回的 JSON 示例:

Return JSON example:

157

仍然做了一张 Market Data API 的思维导图:

Mind map of the Market Data API:

Coinbase%20Market%20Data%20API


#2

我用邮箱注册个 coinbase账户就能直接用吧?不需要kyc或者里面一定要有token?


#3

这是公共数据API,不需要注册,什么都不需要,直接链接浏览器打开就能查询