Back to Blog

Connect API to Excel On A Schedule With No Code

An API is a ‘bridge‘ through which one app obtains/sends information from/to another app. This means that you can load miscellaneous data from your source app to your Excel workbook using the REST API. Moreover, you can even schedule data loads via APIs to Excel without any VBA coding! Read our guide to learn how you can do this.

How to use API in Excel – options you have

Basically, you have three options:

  • Power Query: You can query data from APIs using Excel’s built-in tool. 
  • Coupler.io: This third-party importer will let you automate data exports via APIs to Excel on a custom schedule.
  • VBA: This is a code-based option that is suitable for tech-savvy Excel users.

Let’s check out each option in action so that you can make the best choice for your needs. For this, we asked Richard, a cryptocurrency enthusiast, to help us.

Richard wants to analyze the growth tendency of the top crypto coins. To do this, he needs to load data from CryptoCompare using their JSON API.

1 crypto compare

For testing, Richard will use the following API URL that will load data about price for five cryptocoins: Bitcoin, Ethereum, Terra, Binance Coin, and Tether.

https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,LUNA,BNB,USDT&tsyms=USD,EUR&api_key={enter-api-key}

Note: This API requires authorization, so Richard has already generated a free API key.

So, let’s start with the option that allows you to schedule exports via API to Excel.

How to regularly pull API data into Excel 

For scheduled exports of data from API to Microsoft Excel, Richard will use Coupler.io. It’s a solution that allows you to connect to multiple sources and load data from them to Excel, Google Sheets, or BigQuery. You can export data on demand and automate import on a custom schedule, such as every day or every hour. 

For Richard’s case, we’ll use the JSON integration with Excel. Let’s see how it works.

10 json to excel

Excel API example with Coupler.io

Sign up to Coupler.io with your Microsoft account. Click Add new importer – this is a boilerplate to set up your connection to API. Name it as you want and complete the following steps.

Source

  • Choose JSON as a source app from the drop-down list. Click Continue.
  • Insert the API URL to the JSON URL field. Click Continue.
https://min-api.cryptocompare.com/data/pricemulti
11 json url

Note: You’ve noticed that this API URL differs from the one Richard used when connecting API to Excel with Power Query. It lacks attached query strings because Coupler.io provides separate fields to specify request headers and URL query parameters. So, Richard will use those to demonstrate how they work.  

12 advanced source settings
  • Request headers – here, you can apply specific headers to your request, such as Authorization, as Richard did.
authorization: Apikey {enter-api-key}
  • URL query parameters – this field is for query parameters for your requests to the API. In Richard’s case, he specified the following strings:
fsyms: BTC,ETH,LUNA,BNB,USDT
tsyms: USD,EUR

Other fields, Request body, Columns, and Path are optional. You can learn more about them in the Coupler.io Help Center

Note: You can find information about the parameters used in those fields in the API documentation of your application. Pay attention to the information about API authentication and details of API endpoints – these are usually located in separate sections. 

Now you’re ready to Jump to the Destination Settings

Destination

  • Choose Microsoft Excel as the destination app and connect your account. Click Continue.
  • Select a workbook on OneDrive and a worksheet where the data will be loaded. You can select an existing worksheet or create a new one. Click Continue.
13 destination

Note: Optionally, you can change the first cell for your imported data range, change the import mode, and add a column that contains the date and time of the last update.

Clicking on Save and Run loads the data from API to Excel right away. But Richard needs to automate this export on a recurring basis, so he needs to complete another step.

Schedule

  • Toggle on the Automatic data refresh and configure the frequency.
8 airtable export schedule

That’s it! Let’s check out the results?

14 data api to excel

The imported data does not look very neat. Nevertheless, you can create a separate sheet where the data will be transformed to the format you want and link Excel sheets. Therefore, every time Coupler.io refreshes your data, it will be automatically refreshed on the linked sheet. 

Connect API to Excel with Power Query

Power Query is a data transformation engine within Excel. As well, it allows you to query data from different sources including REST APIs. Here is how it works.

  • In your Excel workbook, go to Data => New Query => From Other Sources => From Web.
2 excel from web
  • Insert the API URL and click OK
3 api url power query
  • Choose the web content access. For this example, we can go with Anonymous. Click Connect.
4 web content access
  • The Power Query editor will open where you can preview the data loaded from API. Go to the Convert tab and click Into Table.
5 power query into table
  • This will convert the data from API to a table, and you’ll be able to transform it before loading it to the Excel workbook, for example, transposing rows to columns or vice versa. 
  • You see that values in the Value column are hidden. The reason is that you need to select which columns to display. For this, click on the Expand button and select the columns. Click OK.
6 power query expand button
  • Now you see two columns: Value.USD and Value.EUR. When all the necessary transformations are done, click Close & Load
7 power query editor close load

There you go!

8 api excel results

You can also check out the details of your connection.

9 connection details

You can refresh data from the API on demand or set up a frequency for the automatic refresh. For this, go to Data => Connections => Properties… and configure the Refresh control.

power query refresh control

The Power Query setup looks somewhat intricate because the main purpose of this tool is to transform data. So, it’s better to use Power Query in combination with Coupler.io – your data will go to Excel on a schedule where you can transform it with Power Query as you wish.

How to connect API to Excel using VBA

The answer is very simple – you need to learn VBA and implement your coding knowledge. 🙂 The benefit of a code-based solution is that you can make it custom. This is achievable if you’re proficient in coding and specifically VBA. Alternatively, you can find some templates on GitHub or somewhere else and tweak them. But it is unlikely that you will find a code sample that will cover all your needs.


The no-code way is the choice of many, including Richard. For his needs with low data volume and infrequent data refresh, he can choose the appropriate subscription plan provided by Coupler.io. Maybe you can go with it as well. Check it out and make the right decision for yourself. Good luck with your data!

Back to Blog

Comments are closed.

Access your data
in a simple format for free!

Start Free