Coinbase Pro

Coinbase Pro

Cryptocurrency

Cryptocurrency Trading Platform

Visit API

📚 Documentation & Examples

Everything you need to integrate with Coinbase Pro

🚀 Quick Start Examples

Coinbase Pro Javascript Examplejavascript
// Coinbase Pro API Example
const response = await fetch('https://docs.pro.coinbase.com/#api', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Coinbase Pro Public API Documentation

Coinbase Pro is a cryptocurrency exchange platform where users can buy, sell, and trade digital assets like Bitcoin, Ethereum, and Litecoin. The Coinbase Pro Public API provides access to real-time market data, trading history, and order book information. In this article, we will explore the various endpoints available with the Coinbase Pro Public API.

To start using the Coinbase Pro Public API, you need to create an API key in your Coinbase Pro account. Once you have created the API key, you can use it to authenticate your requests to the API.

To connect to the API in JavaScript, you can use the fetch method to make HTTP requests to the API endpoints. Here are some examples of how to use the Coinbase Pro Public API with JavaScript:

Retrieve Product Order Book

fetch('https://api.pro.coinbase.com/products/BTC-USD/book')
  .then(response => response.json())
  .then(data => console.log(data));

This code retrieves the order book for the BTC-USD product on Coinbase Pro. The response will include bids, asks, and trades for the product.

Retrieve Product Ticker

fetch('https://api.pro.coinbase.com/products/BTC-USD/ticker')
  .then(response => response.json())
  .then(data => console.log(data));

This code retrieves the ticker for the BTC-USD product on Coinbase Pro. The response will include the current bid, ask, and last traded price for the product.

Retrieve Historical Rates

fetch('https://api.pro.coinbase.com/products/BTC-USD/candles?granularity=3600')
  .then(response => response.json())
  .then(data => console.log(data));

This code retrieves the historical rates for the BTC-USD product on Coinbase Pro. The response will include the open, high, low, and close rates for each hour in the time period specified.

Retrieve Trades

fetch('https://api.pro.coinbase.com/products/BTC-USD/trades')
  .then(response => response.json())
  .then(data => console.log(data));

This code retrieves the trades for the BTC-USD product on Coinbase Pro. The response will include the trade id, price, size, and time for each trade.

Retrieve 24-Hour Stats

fetch('https://api.pro.coinbase.com/products/BTC-USD/stats')
  .then(response => response.json())
  .then(data => console.log(data));

This code retrieves the 24-hour stats for the BTC-USD product on Coinbase Pro. The response will include the open, high, low, and volume for the past 24 hours.

These are just a few examples of the endpoints available with the Coinbase Pro Public API. The API provides a lot of additional functionality to retrieve account information, create orders, and manage orders.

In conclusion, the Coinbase Pro Public API is a powerful tool for accessing real-time market data and managing orders on Coinbase Pro. With a little JavaScript knowledge, you can easily integrate the Coinbase Pro Public API into your web application.

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jul 2Jul 4Jul 6Jul 8Jul 10Jul 12Jul 14Jul 16Jul 18Jul 20Jul 22Jul 24Jul 26Jul 28Jul 3104008001440Minutes
Online
Offline

Related APIs in Cryptocurrency