Our Crypto API Tutorials:

Binance API | Bitfinex API | Bitmex API | Coinbase API | Coingecko API | Coinmarketcap API | CoinAPI | OpenSea API

You might also like:

  • CoinStats: a portfolio manager for tracking crypto holdings from multiple wallets and exchanges
  • Best Crypto APIs: a comprehensive list of the best APIs for cryptocurrency traders, hodlers, and devs

How to connect Bitmex to your Google Sheet

Bitmex is a cryptocurrency exchange. We can use the Bitmex API to pull data from Bitmex into Google Sheets. In this tutorial, you will learn how to connect the Bitmex REST API to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Obtain a Bitmex API Key
  3. Choose a Bitmex API Endpoint
  4. Enter your Bitmex API request into Apipheny
  5. Run the Bitmex API request

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

To pull data from the Bitmex API to Google Sheets, you’ll have to install and open the Apipheny Google Sheets add-on.

Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs, save API requests, schedule API requests, and more. Click here for more info about Apipheny.

1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page: https://gsuite.google.com/marketplace/app/apipheny/966163326746

Installing Apipheny
Installing Apipheny

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In the extensions/add-ons menu, you should see Apipheny.

Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.

Opening the Apipheny add-on
Opening the Apipheny add-on

Step 2.) Obtain a Bitmex API Key

After logging into your Bitmex account, click the API tab and then click the API Key Management option from the menu on the left:

Access the API settings in your Bitxmex account
Access the API settings in your Bitxmex account

The API Keys page will then be displayed. Complete the Name field, choose Key Permissions from the drop-down list, and then click the Create API Key button:

Fill in the details and then click the "Create API Key" button
Fill in the details and then click the “Create API Key” button

The API key (ID and Secret) will be displayed on the screen:

Bitmex API key
Bitmex API key

Copy and paste your ID and the Secret to safe place because you’ll need them in the next steps.

Step 3.) Choose a Bitmex API Endpoint

In this section, we’ll show you how to browse the Bitmex API documentation to find the Bitmex API URL and API endpoint that retrieves the information you need from your Bitmex account.

If you already know your API URL and endpoint, or you want to use the same example URL and endpoint as us, just skip to Step 4.

First, open the Bitmex API documentation page: https://www.bitmex.com/api/explorer/

On this page you’ll find a short description, the base URL, the return types, and all the API endpoints, organized into sections:

Bitmex API documentation
Bitmex API documentation
Bitmex API documents
Bitmex API documents

All API calls to Bitmex should be made to this base URL:


All endpoints should be appended to this base URL.

An example API section in the Bitmex API documentation is Announcement, which includes two endpoints: /announcement and /announcement/urgent:

Bitmex API endpoint examples
Bitmex API endpoint examples

The /announcement endpoint uses the following API URL:


Each endpoint’s documentation contains a description of the endpoint’s purpose, the response class, the content type, the available API URL parameters, and the possible response messages:

Bitmex API endpoint documentation example
Bitmex API endpoint documentation example

Step 4.) Enter your Bitmex 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 3, we explained how you can find the Bitmex REST API endpoint that you need. Now copy and paste your complete Bitmex 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 Get /user endpoint, which retrieves your user’s details. This is what the whole URL looks like:


If you’re following the same example as us, you can copy and paste this URL into the “API URL” field in the add-on.

Headers: In the Headers section of Apipheny, add 4 rows with the following keys and values:

Header 1 

Header 2

Header 3

Header 4

The api-signature is a signature of the request you are making. It is calculated as hex(HMAC_SHA256(apiSecret, verb + path + expires + data)), where:

  • The apiSecret is the Secret value obtained previously on Step 2
  • The verb is the method we are using (GET)
  • Expires represents the date you want the request to expire converted in milliseconds
  • The path value represents the path to your endpoint, in this case /api/v1/user
  • The data part of the HMAC construction should be exactly equal to the raw body you send to the server. You can send JSON or form encoding, just ensure you use the exact same body string in the HMAC. In this case, I didn’t send anything to the server, so I didn’t add a value for this parameter in the formula.

To calculate the expires value, we use the https://www.unixtimestamp.com/index.php website. You input the date you want to convert and then click the Convert button. Copy the value in milliseconds to a safe place.

To calculate the signature, we used this site: https://www.freeformatter.com/hmac-generator.html#ad-output.

In the Copy-paste the string here field, we will type the verb, path and expires values, concatenated without any spaces.

In the Secret Key field, we will input the api-secret we previously obtained in Step 2.
Click the COMPUTE HMAC button to display the result. This is the value for <your_api_signature_value>. Copy the result in a safe place, because you’ll need it shortly.

HMAC generator/tester tool
HMAC generator/tester tool

<your_api_key_value> is the value of the api key you previously obtained in Step 2.

<your_api_expires_value> is the value of the expires variable (in milliseconds) that you obtained earlier in this step.

Now that we have all the necessary details, we could write them into the Apipheny add-on like so:

Bitmex API URL and Headers entered into the Apipheny add-on in Google Sheets
Bitmex API URL and Headers entered into the Apipheny add-on in Google Sheets

Step 5.) Run the Bitmex 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 Bitmex API data to be imported into your Google Sheet. Here’s what our request looked like when completed:

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

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

  • Save and schedule your Bitmex API request
  • Make a POST request to the Bitmex API (if available)
  • Use the custom =APIPHENY() function to call the Bitmex API request inside your spreadsheet
  • Create an API request by referencing the value of a cell in your Bitmex API URL with three curly braces eg. {{{Sheet1!A1}}}

Related articles:

Related Posts