(1/3) The Easy Example

Cruncher essentially helps you gain information about certain entities, be that organizations or people or other, from the Crunchbase API. In this first easy example, I will walk you through the simple lookup functions of the main entities of interest. First we take a look at single entities, then at multiple. For now, we assume that we already obtained the entity uuids or permalinks which are required for this lookup functions.

In the intermediate example, we relax this assumption, but for now, let's take the uuid or permalink as given, and move on to getting information about some organizations and people of interest.

Setup

Before you do anything else, you will need to install and load the library cruncher into your workspace. You can use devtools to get cruncher. After you have installed it, simple load it by calling the following command.

# Load cruncher
library(cruncher)

# Set your api key with research access via
setAPIKey()

Please note that all the functions in this example will fail unless you've specified your API_KEY. As soon as you've done this, they will return to you the requested data, provided you have the research access to the Crunchbase API.

Looking up single entities

To look up a single entity, all you require is the uuid or permalink of said entity. Let's do so for Facebook and Mark Zuckerberg. Since facebook is an organization, we use the following lookup function to get information about it.

lookupOrganization("facebook")

By default, this function will parse the returned information into a data.frame row. If you'd rather have the list from the JSON itself, simple set the default argument please_parse to FALSE.

lookupOrganization("facebook", please_parse = F)

Done. Now, the lookup of other entities is straight forward. If we want to lookup a person instead of an organization, use the appropriate lookup function for this. For example, let's look up the person named Mark Zuckerberg.

lookupPerson("Mark Zuckerberg")

This is how you lookup single entities. How about several people or organizations though?

Looking up multiple entities at once

For multiple entities, again we assume we know the uuid or permalinks and pass these in the appropriate lookup functions. I will demonstrate for organizations and people, but in principle, it works for any of the other paths as well.

If you'd like to know the available paths, call the helper function getPaths() like so.

getPaths()

Now you can see what entities are available. Let's try to lookup data from Crunchbase for both Google and Facebook.

lookupOrganizations(c("facebook", "Google", "Facebook"))

You may notice that facebook has accidentally been inserted twice, but the function will check for duplicates before calling on the API to request data, so only two rows of the two unique permalinks will be returned.

Similarly, when we want to look up several people, we can pass them in the proper function as a character vector or a list like so:

lookupPeople(list("mark Zuckerberg", "Elon Musk", "Steve Jobs"))

Conclusion

Now you know how to look up single and multiple entities over the Crunchbase API with cruncher doing the heavy lifting for you. A question that may remain on your mind is how the *^(@) do I know what the uuid may be for a particular acquisition or a fancy new startup? Or how do I actually get data about some organizations that fulfill certain criteria but I don't know the name or uuid of? This discussion will be answered with the second intermediate example. Stay tuned! And happy crunching!



Lyrohk/cruncher documentation built on Dec. 17, 2021, 1:17 a.m.