Crypto API tutorials and more:

How to connect the Bitfinex API to Google Sheets

Bitfinex facilitates a graphical trading experience with advanced charting functionality that allows traders to visualize orders, positions and price alerts, tap to modify order properties, and annotate to their trading strategy. We can use the Bitfinex API to import public data from Bitfinex into Google Sheets. In this tutorial, we’ll show you how to connect the Bitfinex REST API to Google Sheets in 4 steps:

  1. Install the Apipheny add-on
  2. Choose a public Bitfinex endpoint
  3. Enter your Bitfinex API request into Apipheny
  4. Run the Bitfinex API request in your Google Sheet

Step 1.) Install and open the Apipheny add-on for Google Sheets

Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.

1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install

2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.

In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.

open apipheny

Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new

Step 2.) Choose a Bitfinex endpoint

In this section, we’ll show you how to browse the Bitfinex API documentation to find the endpoint that retrieves the information you need from your account. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 3.

First, open the Bitfinex API documentation page: https://docs.bitfinex.com/docs/introduction

The menu on the left contains the Introduction, Rest and Websocket sections:

Bitfinex API documentation page
Bitfinex API documentation page

In the Rest section, you should find the Public Endpoints and Authenticated Endpoints subsections. Keep in mind that our tutorial covers only the Public Endpoints subsection; Authenticated Endpoints do not currently work with Apipheny.

Public Endpoints section
Public Endpoints section

In this subsection, we can find a list of links to the public endpoints’ documentation pages: 

Public endpoints list
Public endpoints list

If we click on any of these links, the relevant documentation page will be displayed, along with the entire list of public endpoints.

An example endpoint is Book, which allows you to keep track of the state of Bitfinex order books, on a price-aggregated basis, with customizable precision. The URL for this endpoint is:

https://api-pub.bitfinex.com/v2/book/Symbol/Precision

If you use this URL, don’t forget to replace Symbol and Precision with real values!

The endpoint’s documentation contains a short description of its purpose, followed by its HTTP method (GET), the cURL command, the path and query parameters it uses and an example response:

Endpoint documentation
Endpoint documentation

All endpoints can be accessed using the following base domain https://api-pub.bitfinex.com/v2/ 

All endpoints should be appended to this base domain.

Step 3.) Enter your Bitfinex API request into Apipheny

Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the Import tab. With the Import tab open, enter these details into the add-on:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.

API URL: In Step 2, we explained how you can find the Bitfinex REST API endpoint that you need. Now copy and paste your complete Bitfinex API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).

For this example, we are using the Funding Stats endpoint, which gets a list of the most recent funding data for the given currency: FRR, average period, total amount provided, total amount used. This is what the whole URL looks like:

https://api-pub.bitfinex.com/v2/funding/stats/Symbol/hist

If you use this URL, don’t forget to replace Symbol with a real value! We replaced it with fUSD.

Headers aren’t required. You can leave the Headers section blank in Apipheny.

  Bitfinex API request entered into Apipheny
Bitfinex API request entered into Apipheny

Step 4.) Run the Bitfinex API request in your Google Sheet

Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Bitfinex API data to be imported into your Google Sheet. Here’s what our request looked like when completed:

 Bitfinex data imported into Google Sheets
Bitfinex data imported into Google Sheets

That’s it! You’ve successfully connected your Bitfinex account to Google Sheets using the Bitfinex API, Google Sheets API, and the Apipheny add-on.

After making a successful request to the Bitfinex API, try querying a different Bitfinex API endpoint, or try using one of the more advanced features in the Apipheny add-on.


Crypto API tutorials and more:


API Tutorials



API Knowledge

What is an API?

What is an API URL?

What are parameters?

What is an endpoint?

What is an API key/token?

What is basic authentication?

What are headers?

What is a GET request?

What is a POST request?