Back to Blog

Explaining Datanews to Google Sheets integration

With the abundance of content produced every minute, it’s hard to keep track of the news that matters to you. Datanews simplifies the task with its powerful Rest API capable of fetching precisely the information you seek, with little effort on your side. Setting it up is easy but building a reliable Datanews to Google Sheets integration may not be that straightforward.

Luckily, there are tools capable of fetching relevant JSON files and parsing them into a Google-friendly format. What’s more, this approach doesn’t require any coding and is suitable for virtually anyone with just a bit of tech-savviness in their resume.

Bear with us as we demonstrate the setup process, including automating the news imports on a chosen schedule. We’ll also share various examples of the data you can get out of Datanews.

How to connect Datanews to Google Sheets?

Coupler.io is a tool for automating data imports from many popular apps, including Pipedrive, Airtable, Hubspot, or QuickBooks. It also features integration in Google Sheets capable of parsing JSON files. Through this, one can fetch data from thousands of different services, including also Datanews.

The available destinations for your data imports are Google Sheets, but also BigQuery, and Excel.

If you haven’t yet, sign up for a Datanews account and fetch your API key from https://datanews.io/docs.

We’ll now fetch some latest news from TechCrunch right into our Google Sheet. The configuration file looks as follows:

json
titleDatanews import
sheetNameStartup news
paramurlhttp://api.datanews.io/v1/news?source=techcrunch.com
optional
paramheadersx-api-key: YOUR_API_KEY
paramqueryParamspage: 1
size: 100
from: {{today}}
to: {{today}}
addon
modeappend
schedule0 * * * *

You’ll find it also in our Datanews template file. Go to File -> Make a copy and insert your API key in your file. Make sure that the name of the first tab (Datasource Index) doesn’t change – otherwise the importer won’t run.

Don’t change any other details yet – we’ll cover customization in the following chapter.

Next, Coupler.io will automatically create an importer based on the configuration in your file. Coupler.io is available as a web dashboard and a Google Sheets add-on. You can use either but when importing a JSON file, an add-on is a faster option. You’ll see why very shortly.

Install the Coupler.io add-on. Then, go back to your configuration file. From the menu on top, select Add-ons -> Coupler.io -> Open dashboard.

To the right of the screen, a menu will appear. It will feature one importer, configured with the information provided to the left. The importer will fetch the news articles into the Startup news sheet it will create itself when launched.

If you’d like to change any detail at this point, make any changes to the configuration and then press the refresh button above the importer.

And without further ado, press Run to launch the importer. It will load for a bit. When finished, open the newly-created tab to see the results.

If you’d like to keep this importer, you’ll need to finish its setup in the Coupler.io dashboard. Click on the three-dots menu to the right of your importer and select Edit. In the Destination settings connect your Google account and authorize Coupler.io to import data on your behalf.

Optionally, you may also create a schedule for the following imports. We’ll touch on that in the How to transfer Datanews data to Google Sheets automatically chapter.

Finally, re-run the importer, and Coupler.io will save all the settings in your account.

Export Datanews to Google Sheets – digging deeper

As promised, let’s explain the meaning of each field from the earlier configuration. We are reposting it here for your convenience.

json
titleDatanews import
sheetNameStartup news
paramurlhttp://api.datanews.io/v1/news?source=techcrunch.com
optional
paramheadersx-api-key: YOUR_API_KEY
paramqueryParamspage: 1
size: 100
from: {{today}}
to: {{today}}
addon
modeappend
schedule0 * * * *
  • Title and sheetName represent, respectively, the names of an importer and a sheet you import to (within the same file).
  • Paramurl is the JSON URL you can further customize to get precisely the data you need.
  • Param – headers is the field to insert your API key
  • Param – queryParams is the space to determine the import parameters for this Datanews to Google Sheets integration. Here’s the available list. When selecting the period for your import, you can choose specific dates but most often, macros such as {{today}} will be more suitable for recurring imports. Here’s the list of supported macros.
  • Mode – append instructs Coupler.io to append the new results at the bottom of the previous import. An alternative option is replace, which will wipe out the contents of a given sheet and import the fresh data each time an importer runs.
  • Schedule determines if, when, and how frequently the importer should run again. We’ll explain this in the following chapter.

