Search API Connector Documentation
Import KoBoToolbox Data to Google Sheets
In this guide, we’ll walk through how to pull Kobo API data directly into Google Sheets, using the API Connector add-on for Sheets.
We'll first get an API key from Kobo, and then set up a request to pull in data to your spreadsheet.
- Before You Begin
- Part 1: Get your Kobo API Key
- Part 2: Pull Data from Kobo to Sheets
- Part 3: Create a Custom API Request
- Part 4: Handle Pagination
- Part 5: API Documentation & Information
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get your Kobo API Key
- While logged in to your Kobo account, check the domain in the address bar. For most people, this will be either kf.kobotoolbox.org or kobo.humanitarianresponse.info (this article describes the difference).
- Now navigate to https://YOUR_DOMAIN/token, i.e.
http://kobo.humanitarianresponse.info/token. Copy the token that you see there. That's it, you can now access Kobo's API.
Part 2: Pull Data from Kobo to Sheets
The easiest way to get started with the Kobo API is through API Connector’s built-in integration.
- Select KoboToolBox from the drop-down list of applications
- Under Authorization, enter your API key with the word
Tokenin front of it.
- Choose an endpoint. We’ll start with
/assets.jsonwhich is the endpoint to get a list of your assets.
kpi-url, select your hostname (e.g.
- Choose a destination sheet, name your request, and hit Run to see the response data in your sheet.
- Note the ID in the results.uid field, as you can plug that into the asset_uid input box for subsequent requests.
- When you run these requests, select grid mode with the Unwind option selected to get response data in table.
Part 3: Create a Custom Request
Alternatively, you can run your own custom requests instead of using API Connector’s pre-built integration. This enables some more advanced features like filtering by date, e.g.
To create a custom request, add the complete URL into the request URL field. You also need to add two headers:
- Key =
Authorization, Value =
- Key =
Accept, Value =
To easily convert from a preset request to a custom API URL, tick the Add request URL box before running your preset request (under Output options). This will print out your complete API URL, which you can then copy/paste into the request URL field.
Part 4: Handle Pagination
Kobo limits response data to 30,000 records as described here.
To get more records, you'll need to run your request in batches, where you first fetch 30K records, and then the next set of 30K, and so on. In API Connector, you can cycle through automatically with a multi-query request, like this:
Part 5: API Documentation & Information
Kobo hasn't provided much documentation, but here are a few links for more information:
- Official API documentation: https://support.kobotoolbox.org/api.html
- Kobo's API community forum: https://community.kobotoolbox.org/c/kobo-users/api/24 (especially this post)