Last modified January 14, 2021 by Shelly Wolfe

How do I export Swrve KPI data into Google Spreadsheet using the Export API?

Swrve’s Export API provides a basic set of per-KPI function calls that can be combined with the Google docs ImportHtml feature to enable a direct pull of KPI information into Google Spreadsheets.


Prerequisites

You need the following to get started:

  1. Your API key and personal key. These are provided for each specific app and each user you have set up with the Swrve service.
  2. Swrve’s Export API documentation
  3. Google Spreadsheets
This article references Swrve’s URLs for all data and content stored in both our US and EU data centers. Click the relevant tab based on your app configuration. For more information, see How do I configure the Swrve SDK for EU data storage?

Create files

The key part of each file is the Swrve URL that requests the data for a specific KPI from your app’s dashboard. The following is an example for determining the daily active users (DAU) for the entire year of 2015 so far:

US

=ImportHtml("https://dashboard.swrve.com/api/1/exporter/kpi/dau?personal_key=YOUR_PERSONAL_KEY_HERE&api_key=YOUR_API_KEY_HERE&start=2015-01-01", "table", 0)

EU

=ImportHtml("https://eu-dashboard.swrve.com/api/1/exporter/kpi/dau?personal_key=YOUR_PERSONAL_KEY_HERE&api_key=YOUR_API_KEY_HERE&start=2015-01-01", "table", 0)
The query destroys cells in the general region of this cell you select, depending on the data you query. Note that the date format is YYYY-MM-DD. The URL must be surrounded by double quotes. Also be careful when pasting your personal and API keys as a whitespace is sometimes inserted in the middle of the URL.

Create more queries

You can easily create several web queries that invoke different Swrve Export API calls, though each must be in a separate file. The following are some examples. Consult the Export API docs for API details, specifications and limitations.

Get the DAU for the year so far:

US

https://dashboard.swrve.com/api/1/exporter/kpi/dau?personal_key=&api_key=&start=2015-01-01

EU

https://eu-dashboard.swrve.com/api/1/exporter/kpi/dau?personal_key=&api_key=&start=2015-01-01


Get the monthly active users (MAU) for the year so far:

US

https://dashboard.swrve.com/api/1/exporter/kpi/mau?personal_key=&api_key=&start=2015-01-01

EU

https://eu-dashboard.swrve.com/api/1/exporter/kpi/mau?personal_key=&api_key=&start=2015-01-01