python-linkedin icon indicating copy to clipboard operation
python-linkedin copied to clipboard

How can I search companies using facets

Open Michelcyc opened this issue 10 years ago • 6 comments

I need to do a search like this: http://api.linkedin.com/v1/company-search:(facets)?keywords={keyword}&facets=location

using the search_company() method, but I don't know how can I structure it

Best Regards Michel

Michelcyc avatar Jul 29 '14 21:07 Michelcyc

Really 0 feedback?

Michelcyc avatar Aug 06 '14 10:08 Michelcyc

I am essentially trying to do the same thing but with the industry facet.

I've tried this: params = {'facet': {'industry': 42}}

this as well. It actually returns something for me but it returns companies in the wrong industry. So basically it doesn't work params = {'industry': 42})

dvetal avatar Sep 09 '14 12:09 dvetal

Found an answer for you. I have found that the following format works so you can use facets application.search_company(selectors=[{'companies': ['name', 'industry']}], params = {'facet': 'industry,41'})

In this example it pulls 10 (the default) companies with their name and industry only where the industry is banking. The number 41 is the code provided for the industry on the linked in website.

dvetal avatar Sep 09 '14 12:09 dvetal

how do you search with multiple facets? like industry and location?

bubakazouba avatar Jun 09 '15 22:06 bubakazouba

application.search_company(selectors=[{'companies': ['name','industry']}], params={'count':5,'start':0,'facet':['location,us:84','location,us:31','company-size,B','industry,24']})

JoeGlines avatar Oct 01 '15 21:10 JoeGlines

Very helpful! @JoeGlines @dvetal

Any idea about how to facet by FoundingYear? Or is it a sort of keyword?

arivero avatar Oct 31 '17 13:10 arivero