Search API Connector Documentation
Import Harvest Data to 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 for Sheets.
There are 2 ways to connect to the Harvest API:
- Preset “Connect” button (OAuth) premium
- Personal access token. Please check the appendix for detailed instructions to retrieve your token.
- Before You Begin
- Part 1: Connect to the Harvest API
- Part 2: Get your Harvest Account ID
- Part 3: Pull Data from Harvest to Sheets
- Part 4: Create a Custom API Request
- Part 5: Handle Pagination
- Part 6: API Documentation
- Appendix: Connect with a Personal Access Token
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the Harvest API
The easiest way to get started with the Harvest API is through API Connector’s built-in integration.
- Select Harvest from the drop-down list of applications
- Under Authorization, click Connect to Harvest
- You will see a modal asking you to approve the connection. Click Authorize App.
- You’ll then be returned to your Google Sheet, and can verify that your Harvest connection is active.
Part 2: Get Your Harvest Account ID
Harvest requires that you pass your account ID into a header when making requests to the API, so we need to take a quick detour here to find out our account ID. In API Connector, create a custom request and enter the following URL:
Under Authentication, choose Harvest. Choose an output sheet and click Run and you should see your account ID(s) returned into a sheet, under the field name
accounts.id. Mark this ID down as we’ll need it for all our other requests.
Part 3: Pull Data from Harvest to Sheets
Now that we have our ID, let’s pull some real data into Sheets.
- Toggle back to the Harvest connection, and choose the
- Enter your Harvest account ID, and select any optional parameters by which you’d like to filter the response.
- Set a destination sheet, name your request, and hit Run.
Part 4: Create a Custom Request
Alternatively, you can run a custom request instead of using API Connector’s built-in integration, using any of the endpoints and parameters shown in the API documentation. To create a custom request, enter the full API URL, select Harvest from the OAuth menu (or connect with a token), and enter a Header of Key =
Harvest-Account-Id, 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 5: Handle Pagination
Harvest limits the number of records returned in each request. By default, only 100 records will be returned unless you use the ‘page’ and ‘per_page’ parameters as described in their documentation.
With API Connector you can either run these request URLs manually or loop through them automatically with pagination handling (paid feature). Harvest provides a “next page URL” so we’ll enter it like this:
- Pagination type:
next page URL
- Next page path:
- Run until: choose when to stop fetching data
Part 6: API Documentation
Official API documentation: https://help.getharvest.com/api-v2/
Appendix: Connect with a Personal Access Token
- 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.
- Enter these values into the Headers section, like this. You’ll also need to include your email address for the User-Agent key. The whole thing should look something like this: