API Connector Documentation
Import Crunchbase Data to Google Sheets
In this guide, we’ll walk through how to pull company data from the Crunchbase API directly into Google Sheets, using the API Connector add-on for Sheets.
Note that to access the Crunchbase API, you must have a Crunchbase Enterprise License (pricing). This article assumes that you already have your license and have been granted an API key.
Contents
- Before You Begin
- Part 1: Create a Crunchbase API Request URL with Swagger
- Part 2: Pull Data from the Crunchbase Entity Lookup API
- Part 3: Pull Data from the Crunchbase Search API
- Part 4: Handle Pagination
- Part 5: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Create a Crunchbase API Request URL with Swagger
The Crunchbase API has a rather complex method of querying data through cards and fields. Therefore, let's first approach the Crunchbase API through their Swagger page, as it assists with constructing request URLs.
- First, authorize yourself by entering your API key:
- Next, click Try it out next to any API request you're interested in. Let's try the Crunchbase Entity Lookup API.
- For our first request, let's get information about Uber's founders. Enter "uber" into the entity_id field, and "founders" into the card_ids field. Click Execute.
- Underneath you'll see the raw API response in JSON format, as well as the Curl representation of your API request. Curl is a command-line tool for interacting with APIs.
- Pay attention to these values, as we'll copy them directly into API Connector. We now have our first request URL:
https://api.crunchbase.com/api/v4/entities/organizations/uber?card_ids=founders
Part 2: Pull Data from the Crunchbase Entity Lookup API
Let's now look at how to enter those values into API Connector. Where it says your_api_key
in the Headers section, enter your own API key.
- Open up Google Sheets and click Extensions > API Connector > Open > Create request.
- In the request form enter the following:
- Application:
Custom
- Method:
GET
- Request URL:
https://api.crunchbase.com/api/v4/entities/organizations/uber?card_ids=founders
- Headers:
X-cb-user-key
:your_api_key
accept
:application/json
- Application:
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see details about Uber's founders populate your sheet.
Part 3: Pull Data from the Crunchbase Search API
For our next request, let's use the Crunchbase Search API. The Search API requires constructing a request body containing all the filters and conditions of your request. Let's start with one of their examples. Again you'll need to enter your own API key in the header section where it says your_api_key
.
- As before, click Try it out. We'll try their request to search for companies in Europe with funding total between 25m and 100m USD.
- Click Execute
- You'll now see a Curl representation of your request, which we will use to build our request in API Connector:
- Now paste this request body into an unescape tool to remove all the backslashes, and enter the request into API Connector as follows:
- Application:
Custom
- Method:
POST
- Request URL:
https://api.crunchbase.com/api/v4/searches/organizations
- Headers:
X-cb-user-key
:your_api_key
Accept
:application/json
Content-type
:application/json
- Request body:
{"field_ids":["identifier","categories","location_identifiers","short_description","rank_org"],"order":[{"field_id":"rank_org","sort":"asc"}],"query":[{"type":"predicate","field_id":"funding_total","operator_id":"between","values":[{"value":25000000,"currency":"usd"},{"value":100000000,"currency":"usd"}]},{"type":"predicate","field_id":"location_identifiers","operator_id":"includes","values":["6106f5dc-823e-5da8-40d7-51612c0b2c4e"]},{"type":"predicate","field_id":"facet_ids","operator_id":"includes","values":["company"]}],"limit":50}
- Application:
- Click Run to see the API response in your spreadsheet.
This article gives additional examples of how to use the Crunchbase Search API: https://data.crunchbase.com/docs/examples-search-api
Part 4: Handle Pagination
Note Crunchbase's limits on the number of records returned on a response. By default, there is a maximum of 1000 records returned, unless you include the after_id
key in your request body as described in their documentation.
In API Connector you can loop through these pages automatically with pagination handling, like this:
- Pagination type:
cursor body
- Next token parameter:
after_id
- Next token path:
entities.uuid
- Run until: choose when to stop fetching data
Part 5: API Documentation
Official API documentation: https://data.crunchbase.com/docs/using-the-api