crunchbase4 0.1.1 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +5 -0
- data/CHANGELOG.md +66 -0
- data/Gemfile.lock +1 -1
- data/README.md +392 -40
- data/crunchbase4.gemspec +2 -2
- data/lib/crunchbase.rb +30 -1
- data/lib/crunchbase/autocompletes/client.rb +75 -0
- data/lib/crunchbase/client.rb +4 -0
- data/lib/crunchbase/deleted_entities/client.rb +69 -0
- data/lib/crunchbase/entities/client.rb +24 -12
- data/lib/crunchbase/models.rb +10 -1
- data/lib/crunchbase/models/address.rb +36 -0
- data/lib/crunchbase/models/autocomplete_entity.rb +25 -0
- data/lib/crunchbase/models/concerns/entity.rb +53 -0
- data/lib/crunchbase/models/concerns/mappings.rb +37 -0
- data/lib/crunchbase/models/deleted_entity.rb +26 -0
- data/lib/crunchbase/models/event_appearance.rb +39 -0
- data/lib/crunchbase/models/fund.rb +43 -0
- data/lib/crunchbase/models/ipo.rb +48 -0
- data/lib/crunchbase/models/job.rb +42 -0
- data/lib/crunchbase/models/organization.rb +9 -0
- data/lib/crunchbase/models/ownership.rb +39 -0
- data/lib/crunchbase/models/principal.rb +112 -0
- data/lib/crunchbase/utilities/autocomplete.rb +51 -0
- data/lib/crunchbase/utilities/deleted_entities.rb +47 -0
- data/lib/crunchbase/utilities/entity_endpoints.rb +58 -24
- data/lib/crunchbase/utilities/request.rb +28 -11
- data/lib/crunchbase/utilities/response.rb +1 -1
- data/lib/crunchbase/utilities/search_endpoints.rb +22 -0
- data/lib/crunchbase/utilities/search_query_parameters.rb +64 -0
- data/lib/crunchbase/utilities/veriables.rb +335 -0
- data/lib/crunchbase/version.rb +1 -1
- metadata +23 -7
- data/lib/crunchbase/models/entity.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdb7c5623a3de943904cfb33279384f6af90794bd04422502300a1f3a6734fd4
|
4
|
+
data.tar.gz: dcdb6527385ea1cf7bfdf9e59b5919ccbba6239673b596b015117eae40e0ee29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73f00d14346138c7631c09338800ceecd2e67106351401a5c2bd7956ed53bd66d26cbfc95e52409e4e97800112cfabe4ddff3c139cbe48c4021bba0aee8760b2
|
7
|
+
data.tar.gz: dd131ff9d6f0ebcf6cf18df11b06d170db839117084bd6a6e995bbdeadffe15dda5a9a0e4b95a89c232a5efbe003c8ba0b748ac5d4e730f7522751024e44c2e1
|
data/.rubocop_todo.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## [0.1.5] - 2020-06-26
|
4
|
+
|
5
|
+
### Refactoring
|
6
|
+
- Add more query condition support for card query (limit, order, before_id, after_id)
|
7
|
+
* Before
|
8
|
+
- Get organzation's fund: (`client.organization(entity_id, 'fund')`)
|
9
|
+
* After
|
10
|
+
- Get organzation's fund: (`client.organization(entity_id, card_id: 'fund')`)
|
11
|
+
- Method for uniformly obtaining deleted entities data and support more query condition
|
12
|
+
* Get deleted organizations
|
13
|
+
- Before: (`client.deleted_organizations`)
|
14
|
+
- After : (`client.deleted_entities(collection_ids: 'organizations', limit: 20)`)
|
15
|
+
- Method for uniformly obtaining autocompletes entities data and support more query condition
|
16
|
+
* Get autocompletes organizations
|
17
|
+
- Before: (`client.autocomplete_organizations`)
|
18
|
+
- After : (`client.autocomplete('ekohe', collection_ids: 'organizations', limit: 3)`)
|
19
|
+
|
20
|
+
## [0.1.4] - 2020-06-12
|
21
|
+
|
22
|
+
### Added
|
23
|
+
- Implemented APIs to get the cards data of Entity
|
24
|
+
- fund: (`client.organization(entity_id, 'fund')`)
|
25
|
+
- ownership: (`client.organization(entity_id, 'ownership')`)
|
26
|
+
- founders: (`client.organization(entity_id, 'founders')`)
|
27
|
+
- investors: (`client.organization(entity_id, 'investors')`)
|
28
|
+
- jobs: (`client.organization(entity_id, 'jobs')`)
|
29
|
+
- headquarters_address: (`client.organization(entity_id, 'headquarters_address')`)
|
30
|
+
|
31
|
+
## [0.1.3] - 2020-06-09
|
32
|
+
|
33
|
+
### Added
|
34
|
+
- Implemented `deleted_entities` API to allow user get deleted entities by collection_ids
|
35
|
+
- Implemented `fetch(entity_id, card_id)` API, allow user get the entity with card_id data
|
36
|
+
|
37
|
+
## [0.1.2] - 2020-06-07
|
38
|
+
|
39
|
+
### Added
|
40
|
+
- Implemented searches APIs to get the recent updates entities on Search
|
41
|
+
- organizations
|
42
|
+
- people
|
43
|
+
- funding rounds
|
44
|
+
- Implemented `autocompletes` API to allow user filter entities by keyword
|
45
|
+
- organizations
|
46
|
+
- people
|
47
|
+
- funding rounds
|
48
|
+
|
49
|
+
## [0.1.1] - 2020-06-06
|
50
|
+
|
51
|
+
### Added
|
52
|
+
- Implemented APIs to get acquisition and investment of Entity
|
53
|
+
- Implemented APIs to search organizations and funding rounds of Search
|
54
|
+
|
55
|
+
### Changed
|
56
|
+
- Refactor the API client to support search API
|
57
|
+
|
58
|
+
## [0.1.0] - 2020-06-04
|
59
|
+
|
60
|
+
### Added
|
61
|
+
|
62
|
+
- Implemented APIs to get organzation and funding round of Entity
|
63
|
+
|
64
|
+
## [0.0.0] - 2020-06-01
|
65
|
+
|
66
|
+
- Learning the Crunchbase V4 API changes then creating the Gem
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Crunchbase
|
2
2
|
|
3
|
-
Crunchbase is a ruby wrapper
|
3
|
+
Crunchbase is a ruby wrapper based on Crunchbase V4 API. it provides easy to get the API data by each endpoint. [CB v4 DOC](https://app.swaggerhub.com/apis/Crunchbase/crunchbase-enterprise_api/1.0.1)
|
4
4
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/crunchbase4.svg)](https://badge.fury.io/rb/crunchbase4)
|
6
|
-
[![Build Status](https://travis-ci.org/
|
6
|
+
[![Build Status](https://travis-ci.org/ekohe/crunchbase4.svg?branch=master)](https://travis-ci.org/ekohe/crunchbase4)
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
@@ -23,34 +23,129 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
## Getting Started
|
25
25
|
|
26
|
-
|
26
|
+
#### Configure your certificate for API
|
27
27
|
|
28
|
-
```
|
28
|
+
```ruby
|
29
29
|
require 'crunchbase4'
|
30
30
|
|
31
31
|
CB_CONFIG = YAML.load(File.read('crunchbase.yml'))
|
32
|
-
Crunchbase.config do |c|
|
33
|
-
c.user_key = CB_CONFIG['user_key']
|
34
|
-
end
|
35
|
-
|
36
|
-
OR
|
37
|
-
|
38
32
|
Crunchbase.config.user_key = CB_CONFIG['user_key']
|
33
|
+
Crunchbase.config.user_key = false # If you want to know the request information, can set the debug = true
|
39
34
|
```
|
40
35
|
|
41
36
|
## Usage
|
42
37
|
|
43
|
-
|
38
|
+
#### Class: `Client` for API
|
44
39
|
|
45
40
|
```
|
46
41
|
pry(main)> client = Crunchbase::Client.new
|
47
42
|
```
|
48
43
|
|
44
|
+
#### API request for endpoint we completed
|
45
|
+
|
46
|
+
- [Entity](https://github.com/ekohe/crunchbase4#entity)
|
47
|
+
- Organization
|
48
|
+
- fields
|
49
|
+
- cards: [raised_investments, participated_funds, child_organizations, participated_investments, investors, parent_organization, raised_funding_rounds, ipos, event_appearances, raised_funds, acquiree_acquisitions, acquirer_acquisitions, parent_ownership, jobs, founders, child_ownerships, participated_funding_rounds, press_references, headquarters_address]
|
50
|
+
- Person
|
51
|
+
- fields
|
52
|
+
- FundingRound
|
53
|
+
- fields
|
54
|
+
- [Searches](https://github.com/ekohe/crunchbase4#search)
|
55
|
+
- [Autocompletes](https://github.com/ekohe/crunchbase4#autocompletes)
|
56
|
+
- [Deleted Entities](https://github.com/ekohe/crunchbase4#deleted-entities)
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
<!-- Examples of organization and single card -->
|
60
|
+
response = client.organization('ekohe')
|
61
|
+
ipos = client.organization('ekohe', card_id: 'ipos')
|
62
|
+
fund = client.organization('ekohe', card_id: 'fund')
|
63
|
+
ownership = client.organization('ekohe', card_id: 'ownership')
|
64
|
+
founders = client.organization('ekohe', card_id: 'founders')
|
65
|
+
investors = client.organization('ekohe', card_id: 'investors')
|
66
|
+
jobs = client.organization('ekohe', card_id: 'jobs')
|
67
|
+
headquarters_address = client.organization('ekohe', card_id: 'headquarters_address')
|
68
|
+
top_2_press_references = client.organization('ekohe', card_id: 'press_references', limit: 2)
|
69
|
+
|
70
|
+
<!-- Examples to get the funding rounds of the organization through paging -->
|
71
|
+
response = client.organization(
|
72
|
+
'facebook', card_id: 'participated_funding_rounds',
|
73
|
+
limit: 5,
|
74
|
+
order: 'announced_on:desc',
|
75
|
+
after_id: '3cdfcecd-5377-439b-acab-cefcf6fe21a5'
|
76
|
+
)
|
77
|
+
|
78
|
+
<!-- Examples of person and single card -->
|
79
|
+
|
80
|
+
response = client.person('mark-zuckerberg')
|
81
|
+
response = client.person('mark-zuckerberg', card_id: 'participated_investments')
|
82
|
+
response = client.funding_round('3cdfcecd-5377-439b-acab-cefcf6fe21a5')
|
83
|
+
response = client.funding_round('3cdfcecd-5377-439b-acab-cefcf6fe21a5', card_id: 'investors')
|
84
|
+
response = client.acquisition('7638eae9-07b7-4fc6-ad20-5d99de3ff928')
|
85
|
+
response = client.fund('aeaac12b-df56-7039-40f9-f1992f88e20e')
|
86
|
+
response = client.ownership('4506d9ce-85d3-4a8f-89cd-07a225359d55')
|
87
|
+
|
88
|
+
<!-- Get the JSON response of entity -->
|
89
|
+
|
90
|
+
response.as_json
|
91
|
+
|
92
|
+
<!-- Search -->
|
93
|
+
client.search_organizations(query_data)
|
94
|
+
client.search_people(query_data)
|
95
|
+
client.search_funding_rounds(query_data)
|
96
|
+
client.recent_updates({
|
97
|
+
scope_name: 'organization',
|
98
|
+
field_ids: %w[name website permalink],
|
99
|
+
date: '2020-05-05',
|
100
|
+
limit: 100
|
101
|
+
})
|
102
|
+
|
103
|
+
<!-- Autocompletes -->
|
104
|
+
response = client.autocomplete('ekohe')
|
105
|
+
response = client.autocomplete('ekohe', collection_ids: 'organizations')
|
106
|
+
response = client.autocomplete('ekohe', collection_ids: 'organizations', limit: 3)
|
107
|
+
response = client.autocomplete('encore', collection_ids: 'people')
|
108
|
+
response = client.autocomplete('facebook', collection_ids: 'funding_rounds')
|
109
|
+
response = client.autocomplete('facebook', collection_ids: 'press_references')
|
110
|
+
|
111
|
+
<!-- Deleted Entities -->
|
112
|
+
response = client.deledeted_entities(collection_ids: 'organizations')
|
113
|
+
response = client.deledeted_entities(collection_ids: 'people')
|
114
|
+
response = client.deledeted_entities(collection_ids: 'funding_rounds')
|
115
|
+
```
|
116
|
+
|
117
|
+
#### Module: Utils
|
118
|
+
|
119
|
+
* We return all the original data from CrunchBase without any conversion. So you want to use the converted data, you can use this tool to convert.
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
pry(main)> Crunchbase::Utils.constants
|
123
|
+
=> [:QUERY_OPERATORS,
|
124
|
+
:COMPANY_TYPES,
|
125
|
+
:FACET_IDS,
|
126
|
+
:IPO_STATUS,
|
127
|
+
:FUNDING_STAGES,
|
128
|
+
:FUNDING_TYPES,
|
129
|
+
:CURRENCY_ENUM,
|
130
|
+
:DATE_PRECISIONS,
|
131
|
+
:LAYOUT_IDS,
|
132
|
+
:NUM_EMPLOYEES_ENUM,
|
133
|
+
:OPERATING_STATUS,
|
134
|
+
:PROGRAM_TYPES,
|
135
|
+
:REVENUE_RANGES,
|
136
|
+
:SCHOOL_METHODS,
|
137
|
+
:SCHOOL_TYPES,
|
138
|
+
:STATUS,
|
139
|
+
:STOCK_EXCHANGE_SYMBOLS]
|
140
|
+
pry(main)> Crunchbase::Utils::COMPANY_TYPES
|
141
|
+
=> {"for_profit"=>"For Profit", "non_profit"=>"Non-profit"}
|
142
|
+
```
|
143
|
+
|
49
144
|
### Entity
|
50
145
|
|
51
146
|
#### Get the organization data
|
52
147
|
|
53
|
-
```
|
148
|
+
```ruby
|
54
149
|
pry(main)> response = client.organization('ekohe')
|
55
150
|
=> #<Crunchbase::Models::Organization:0x00007fbc5cfdf2f8
|
56
151
|
@categories=["Apps", "Artificial Intelligence", "Big Data", "E-Commerce", "Enterprise Software", "FinTech", "iOS", "Retail", "UX Design"],
|
@@ -68,9 +163,9 @@ pry(main)> response.permalink
|
|
68
163
|
|
69
164
|
Or, if you want to use json data, please call `response.as_json` in your project.
|
70
165
|
|
71
|
-
|
166
|
+
##### Get the person data
|
72
167
|
|
73
|
-
```
|
168
|
+
```ruby
|
74
169
|
pry(main)> response = client.person('mark-zuckerberg')
|
75
170
|
=> #<Crunchbase::Models::Person:0x00007ffbf201d178
|
76
171
|
@aliases=["Zuck"],
|
@@ -89,10 +184,9 @@ pry(main)> response.permalink
|
|
89
184
|
=> "mark-zuckerberg"
|
90
185
|
```
|
91
186
|
|
92
|
-
|
187
|
+
##### Get the funding round data
|
93
188
|
|
94
|
-
```
|
95
|
-
=> #<Crunchbase::Client:0x00007f8806824c28>
|
189
|
+
```ruby
|
96
190
|
pry(main)> response = client.funding_round('371c20af-8aa9-4bcb-a8da-0694d138f247')
|
97
191
|
=> #<Crunchbase::Models::FundingRound:0x00007f8806b55ca8
|
98
192
|
@announced_on="2013-06-30",
|
@@ -112,10 +206,34 @@ pry(main)> response.name
|
|
112
206
|
pry(main)> response.uuid
|
113
207
|
=> "371c20af-8aa9-4bcb-a8da-0694d138f247"
|
114
208
|
```
|
209
|
+
##### Get the fund data
|
115
210
|
|
116
|
-
|
117
|
-
|
211
|
+
```ruby
|
212
|
+
pry(main)> response = client.fund('aeaac12b-df56-7039-40f9-f1992f88e20e')
|
213
|
+
=> #<Crunchbase::Models::Fund:0x00007ffa6a5a4080
|
214
|
+
@announced_on="2017-04-03",
|
215
|
+
@created_at="2017-04-04T04:40:49Z",
|
216
|
+
@entity_def_id="fund",
|
217
|
+
@image_id="v1491280776/azwvvy68ap2o29ffcnn7.png",
|
218
|
+
@investor_identifiers=["Betaworks", "Craig Newmark Philanthropies", "Democracy Fund", "Facebook", "Ford Foundation", "Knight Foundation", "Mozilla", "Tow Foundation"],
|
219
|
+
@money_raised=14000000,
|
220
|
+
@name="The News Integrity Initiative Fund I",
|
221
|
+
@num_investors=8,
|
222
|
+
@owner_identifier="The News Integrity Initiative",
|
223
|
+
@permalink="the-news-integrity-initiative-raised-the-news-integrity-initiative-fund-i--aeaac12b",
|
224
|
+
@short_description="The News Integrity Initiative raises new The News Integrity Initiative Fund I on 2017-04-03",
|
225
|
+
@started_on=nil,
|
226
|
+
@updated_at="2018-02-12T22:18:54Z",
|
227
|
+
@uuid="aeaac12b-df56-7039-40f9-f1992f88e20e">
|
228
|
+
pry(main)> response.name
|
229
|
+
=> "The News Integrity Initiative Fund I"
|
230
|
+
pry(main)> response.uuid
|
231
|
+
=> "aeaac12b-df56-7039-40f9-f1992f88e20e"
|
118
232
|
```
|
233
|
+
|
234
|
+
##### Get the acquisition data
|
235
|
+
|
236
|
+
```ruby
|
119
237
|
pry(main)> response = client.acquisition('7638eae9-07b7-4fc6-ad20-5d99de3ff928')
|
120
238
|
=> #<Crunchbase::Models::Acquisition:0x00007fa01134da60
|
121
239
|
@acquiree_categories=["Communities", "Internet", "Photo Sharing", "Publishing", "Search Engine", "Social Media"],
|
@@ -130,9 +248,9 @@ pry(main)> response.acquiree_funding_total
|
|
130
248
|
=> 150949998
|
131
249
|
```
|
132
250
|
|
133
|
-
|
251
|
+
##### Get the press reference data
|
134
252
|
|
135
|
-
```
|
253
|
+
```ruby
|
136
254
|
pry(main)> response = client.press_reference('0171b30e-9cf8-4ad5-8288-2993e4308e0f')
|
137
255
|
=> #<Crunchbase::Models::PressReference:0x00007fce2d33dbc0
|
138
256
|
@activity_entities=["Facebook", "General Atlantic", "KKR", "Reliance Industries", "Vista Equity Partners"],
|
@@ -149,9 +267,9 @@ pry(main)> response = client.press_reference('0171b30e-9cf8-4ad5-8288-2993e4308e
|
|
149
267
|
@uuid="0171b30e-9cf8-4ad5-8288-2993e4308e0f">
|
150
268
|
```
|
151
269
|
|
152
|
-
|
270
|
+
##### Get the investment data
|
153
271
|
|
154
|
-
```
|
272
|
+
```ruby
|
155
273
|
pry(main)> response = client.investment('1368da0c-07b0-46ef-9a86-b518367e60d6')
|
156
274
|
=> #<Crunchbase::Models::Investment:0x00007f8c15105830
|
157
275
|
@announced_on="2013-06-30",
|
@@ -173,11 +291,32 @@ pry(main)> response = client.investment('1368da0c-07b0-46ef-9a86-b518367e60d6')
|
|
173
291
|
@uuid="1368da0c-07b0-46ef-9a86-b518367e60d6">
|
174
292
|
```
|
175
293
|
|
294
|
+
##### Get the ownership data
|
295
|
+
|
296
|
+
```ruby
|
297
|
+
pry(main)> response = client.ownership('4506d9ce-85d3-4a8f-89cd-07a225359d55')
|
298
|
+
=> #<Crunchbase::Models::Ownership:0x00007fbf2fdb78b0
|
299
|
+
@created_at="2015-03-04T20:04:23Z",
|
300
|
+
@entity_def_id="ownership",
|
301
|
+
@identifier=["4506d9ce-85d3-4a8f-89cd-07a225359d55", "Facebook owns Instagram", "facebook-owns-instagram--4506d9ce"],
|
302
|
+
@name="Facebook owns Instagram",
|
303
|
+
@ownee_identifier="Instagram",
|
304
|
+
@owner_identifier="Facebook",
|
305
|
+
@ownership_type="subsidiary",
|
306
|
+
@permalink="facebook-owns-instagram--4506d9ce",
|
307
|
+
@updated_at="2018-02-13T01:18:10Z",
|
308
|
+
@uuid="4506d9ce-85d3-4a8f-89cd-07a225359d55">
|
309
|
+
pry(main)> response.name
|
310
|
+
=> "Facebook owns Instagram"
|
311
|
+
pry(main)> response.uuid
|
312
|
+
=> "4506d9ce-85d3-4a8f-89cd-07a225359d55"
|
313
|
+
```
|
314
|
+
|
176
315
|
### Search
|
177
316
|
|
178
317
|
* Search query parameters for each endpoint
|
179
318
|
|
180
|
-
```
|
319
|
+
```ruby
|
181
320
|
{
|
182
321
|
"field_ids": [],
|
183
322
|
"query": [],
|
@@ -186,11 +325,30 @@ pry(main)> response = client.investment('1368da0c-07b0-46ef-9a86-b518367e60d6')
|
|
186
325
|
}
|
187
326
|
```
|
188
327
|
|
189
|
-
|
328
|
+
##### Get the latest updated entities
|
329
|
+
|
330
|
+
Allow user using the method `recent_updates(args)` to get recent updates for each endpoint on searches
|
190
331
|
|
191
|
-
*
|
332
|
+
* Example to get recent updated organizations
|
192
333
|
|
334
|
+
```ruby
|
335
|
+
args = {
|
336
|
+
scope_name: 'organization', # must
|
337
|
+
date: '2020-05-05', # must
|
338
|
+
field_ids: %w[name website permalink], # default %[uuid created_at updated_at]
|
339
|
+
sort: 'desc' # default `desc`
|
340
|
+
before_id: 'uuid' # optional
|
341
|
+
after_id: 'uuid' # optional
|
342
|
+
}
|
343
|
+
|
344
|
+
response = client.recent_updates(args)
|
193
345
|
```
|
346
|
+
|
347
|
+
##### Search organizations by query conditions and order
|
348
|
+
|
349
|
+
* building the query conditions
|
350
|
+
|
351
|
+
```ruby
|
194
352
|
query_data = {
|
195
353
|
'field_ids' => %w[
|
196
354
|
name
|
@@ -234,7 +392,7 @@ query_data = {
|
|
234
392
|
|
235
393
|
* Use `client` to send a request and parse response
|
236
394
|
|
237
|
-
```
|
395
|
+
```ruby
|
238
396
|
pry(main)> response = client.search_organizations(query_data)
|
239
397
|
=> #<Crunchbase::Searches::Client:0x00007fdfc1ad6eb8
|
240
398
|
@conditions=
|
@@ -275,28 +433,222 @@ pry(main)> response = client.search_organizations(query_data)
|
|
275
433
|
@total_count=44871>
|
276
434
|
```
|
277
435
|
|
278
|
-
- Get
|
279
|
-
- Get total count:
|
280
|
-
- Get entities count:
|
436
|
+
- Get entities: response.entities
|
437
|
+
- Get total count: response.total_count
|
438
|
+
- Get entities count: response.count
|
281
439
|
|
282
|
-
|
440
|
+
##### Search people by query conditions and order
|
283
441
|
|
284
|
-
|
442
|
+
* building the query conditions
|
285
443
|
|
286
|
-
|
444
|
+
```ruby
|
445
|
+
query_data = {
|
446
|
+
'field_ids' => %w[
|
447
|
+
first_name
|
448
|
+
last_name
|
449
|
+
uuid
|
450
|
+
permalink
|
451
|
+
name
|
452
|
+
],
|
453
|
+
'order' => [
|
454
|
+
{
|
455
|
+
'field_id' => 'last_name',
|
456
|
+
'sort' => 'asc',
|
457
|
+
'nulls' => 'last'
|
458
|
+
}
|
459
|
+
],
|
460
|
+
'query' => [
|
461
|
+
{
|
462
|
+
'type' => 'predicate',
|
463
|
+
'field_id' => 'first_name',
|
464
|
+
'operator_id' => 'contains',
|
465
|
+
'values' => [
|
466
|
+
'Maxime'
|
467
|
+
]
|
468
|
+
},
|
469
|
+
{
|
470
|
+
'type' => 'predicate',
|
471
|
+
'field_id' => 'last_name',
|
472
|
+
'operator_id' => 'contains',
|
473
|
+
'values' => [
|
474
|
+
'Guilbot'
|
475
|
+
]
|
476
|
+
}
|
477
|
+
],
|
478
|
+
'limit' => 5
|
479
|
+
}
|
480
|
+
```
|
481
|
+
|
482
|
+
* Use `client` to send a request and parse response
|
287
483
|
|
484
|
+
```ruby
|
485
|
+
pry(main)> response = client.search_people(query_data)
|
486
|
+
=> #<Crunchbase::Searches::Client:0x00007f9acca12d18
|
487
|
+
@conditions=
|
488
|
+
{"field_ids"=>["first_name", "last_name", "uuid", "permalink", "name"],
|
489
|
+
"order"=>[{"field_id"=>"last_name", "sort"=>"asc", "nulls"=>"last"}],
|
490
|
+
"query"=>
|
491
|
+
[{"type"=>"predicate", "field_id"=>"first_name", "operator_id"=>"contains", "values"=>["Maxime"]}, {"type"=>"predicate", "field_id"=>"last_name", "operator_id"=>"contains", "values"=>["Guilbot"]}],
|
492
|
+
"limit"=>5},
|
493
|
+
@count=1,
|
494
|
+
@entities=[#<Crunchbase::Models::Person:0x00007f9acca43418 @first_name="Maxime", @last_name="Guilbot", @name="Maxime Guilbot", @permalink="maxime-guilbot", @uuid="90f4c92e-3479-1f6e-6470-b2ae78805839">],
|
495
|
+
@entity_type="person",
|
496
|
+
@kclass_name=Crunchbase::Models::Person,
|
497
|
+
@total_count=1>
|
498
|
+
pry(main)> response.entities
|
499
|
+
=> [#<Crunchbase::Models::Person:0x00007f9acca43418 @first_name="Maxime", @last_name="Guilbot", @name="Maxime Guilbot", @permalink="maxime-guilbot", @uuid="90f4c92e-3479-1f6e-6470-b2ae78805839">]
|
500
|
+
pry(main)> response.total_count
|
501
|
+
=> 1
|
288
502
|
```
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
503
|
+
|
504
|
+
### Autocompletes
|
505
|
+
|
506
|
+
##### Allow users to filter by keyword from these endpoints
|
507
|
+
|
508
|
+
Search by keyword has been supported in "Organization", "People" and "Fund Round"
|
509
|
+
|
510
|
+
* Search in an organization by keyword
|
511
|
+
|
512
|
+
```ruby
|
513
|
+
pry(main)> response = client.autocomplete('ekohe', collection_ids: 'organizations')
|
514
|
+
=> #<Crunchbase::Autocompletes::Client:0x00007fecb34ce1e8
|
515
|
+
@conditions={:query=>"ekohe", :collection_ids=>"organizations"},
|
516
|
+
@count=25,
|
517
|
+
@entities=
|
518
|
+
[#<Crunchbase::Models::AutocompleteEntity:0x00007fecb3976cb8
|
519
|
+
@facet_ids=["siftery", "apptopia", "company", "rank", "builtwith", "bombora", "similarweb"],
|
520
|
+
@identifier=["9fe491b2-b6a1-5c87-0f4d-226dd0cc97a9", "Ekohe", "ekohe"],
|
521
|
+
@permalink="ekohe",
|
522
|
+
@short_description="Creating cutting-edge, useful technical solutions to move you forward -- we deliver on the promise of AI.",
|
523
|
+
@uuid="9fe491b2-b6a1-5c87-0f4d-226dd0cc97a9">,
|
524
|
+
#<Crunchbase::Models::AutocompleteEntity:0x00007fecb3975980
|
525
|
+
@facet_ids=["rank", "builtwith", "company", "siftery"],
|
526
|
+
@identifier=["4994381c-3f6a-07bc-6ccf-a180cfbfbf60", "Ekohealth", "ekohealth"],
|
527
|
+
@permalink="ekohealth",
|
528
|
+
@short_description="Ekohealth is an online platform, entitling the patients having Ekohealth card to avail up to 50% discount on medical expense.",
|
529
|
+
@uuid="4994381c-3f6a-07bc-6ccf-a180cfbfbf60">,
|
530
|
+
#<Crunchbase::Models::AutocompleteEntity:0x00007fecb3974cb0
|
531
|
+
@facet_ids=["siftery", "apptopia", "company", "rank", "builtwith", "bombora", "similarweb"],
|
532
|
+
@identifier=["d21d2598-6f76-d6b4-458e-579bc9c3a36d", "EcoHealth Alliance", "ecohealth-alliance"],
|
533
|
+
@permalink="ecohealth-alliance",
|
534
|
+
@short_description="EcoHealth Alliance is a solutions that promote conservation and prevents pandemics.",
|
535
|
+
@uuid="d21d2598-6f76-d6b4-458e-579bc9c3a36d">,
|
536
|
+
...]
|
537
|
+
pry(main)> response.entities
|
538
|
+
pry(main)> response.count
|
539
|
+
pry(main)> response.total_count
|
540
|
+
```
|
541
|
+
|
542
|
+
* Search in an people by keyword
|
543
|
+
|
544
|
+
```ruby
|
545
|
+
pry(main)> response = client.autocomplete('maxime', collection_ids: 'people')
|
546
|
+
=> #<Crunchbase::Autocompletes::Client:0x00007fecb474f9c0
|
547
|
+
@conditions={:query=>"maxime", :collection_ids=>"people"},
|
548
|
+
@count=25,
|
549
|
+
@entities=
|
550
|
+
[#<Crunchbase::Models::AutocompleteEntity:0x00007fecb477db40
|
551
|
+
@facet_ids=["rank"],
|
552
|
+
@identifier=["e270e799-052d-60ba-86d4-9c0535556851", "Maxime Leufroy-Murat", "maxime-leufroy-murat"],
|
553
|
+
@permalink="maxime-leufroy-murat",
|
554
|
+
@short_description="Maxime Leufroy-Murat - CEO @ FG Properties",
|
555
|
+
@uuid="e270e799-052d-60ba-86d4-9c0535556851">,
|
556
|
+
#<Crunchbase::Models::AutocompleteEntity:0x00007fecb477ce70
|
557
|
+
@facet_ids=["rank"],
|
558
|
+
@identifier=["0b71cab9-43dc-4f03-9267-4dcbc191ec30", "Maxime Schwab", "maxime-schwab"],
|
559
|
+
@permalink="maxime-schwab",
|
560
|
+
@short_description="Co-Founder",
|
561
|
+
@uuid="0b71cab9-43dc-4f03-9267-4dcbc191ec30">,
|
562
|
+
#<Crunchbase::Models::AutocompleteEntity:0x00007fecb477c1f0
|
563
|
+
@facet_ids=["rank"],
|
564
|
+
@identifier=["527a4a8e-46e4-d808-c7df-b540bd8fedab", "Maxime Lombardini", "maxime-lombardini"],
|
565
|
+
@permalink="maxime-lombardini",
|
566
|
+
@short_description="Maxime Lombardini is Chief Executive Officer and Member of the board of Iliad since 2007. \r\n\r\nBefore joining Iliad, Maxime Lombardini use to...",
|
567
|
+
@uuid="527a4a8e-46e4-d808-c7df-b540bd8fedab">,
|
568
|
+
...]
|
569
|
+
pry(main)> response.entities
|
570
|
+
pry(main)> response.count
|
571
|
+
pry(main)> response.total_count
|
572
|
+
```
|
573
|
+
|
574
|
+
* Search in an funding rounds by keyword
|
575
|
+
|
576
|
+
```ruby
|
577
|
+
pry(main)> response = client.autocomplete('facebook', collection_ids: 'funding_rounds')
|
578
|
+
=> #<Crunchbase::Autocompletes::Client:0x00007fecb4dd66b8
|
579
|
+
@conditions={:query=>"facebook", :collection_ids=>"funding_rounds"},
|
580
|
+
@count=25,
|
581
|
+
@entities=
|
582
|
+
[#<Crunchbase::Models::AutocompleteEntity:0x00007fecb4e04950
|
583
|
+
@facet_ids=["rank"],
|
584
|
+
@identifier=["6fae3958-a001-27c0-fb7e-666266aedd78", "Series B - Facebook", "facebook-series-b--6fae3958"],
|
585
|
+
@permalink="facebook-series-b--6fae3958",
|
586
|
+
@short_description="Facebook raised $27500000 on 2006-04-01 in Series B",
|
587
|
+
@uuid="6fae3958-a001-27c0-fb7e-666266aedd78">,
|
588
|
+
#<Crunchbase::Models::AutocompleteEntity:0x00007fecb4e17c30
|
589
|
+
@facet_ids=["rank"],
|
590
|
+
@identifier=["d950d7a5-79ff-fb93-ca87-13386b0e2feb", "Series A - Facebook", "facebook-series-a--d950d7a5"],
|
591
|
+
@permalink="facebook-series-a--d950d7a5",
|
592
|
+
@short_description="Facebook raised $12700000 on 2005-05-01 in Series A",
|
593
|
+
@uuid="d950d7a5-79ff-fb93-ca87-13386b0e2feb">,
|
594
|
+
#<Crunchbase::Models::AutocompleteEntity:0x00007fecb4e16f60
|
595
|
+
@facet_ids=["rank"],
|
596
|
+
@identifier=["59971bc0-0935-be60-e279-a9db5e787169", "Secondary Market - Facebook", "facebook-secondary-market--59971bc0"],
|
597
|
+
@permalink="facebook-secondary-market--59971bc0",
|
598
|
+
@short_description="Facebook raised $120000000 on 2010-06-28 in Secondary Market",
|
599
|
+
@uuid="59971bc0-0935-be60-e279-a9db5e787169">,
|
600
|
+
...]
|
601
|
+
pry(main)> response.entities
|
602
|
+
pry(main)> response.count
|
603
|
+
pry(main)> response.total_count
|
604
|
+
```
|
605
|
+
|
606
|
+
### Deleted Entities
|
607
|
+
|
608
|
+
* Get deleted entities by collection_ids
|
609
|
+
|
610
|
+
```ruby
|
611
|
+
pry(main)> response = client.deleted_entities
|
612
|
+
=> #<Crunchbase::DeletedEntities::Client:0x00007fa9196b6498
|
613
|
+
@conditions={:collection_ids=>"organizations"},
|
614
|
+
@count=1000,
|
615
|
+
@entities=
|
616
|
+
[#<Crunchbase::Models::DeletedEntity:0x00007fa9197f9df0 @deleted_at="2020-06-06T11:51:34Z", @entity_def_id="organization", @identifier=[], @uuid="31e5d1dd-3a7d-4c8c-b7dc-4780d391bbc3">,
|
617
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa9197f8fb8 @deleted_at="2020-06-06T10:43:10Z", @entity_def_id="organization", @identifier=[], @uuid="31d2ba51-ef94-4039-a6fc-22e5c1f0ed80">,
|
618
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa9197f86a8 @deleted_at="2020-06-05T18:32:20Z", @entity_def_id="organization", @identifier=[], @uuid="3f105ec3-606c-4779-85c8-29ec78d67d2d">,
|
619
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91981fd48 @deleted_at="2020-06-05T15:01:59Z", @entity_def_id="organization", @identifier=[], @uuid="e66d053a-86fa-4f5f-9c98-1d4b3ed0778d">,
|
620
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91981f438 @deleted_at="2020-06-05T13:17:39Z", @entity_def_id="organization", @identifier=[], @uuid="014de711-a0b0-4e29-a8ce-5f8c2696d9af">,
|
621
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91981eb28 @deleted_at="2020-06-05T13:09:11Z", @entity_def_id="organization", @identifier=[], @uuid="8b3102a2-04cc-4fb2-85cb-b2aa55662291">,
|
622
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91981e218 @deleted_at="2020-06-05T11:47:50Z", @entity_def_id="organization", @identifier=[], @uuid="62ae4ffc-a999-4c09-8c42-eef26be606aa">,
|
623
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91981d908 @deleted_at="2020-06-05T11:47:34Z", @entity_def_id="organization", @identifier=[], @uuid="7aa08989-f6ef-427c-96ac-7e1482a7eec1">,
|
624
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91981cff8 @deleted_at="2020-06-05T11:46:13Z", @entity_def_id="organization", @identifier=[], @uuid="7a6a5e41-d396-437a-9dfb-8539ef554268">,
|
625
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91981c6e8 @deleted_at="2020-06-05T11:45:21Z", @entity_def_id="organization", @identifier=[], @uuid="10db5120-a638-40eb-b636-e7cca20708e0">,
|
626
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91982fd88 @deleted_at="2020-06-05T11:45:01Z", @entity_def_id="organization", @identifier=[], @uuid="86c09840-b344-4687-a5ee-e5ea851b0b94">,
|
627
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91982f478 @deleted_at="2020-06-05T11:44:07Z", @entity_def_id="organization", @identifier=[], @uuid="2ac345e0-f6a0-4352-b66b-3254d4616c87">,
|
628
|
+
#<Crunchbase::Models::DeletedEntity:0x00007fa91982eb68 @deleted_at="2020-06-05T11:43:23Z", @entity_def_id="organization", @identifier=[], @uuid="9fa9c806-bc1b-49e6-81f4-719cbfd7928e">,
|
629
|
+
....]
|
630
|
+
pry(main)> response.entities
|
631
|
+
pry(main)> response.count
|
632
|
+
pry(main)> response.total_count
|
633
|
+
|
634
|
+
# Get deleted people and funding rounds
|
635
|
+
pry(main)> response = client.deleted_entities(collection_ids: 'people')
|
636
|
+
pry(main)> response = client.deleted_entities(collection_ids: 'funding_rounds')
|
295
637
|
```
|
296
638
|
|
639
|
+
## Development
|
640
|
+
|
641
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
642
|
+
|
643
|
+
## Changelog
|
644
|
+
|
645
|
+
If you want to know what update, please check the [Changelog](https://github.com/ekohe/crunchbase4/blob/master/CHANGELOG.md).
|
646
|
+
|
297
647
|
## Contributing
|
298
648
|
|
299
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/ekohe/crunchbase4. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected
|
649
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ekohe/crunchbase4. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected.
|
650
|
+
|
651
|
+
To see all contributors from https://github.com/ekohe/crunchbase4/graphs/contributors
|
300
652
|
|
301
653
|
## License
|
302
654
|
|