Skip to content

Latest commit

 

History

History
52 lines (41 loc) · 2.47 KB

Get Companies.md

File metadata and controls

52 lines (41 loc) · 2.47 KB

Get Companies

Any formal reporting organization (including corporations, NGOs, Universities, etc.) represented as a company on Wikirate.

This example assumes you have configured your Wikirate REST client. Instructions on how to configure a client can be found in examples/Configurations.md

The get_companies method take as an input a Hash where the user can define the parameters of their request. More specifically, we could divide our params in two different types of parameters, the endpoint parameters and the filter parameters. The endpoint parameters help us to iterate through our query's results and the filter parameters allow us to restrict our results based on specific given input.

endpoint params:
  • limit: default value 20, the maximum number of entries to return. If the value exceeds the maximum, then the maximum value will be used.
  • offset: default value 0, the (zero-based) offset of the first item in the collection to return

filter params:

  • name: returns companies that contain in their name the given string
  • company_category: returns companies that belong to a given company category. Allowed parameter values:
    • 'F': Financial
    • 'H': Health And Education
    • 'I': Infrastructure
    • 'M': Manufacturing
    • 'R': Raw Material Producer
    • 'S': Science And Technology
    • 'W': Wholesale And Retail
    • 'O': Other
  • company_group: returns companies that belong to a given company group name. All wikirate company groups can be found here.
  • country: returns companies with headquarters on the given input country. All available wikirate country options can be found here.

In the example below, we are asking to the first ten companies under the Financial Sector that are located in Greece.

greek_fin_companies = client.get_companies({ 'limit' => 10,
                                             'company_group' => 'F',
                                             'country' => 'Greece' })

In the example below, we are searching for companies in the UK which contain in their name the string 'food'.

companies = client.get_companies({ 'name' => 'food',
                                   'country' => 'United Kingdom' })