ozgur / python-linkedin

Python interface to the LinkedIn API
http://ozgur.github.com/python-linkedin/
MIT License
894 stars 392 forks source link

How can I search companies using facets #57

Open Michelcyc opened 10 years ago

Michelcyc commented 10 years ago

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 commented 10 years ago

Really 0 feedback?

dvetal commented 10 years ago

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 commented 10 years ago

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.

bubakazouba commented 9 years ago

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

JoeGlines commented 9 years ago

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

arivero commented 7 years ago

Very helpful! @JoeGlines @dvetal

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