crunchbase4 0.1.2 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb7a01707e086f0d73d6a92807f4d0a9e2dfab44e73647254781103792817373
4
- data.tar.gz: b61240087a0344caf96bb065fa9c309f83e19d2357d805f74278cf2bda9381cc
3
+ metadata.gz: f3b4fc39257c331e78bdf3f05dd4e08c96c67b34c8e0627c2c7bc5a583f5a7f6
4
+ data.tar.gz: 22f753ee2a2b785247c8311fd126ef826853028c542bbae010e55a391aa59e6e
5
5
  SHA512:
6
- metadata.gz: b08389e81858a042b5204787ef8c25a78f712f23688cfb40e81a428298205748158d2e5380a9a24551b896c103212dab8b10b183e4d5ef8d357fb0b0c02f3515
7
- data.tar.gz: cc99c470c8838170978d862a738283ca2481bbf75deeeb9e4760b46902321ddd3469e31e6e01183917cea54794a20187c0b1648ba2962ce675a1bf6ccac3bea1
6
+ metadata.gz: 13c65190a96019e452efe17a6f0173c4cc3f1cbf28ca067fc56da2c394377f5b3f48176d3c34383e242bfa25ead36a9a70156ba0c243e23381ab7c39ba9bbcfd
7
+ data.tar.gz: c13e836e817f2509dac847db8c8f733eb680d0eb69e81961cab23288d9bf3190479481bd5fe9b67a1402d0f164195ba3097601a9c3a7bade0bfb78561380e2e3
@@ -1,16 +1,55 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file.
3
+ ## [0.1.7] - 2020-12-02
4
+
5
+ ### Improve press_reference API response for activity_entities
6
+ - Returns relationship data for activity_entities
7
+ * Before returns all names for activity_entities
8
+ * After returns related organzation or person object
9
+
10
+ ## [0.1.5] - 2020-06-26
11
+
12
+ ### Refactoring
13
+ - Add more query condition support for card query (limit, order, before_id, after_id)
14
+ * Before
15
+ - Get organzation's fund: (`client.organization(entity_id, 'fund')`)
16
+ * After
17
+ - Get organzation's fund: (`client.organization(entity_id, card_id: 'fund')`)
18
+ - Method for uniformly obtaining deleted entities data and support more query condition
19
+ * Get deleted organizations
20
+ - Before: (`client.deleted_organizations`)
21
+ - After : (`client.deleted_entities(collection_ids: 'organizations', limit: 20)`)
22
+ - Method for uniformly obtaining autocompletes entities data and support more query condition
23
+ * Get autocompletes organizations
24
+ - Before: (`client.autocomplete_organizations`)
25
+ - After : (`client.autocomplete('ekohe', collection_ids: 'organizations', limit: 3)`)
26
+
27
+ ## [0.1.4] - 2020-06-12
28
+
29
+ ### Added
30
+ - Implemented APIs to get the cards data of Entity
31
+ - fund: (`client.organization(entity_id, 'fund')`)
32
+ - ownership: (`client.organization(entity_id, 'ownership')`)
33
+ - founders: (`client.organization(entity_id, 'founders')`)
34
+ - investors: (`client.organization(entity_id, 'investors')`)
35
+ - jobs: (`client.organization(entity_id, 'jobs')`)
36
+ - headquarters_address: (`client.organization(entity_id, 'headquarters_address')`)
37
+
38
+ ## [0.1.3] - 2020-06-09
39
+
40
+ ### Added
41
+ - Implemented `deleted_entities` API to allow user get deleted entities by collection_ids
42
+ - Implemented `fetch(entity_id, card_id)` API, allow user get the entity with card_id data
4
43
 
5
44
  ## [0.1.2] - 2020-06-07
6
45
 
7
46
  ### Added
8
47
  - Implemented searches APIs to get the recent updates entities on Search
9
- - organzations
48
+ - organizations
10
49
  - people
11
50
  - funding rounds
12
- - Implemented autocomplete API to allow user filter entities by keyword
13
- - organzations
51
+ - Implemented `autocompletes` API to allow user filter entities by keyword
52
+ - organizations
14
53
  - people
15
54
  - funding rounds
16
55
 
@@ -18,7 +57,7 @@ All notable changes to this project will be documented in this file.
18
57
 
19
58
  ### Added
20
59
  - Implemented APIs to get acquisition and investment of Entity
21
- - Implemented APIs to search organzations and funding rounds of Search
60
+ - Implemented APIs to search organizations and funding rounds of Search
22
61
 
