Import MacroTrends Data To Google Sheets

Reading Time: 5 minutes

MacroTrends is a premier research platform for long-term investors that enables users to fetch real-time and historical data related to stocks, commodities, exchange rates, inflation rates, and many more. It’s a one-stop solution for fetching all sorts of financial data to make data-driven decisions.

In this article, we will learn how to import MacroTrends data to Google Sheets using MacroTrends API using Amigo Data, a Google Sheets extension. You will be able to import various kinds of financial statement data like cash statement, balance sheet, and income statement. Amigo Data gives you the flexibility to update your data automatically–just set it up once and let Amigo Data do the job for you.

Here is a snippet of Amazon’s annual cash statement imported from MacroTrends to Google Sheets.

Amazon annual cash statement

To import MacroTrends data to Google Sheets using MacroTrends API, we will follow the steps below:

How to automate MacroTrends data imports to Google Sheets

Here’s the step-by-step guide to import MacroTrends data to Google Sheets.

Install the Amigo Data add-on

Install the Amigo Data Google Sheets add-on from the Google Workspace Marketplace.

Click here to install.

Install Amigo Data to import MacroTrends data to Google Sheets

Alternatively, you can get it from Google Sheets.

  • Open a new sheet
  • Go to Extensions→Add-ons→Get add-ons
  • Search for Amigo Data and install

Generate the API key

We’ll use a third-party on RapidAPI since MacroTrends does not have an official API–it’s not public in any case.

Sign up to RapidAPI.

RapidAPI page to sign up

Once you’ve signed up and are logged in, go to the MacroTrends Finance API in RapidAPI.

Learn how to import MacroTrends Data to Google Sheets using RapidAPI

Choose a subscription plan from the Pricing menu post which we’ll be able to use the MacroTrends API. We’ll choose the Basic plan; it can always be upgraded.

Click on Endpoints and scroll down a bit to find the RapidAPI key. You will find your API key under the Header Parameters. This will be used as they key for MacroTrends.

Choose an endpoint

On the left of the “API Playground” is the list of all data endpoints.

List of available data endpoints on MacroTrends API

For this tutorial, let us import balance sheet data using the FinancialBalanceSheet endpoint. This endpoint provides us with 15+ years of balance sheet data cash on hand, inventory, prepaid expenses, and many more.

In the required parameters section, you can enter frequency details (A: annual, Q: quarterly) and the ticker symbol. Let us retrieve Apple’s annual balance sheet statement.

MacroTrends API query parameters

Click the Test Endpoint option to run the query and verify if the parameters are valid.

Run the query

The success message indicates that the endpoints are functioning correctly. 

MacroTrends API working correctly

On the right side under Code Snippets can be found the MacroTrends API endpoint URL for the data with our query parameters.

Change the language from (Node.js) Axios to Shell->cURL from the dropdown menu.

Select the cURL from Shell

Copy the URL excluding the apostrophes and also note the headers. This is the endpoint URL for the data to import to Google Sheets.

MacroTrenda API URL and headers

Import data to Google Sheets

Go back to Google Sheets and launch the Amigo Data extension.

Launch Amigo data to import MacroTrends data to Google Sheets

Select Custom API from the list of sources.

Selecting the source in Amigo Data

Paste the MacroTrends API endpoint URL in the API URL bar.

Pasting the MacroTrends API endpoint URL

Then expand the Details tab and enter the following as headers:

Name: X-RapidAPI-Host, Value: macrotrends-finance.p.rapidapi.com

Name: X-RapidAPI-Key, Value: your_key

Replace your_key with your RapidAPI key.

MacroTrends API headers

Then click the PREVIEW button.

Flatten the nested data points and then click IMPORT.

Click to preview, flatten and import data

The balance sheet data for Apple will be imported into Google Sheets in a moment.

A snippet of the imported data.

Snippet of imported data from MacroTrends to Google Sheets

You can likewise import other types of data from MacroTrends Finance API. Following are some other examples.

Financial cash statement data

Using the FinancialCashStatement endpoint, you can import the 15+ years of data of cash statements of an corporation. In the required parameters section, you can enter freq (A: annual, Q: quarterly) and the ticker symbol.

Financial cash statement endpoint

Financial Income Statement

With the FinancialIncomeStatement endpoint, you can import the 15+ years of data of income statements of an organization. In the required parameters section, you can enter freq (A: annual, Q: quarterly) and the ticker symbol.

Financial income statement endpoint

After importing the data, you can also set a refresh schedule so that the data are updated automatically at regular intervals. By this, you can automate importing financial market data to Google Sheets. To learn how to set a refresh schedule, follow this link.

And not only automate the data import but also receive alerts via email (or Slack) of the updated data.

There are several other types of data that you can import into Google Sheets using Amigo Data such as CNBC data, Trading View data, Coinranking data, and many more. Visit our blog to find out the kinds of data you can import to Google Sheets.

Some related articles you may be interested in:

Import CNBC Data To Google Sheets

Automate Trading View Data Imports To Google Sheets

Automate Coinranking Data Imports To Google Sheets

Leave a Reply

Discover more from Amigo: No-code Data Integrations to Google Sheets

Subscribe now to keep reading and get access to the full archive.

Continue reading