You can edit these parameters in the Sheet with configuration and re-run the importer(s) as you please. If you prefer, you can edit the settings via the Coupler.io interface. Same as before, click on the three-dots menu next to an importer, then Edit.

You could, for example, change the destination file or use the Fields menu to specify the fields you want to fetch (rather than get available fields with each import).

All your importers and their configuration are also available in the Coupler.io web app.

It’s straightforward to create new importers from your configuration file. For example, you could fancy getting news from different sources into separate sheets. To do that, copy the configuration, skip one line below and paste it. Make any changes you’d like and refresh the importers.

Remember to keep all configurations in the Datasource Index sheet. Same as was the case, to save the importers for future use, choose Edit in respective three-dots menus and complete the setup for each. 

Don’t be surprised if the configuration from your file is erased – this is done to avoid creating duplicate importers.

How to transfer Datanews data to Google Sheets automatically

The beauty of exporting Datanews to Google Sheets this way is that you can get the data fetched for you automatically, on a chosen schedule. This way, you can have the fresh set of news imported, for example daily, into your spreadsheet.

In the configuration above, you must have noticed the schedule field present in each sample; this is where to specify the cron expressions schedule that will re-run the importer for you.

The following expression we used earlier:

0 * * * *

It tells an importer to refresh the data every hour.

Another example could be:

0 8 * * MON-FRI

This expression tells an importer to run daily, at 8 am Monday to Friday.

https://crontab.guru/ can be very helpful for creating such expressions.

Note that for importers created from within a spreadsheet, the time zone of the spreadsheet is used. If you’re unsure which time zone you have set, go to File -> Spreadsheet Settings to look it up.

Alternatively, if you don’t want to play with cron schedules, you can use a handy Coupler.io interface to configure the refresh rate for your news.

Go to the importer settings and scroll down to Schedule. If it’s off, enable Automatic data refresh and select how frequently Coupler.io should refresh the data, on which dates, and at what time.

Afterward, hit Save and Run button and the importer will continue fetching the fresh news on the chosen schedule.

Sample Datanews to Google Sheets queries

There’s plenty of ways you can customize the query.

Datanews can be an excellent tool for PR managers to track any coverage a company gets online. A Tesla employee responsible for the Spanish-speaking world could set up the importer with the following configuration:

json
titleTesla news
sheetNameTesla
paramurlhttp://api.datanews.io/v1/news?q=tesla
optional
paramheadersx-api-key: YOUR_API_KEY
paramqueryParamspage: 1
size: 100
language: es
from: {{30daysago}}
to: {{today}}
addon
modereplace
schedule0 * * * *

Someone else looking to enter a position in the Microsoft stock (MSFT ticker) could be interested in another Datanews to Google Sheets query:

json
titleMSFT
sheetNameMicrosoft Stock
paramurlhttp://api.datanews.io/v1/news?q=msft
optional
paramheadersx-api-key: YOUR_API_KEY
paramqueryParamspage: 1
size: 100
language: en
from: {{yesterday}}
to: {{today}}
addon
modereplace
schedule0 * * * *

Queries that contain more than a single word need to be urlencoded, for example:

json
titleGSheets
sheetNameIntegrations articles
paramurlhttp://api.datanews.io/v1/news?q=google%20sheets%20integration
optional
paramheadersx-api-key: YOUR_API_KEY
paramqueryParamspage: 1
size: 100
from: {{yesterday}}
to: {{today}}
addon
modereplace
schedule0 * * * *

You’ll find all the examples from this article in the templates file. Before running any of them, copy/paste them into the Datasource Index tab. If you don’t, Coupler.io won’t be able to find them.

Datanews to Google Sheets – recap

Running Coupler.io importers is a simple and efficient way of bringing the Datanews data to a Google Sheets file. You have complete control over the fetched data and how often that happens. You can quickly build new importers and implement all sorts of criteria for each new import.

What’s more, you can pull data from different apps into the same or a separate spreadsheet. Any service that provides a public API can be plugged into Coupler.io’s JSON importer and put to work in no time. Also, don’t forget about 15+ existing integrations already available for you.

Many thanks for reading!

Back to Blog

Comments are closed.

Access your data
in a simple format for free!

Start Free