23
62
  ### Changed
24
63
  - Refactor the API client to support search API
@@ -31,4 +70,4 @@ All notable changes to this project will be documented in this file.
31
70
 
32
71
  ## [0.0.0] - 2020-06-01
33
72
 
34
- - Learning the Crunchbase V4 document and ready to create the new Gem
73
+ - Learning the Crunchbase V4 API changes then creating the Gem
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crunchbase4 (0.1.2)
4
+ crunchbase4 (0.1.7)
5
5
  faraday
6
6
  faraday_curl
7
7
  faraday_middleware
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Crunchbase
2
2
 
3
- Crunchbase is a ruby wrapper base 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)
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/encoreshao/crunchbase4.svg?branch=master)](https://travis-ci.org/encoreshao/crunchbase4)
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
- ### Configure your API certificate
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
- ### The first step is to build an API client
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
- #### Get the person data
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
- #### Get the funding round data
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
- #### Get the acquisition data
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,16 +248,91 @@ pry(main)> response.acquiree_funding_total
130
248
  => 150949998
131
249
  ```
132
250
 
133
- #### Get the press reference data
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
- => #<Crunchbase::Models::PressReference:0x00007fce2d33dbc0
138
- @activity_entities=["Facebook", "General Atlantic", "KKR", "Reliance Industries", "Vista Equity Partners"],
255
+ => #<Crunchbase::Models::PressReference:0x00007fd6faf97800
256
+ @activity_entities=
257
+ [#<Crunchbase::Models::Organization:0x00007fd6fb41d9d8
258
+ @aliases=nil,
259
+ @description=nil,
260
+ @identifier=[],
261
+ @legal_name=nil,
262
+ @linkedin=nil,
263
+ @name="Facebook",
264
+ @permalink="facebook",
265
+ @permalink_aliases=nil,
266
+ @rank_org=nil,
267
+ @rank_org_company=nil,
268
+ @short_description=nil,
269
+ @twitter=nil,
270
+ @uuid="df662812-7f97-0b43-9d3e-12f64f504fbb",
271
+ @website=nil>,
272
+ #<Crunchbase::Models::Organization:0x00007fd6fb42f2c8
273
+ @aliases=nil,
274
+ @description=nil,
275
+ @identifier=[],
276
+ @legal_name=nil,
277
+ @linkedin=nil,
278
+ @name="General Atlantic",
279
+ @permalink="general-atlantic",
280
+ @permalink_aliases=nil,
281
+ @rank_org=nil,
282
+ @rank_org_company=nil,
283
+ @short_description=nil,
284
+ @twitter=nil,
285
+ @uuid="8b8d96f8-9dfe-b27a-8f57-7d266a051dc9",
286
+ @website=nil>,
287
+ #<Crunchbase::Models::Organization:0x00007fd6fb42da18
288
+ @aliases=nil,
289
+ @description=nil,
290
+ @identifier=[],
291
+ @legal_name=nil,
292
+ @linkedin=nil,
293
+ @name="Kohlberg Kravis Roberts",
294
+ @permalink="kkr",
295
+ @permalink_aliases=nil,
296
+ @rank_org=nil,
297
+ @rank_org_company=nil,
298
+ @short_description=nil,
299
+ @twitter=nil,
300
+ @uuid="6c93ebd7-3558-5603-daaf-074652d0e1bb",
301
+ @website=nil>,
302
+ #<Crunchbase::Models::Organization:0x00007fd6fb42c168
303
+ @aliases=nil,
304
+ @description=nil,
305
+ @identifier=[],
306
+ @legal_name=nil,
307
+ @linkedin=nil,
308
+ @name="Reliance Industries",
309
+ @permalink="reliance-industries-84fd",
310
+ @permalink_aliases=nil,
311
+ @rank_org=nil,
312
+ @rank_org_company=nil,
313
+ @short_description=nil,
314
+ @twitter=nil,
315
+ @uuid="7ba47aa0-0e01-4101-a74d-67a8205584fd",
316
+ @website=nil>,
317
+ #<Crunchbase::Models::Organization:0x00007fd6fb43e868
318
+ @aliases=nil,
319
+ @description=nil,
320
+ @identifier=[],
321
+ @legal_name=nil,
322
+ @linkedin=nil,
323
+ @name="Vista Equity Partners",
324
+ @permalink="vista-equity-partners",
325
+ @permalink_aliases=nil,
326
+ @rank_org=nil,
327
+ @rank_org_company=nil,
328
+ @short_description=nil,
329
+ @twitter=nil,
330
+ @uuid="4d096273-ae5d-d4c3-a411-20a42514d2ce",
331
+ @website=nil>],
139
332
  @author=nil,
140
333
  @created_at="2020-06-05T17:41:10Z",
141
334
  @entity_def_id="press_reference",
142
- @identifier="Jio Platforms to receive $1.2b from Abu Dhabi’s sovereign investment firm",
335
+ @identifier=["0171b30e-9cf8-4ad5-8288-2993e4308e0f", "Jio Platforms to receive $1.2b from Abu Dhabi’s sovereign investment firm"],
143
336
  @posted_on="2020-06-05",
144
337
  @publisher="Tech in Asia",
145
338
  @thumbnail_url="https://cdn.techinasia.com/wp-content/uploads/2016/07/Flickr_-_World_Economic_Forum_-_Ambani.jpg",
@@ -149,9 +342,9 @@ pry(main)> response = client.press_reference('0171b30e-9cf8-4ad5-8288-2993e4308e
149
342
  @uuid="0171b30e-9cf8-4ad5-8288-2993e4308e0f">
150
343
  ```
151
344
 
152
- #### Get the investment data
345
+ ##### Get the investment data
153
346
 
154
- ```
347
+ ```ruby
155
348
  pry(main)> response = client.investment('1368da0c-07b0-46ef-9a86-b518367e60d6')
156
349
  => #<Crunchbase::Models::Investment:0x00007f8c15105830
157
350
  @announced_on="2013-06-30",
@@ -173,11 +366,32 @@ pry(main)> response = client.investment('1368da0c-07b0-46ef-9a86-b518367e60d6')
173
366
  @uuid="1368da0c-07b0-46ef-9a86-b518367e60d6">
174
367
  ```
175
368
 
369
+ ##### Get the ownership data
370
+
371
+ ```ruby
372
+ pry(main)> response = client.ownership('4506d9ce-85d3-4a8f-89cd-07a225359d55')
373
+ => #<Crunchbase::Models::Ownership:0x00007fbf2fdb78b0
374
+ @created_at="2015-03-04T20:04:23Z",
375
+ @entity_def_id="ownership",
376
+ @identifier=["4506d9ce-85d3-4a8f-89cd-07a225359d55", "Facebook owns Instagram", "facebook-owns-instagram--4506d9ce"],
377
+ @name="Facebook owns Instagram",
378
+ @ownee_identifier="Instagram",
379
+ @owner_identifier="Facebook",
380
+ @ownership_type="subsidiary",
381
+ @permalink="facebook-owns-instagram--4506d9ce",
382
+ @updated_at="2018-02-13T01:18:10Z",
383
+ @uuid="4506d9ce-85d3-4a8f-89cd-07a225359d55">
384
+ pry(main)> response.name
385
+ => "Facebook owns Instagram"
386
+ pry(main)> response.uuid
387
+ => "4506d9ce-85d3-4a8f-89cd-07a225359d55"
388
+ ```
389
+
176
390
  ### Search
177
391
 
178
392
  * Search query parameters for each endpoint
179
393
 
180
- ```
394
+ ```ruby
181
395
  {
182
396
  "field_ids": [],
183
397
  "query": [],
@@ -186,13 +400,13 @@ pry(main)> response = client.investment('1368da0c-07b0-46ef-9a86-b518367e60d6')
186
400
  }
187
401
  ```
188
402
 
189
- #### Get the latest updated entities
403
+ ##### Get the latest updated entities
190
404
 
191
405
  Allow user using the method `recent_updates(args)` to get recent updates for each endpoint on searches
192
406
 
193
- # Example to get recent updated organizations
407
+ * Example to get recent updated organizations
194
408
 
195
- ```
409
+ ```ruby
196
410
  args = {
197
411
  scope_name: 'organization', # must
198
412
  date: '2020-05-05', # must
@@ -205,11 +419,11 @@ args = {
205
419
  response = client.recent_updates(args)
206
420
  ```
207
421
 
208
- #### Search organizations by query conditions and order
422
+ ##### Search organizations by query conditions and order
209
423
 
210
- * Step1: Needs to build the query conditions
424
+ * building the query conditions
211
425
 
212
- ```
426
+ ```ruby
213
427
  query_data = {
214
428
  'field_ids' => %w[
215
429
  name
@@ -253,7 +467,7 @@ query_data = {
253
467
 
254
468
  * Use `client` to send a request and parse response
255
469
 
256
- ```
470
+ ```ruby
257
471
  pry(main)> response = client.search_organizations(query_data)
258
472
  => #<Crunchbase::Searches::Client:0x00007fdfc1ad6eb8
259
473
  @conditions=
@@ -294,15 +508,15 @@ pry(main)> response = client.search_organizations(query_data)
294
508
  @total_count=44871>
295
509
  ```
296
510
 
297
- - Get all entities: `response.entities`
298
- - Get total count: `response.total_count`
299
- - Get entities count: `response.count`
511
+ - Get entities: response.entities
512
+ - Get total count: response.total_count
513
+ - Get entities count: response.count
300
514
 
301
- #### Search people by query conditions and order
515
+ ##### Search people by query conditions and order
302
516
 
303
- * Step1: Needs to build the query conditions
517
+ * building the query conditions
304
518
 
305
- ```
519
+ ```ruby
306
520
  query_data = {
307
521
  'field_ids' => %w[
308
522
  first_name
@@ -342,7 +556,7 @@ query_data = {
342
556
 
343
557
  * Use `client` to send a request and parse response
344
558
 
345
- ```
559
+ ```ruby
346
560
  pry(main)> response = client.search_people(query_data)
347
561
  => #<Crunchbase::Searches::Client:0x00007f9acca12d18
348
562
  @conditions=
@@ -362,16 +576,16 @@ pry(main)> response.total_count
362
576
  => 1
363
577
  ```
364
578
 
365
- ## Autocompletes
579
+ ### Autocompletes
366
580
 
367
- ### Allow users to filter by keyword from these endpoints
581
+ ##### Allow users to filter by keyword from these endpoints
368
582
 
369
583
  Search by keyword has been supported in "Organization", "People" and "Fund Round"
370
584
 
371
- 1. Example: Search in an organization by keyword
585
+ * Search in an organization by keyword
372
586
 
373
- ```
374
- pry(main)> response = client.autocomplete_organizations('ekohe')
587
+ ```ruby
588
+ pry(main)> response = client.autocomplete('ekohe', collection_ids: 'organizations')
375
589
  => #<Crunchbase::Autocompletes::Client:0x00007fecb34ce1e8
376
590
  @conditions={:query=>"ekohe", :collection_ids=>"organizations"},
377
591
  @count=25,
@@ -400,10 +614,10 @@ pry(main)> response.count
400
614
  pry(main)> response.total_count
401
615
  ```
402
616
 
403
- 2. Example: Search in an people by keyword
617
+ * Search in an people by keyword
404
618
 
405
- ```
406
- pry(main)> response = client.autocomplete_people('maxime')
619
+ ```ruby
620
+ pry(main)> response = client.autocomplete('maxime', collection_ids: 'people')
407
621
  => #<Crunchbase::Autocompletes::Client:0x00007fecb474f9c0
408
622
  @conditions={:query=>"maxime", :collection_ids=>"people"},
409
623
  @count=25,
@@ -431,10 +645,11 @@ pry(main)> response.entities
431
645
  pry(main)> response.count
432
646
  pry(main)> response.total_count
433
647
  ```
434
- 2. Example: Search in an funding rounds by keyword
435
648
 
436
- ```
437
- pry(main)> pry(main)> response = client.autocomplete_funding_rounds('facebook')
649
+ * Search in an funding rounds by keyword
650
+
651
+ ```ruby
652
+ pry(main)> response = client.autocomplete('facebook', collection_ids: 'funding_rounds')
438
653
  => #<Crunchbase::Autocompletes::Client:0x00007fecb4dd66b8
439
654
  @conditions={:query=>"facebook", :collection_ids=>"funding_rounds"},
440
655
  @count=25,
@@ -463,38 +678,42 @@ pry(main)> response.count
463
678
  pry(main)> response.total_count
464
679
  ```
465
680
 
466
- ## Development
681
+ ### Deleted Entities
467
682
 
468
- 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.
683
+ * Get deleted entities by collection_ids
469
684
 
470
- ### Examples of API requests for each endpoint
685
+ ```ruby
686
+ pry(main)> response = client.deleted_entities
687
+ => #<Crunchbase::DeletedEntities::Client:0x00007fa9196b6498
688
+ @conditions={:collection_ids=>"organizations"},
689
+ @count=1000,
690
+ @entities=
691
+ [#<Crunchbase::Models::DeletedEntity:0x00007fa9197f9df0 @deleted_at="2020-06-06T11:51:34Z", @entity_def_id="organization", @identifier=[], @uuid="31e5d1dd-3a7d-4c8c-b7dc-4780d391bbc3">,
692
+ #<Crunchbase::Models::DeletedEntity:0x00007fa9197f8fb8 @deleted_at="2020-06-06T10:43:10Z", @entity_def_id="organization", @identifier=[], @uuid="31d2ba51-ef94-4039-a6fc-22e5c1f0ed80">,
693
+ #<Crunchbase::Models::DeletedEntity:0x00007fa9197f86a8 @deleted_at="2020-06-05T18:32:20Z", @entity_def_id="organization", @identifier=[], @uuid="3f105ec3-606c-4779-85c8-29ec78d67d2d">,
694
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91981fd48 @deleted_at="2020-06-05T15:01:59Z", @entity_def_id="organization", @identifier=[], @uuid="e66d053a-86fa-4f5f-9c98-1d4b3ed0778d">,
695
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91981f438 @deleted_at="2020-06-05T13:17:39Z", @entity_def_id="organization", @identifier=[], @uuid="014de711-a0b0-4e29-a8ce-5f8c2696d9af">,
696
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91981eb28 @deleted_at="2020-06-05T13:09:11Z", @entity_def_id="organization", @identifier=[], @uuid="8b3102a2-04cc-4fb2-85cb-b2aa55662291">,
697
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91981e218 @deleted_at="2020-06-05T11:47:50Z", @entity_def_id="organization", @identifier=[], @uuid="62ae4ffc-a999-4c09-8c42-eef26be606aa">,
698
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91981d908 @deleted_at="2020-06-05T11:47:34Z", @entity_def_id="organization", @identifier=[], @uuid="7aa08989-f6ef-427c-96ac-7e1482a7eec1">,
699
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91981cff8 @deleted_at="2020-06-05T11:46:13Z", @entity_def_id="organization", @identifier=[], @uuid="7a6a5e41-d396-437a-9dfb-8539ef554268">,
700
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91981c6e8 @deleted_at="2020-06-05T11:45:21Z", @entity_def_id="organization", @identifier=[], @uuid="10db5120-a638-40eb-b636-e7cca20708e0">,
701
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91982fd88 @deleted_at="2020-06-05T11:45:01Z", @entity_def_id="organization", @identifier=[], @uuid="86c09840-b344-4687-a5ee-e5ea851b0b94">,
702
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91982f478 @deleted_at="2020-06-05T11:44:07Z", @entity_def_id="organization", @identifier=[], @uuid="2ac345e0-f6a0-4352-b66b-3254d4616c87">,
703
+ #<Crunchbase::Models::DeletedEntity:0x00007fa91982eb68 @deleted_at="2020-06-05T11:43:23Z", @entity_def_id="organization", @identifier=[], @uuid="9fa9c806-bc1b-49e6-81f4-719cbfd7928e">,
704
+ ....]
705
+ pry(main)> response.entities
706
+ pry(main)> response.count
707
+ pry(main)> response.total_count
471
708
 
709
+ # Get deleted people and funding rounds
710
+ pry(main)> response = client.deleted_entities(collection_ids: 'people')
711
+ pry(main)> response = client.deleted_entities(collection_ids: 'funding_rounds')
472
712
  ```
473
- Crunchbase.config.user_key = 'user_key'
474
- client = Crunchbase::Client.new
475
-
476
- <!-- Entity -->
477
- response = client.organization('ekohe')
478
- response = client.person('mark-zuckerberg')
479
- response = client.funding_round('371c20af8aa94bcba8da0694d138f247')
480
- response = client.acquisition('7638eae9-07b7-4fc6-ad20-5d99de3ff928')
481
713
 
482
- <!-- Search -->
483
- client.search_organizations(query_data)
484
- client.search_people(query_data)
485
- client.search_funding_rounds(query_data)
486
- client.recent_updates({
487
- scope_name: 'organization',
488
- field_ids: %w[name website permalink],
489
- date: '2020-05-05',
490
- limit: 100
491
- })
714
+ ## Development
492
715
 
493
- <!-- Autocompletes -->
494
- response = client.autocomplete_organizations('ekohe')
495
- response = client.autocomplete_people('encore')
496
- response = client.autocomplete_funding_rounds('facebook')
497
- ```
716
+ 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.
498
717
 
499
718
  ## Changelog
500
719