Import Harvest Data to Google Sheets
Harvest is a popular time tracking and invoicing tool that provides numerous integrations, but no official integration for Harvest and Google Sheets. In this guide, we’ll walk through how to pull data from the Harvest API directly into Google Sheets, using the API Connector add-on. We’ll first get a personal access token from Harvest, and then set up a request to pull in data from Harvest to your spreadsheet.
- Part 1: Get your Harvest Personal Access Token
- Part 2: Create your API Request URL
- Part 3: Pull API Data into Sheets
- Part 4: More Example API URLs
- Part 5: Add Filters & Handle Pagination
- Sign into Harvest and navigate to their Developer Tools page (https://id.getharvest.com/developers)
- Click “Create New Personal Access Token”
- Give it a name and click “Create Personal Access Token”. You can name it anything, but we’ll call it ‘Google Sheets’ here.
- You should now see a page containing all your API access details. Congrats! You’re now ready to access the Harvest API. Keep these details handy as we’ll need them in a moment.
- API root: https://api.harvestapp.com/v2
- Endpoint: /time_entries
- Parameters: ?page=PAGE_NUMBER
Parameters Example: ?page=1
The ‘page’ parameter is optional but we’ll include it to show how parameters work. Putting it all together, we get the full API Request URL:
We can now enter all our values into API Connector and start importing Harvest data into Google Sheets.
- Open up Google Sheets and click Add-ons > API Connector > Create New API Request.
- In the Create Request interface, enter the Request URL we just created:
- Under Headers, enter the following key-value pairs (again, if you’re connecting through the OAuth2 connections manager, you only need to enter the Harvest-Account-Id header.):
Harvest-Account-Id YOUR_ACCOUNT_ID Authorization Bearer YOUR_TOKEN User-Agent YOUR_TOKEN_NAME (YOUR_EMAIL)
Of course you’ll need to substitute in your own values using the values from your API access details page and your own email address. The whole thing should look something like this:
- Create a new tab. You can call it whatever you like, but here we’ll call it ‘Time Entries p1’. While still in that tab, click ‘Set’ to use that tab as your data destination.
- Name your request. Again we’ll call it ‘Time Entries p1’
- Click Run and a moment later you’ll see Harvest data populate your Google Sheet:
You can check the documentation for the full list of available API requests, but if you just want to jump in, you can play around with the URLs you enter in the API URL path field. Try the following (one at a time):
- Note that Harvest limits the number of records returned in each request. By default, only 100 records will be returned unless you use the ‘page’ parameter as described in their documentation.
Each page contains 100 records. To access more than 100 records, edit the “page” parameter to your URL path, like this:
With API Connector, you can either set these up as separate requests or loop through them automatically with pagination (paid feature) for added efficiency, like this:
- You may also want to limit your pulls for certain client IDs. You can combine parameters like this:
(you can find your client ID in the “clients” table).
Following the above steps, you will now be able to import data from the Harvest API directly into Google Sheets. By setting Google Sheets as a data source, you can also use this method to create Harvest data visualizations and dashboards in Google Data Studio.