linkedin company search API multiple facets?

822 Views Asked by At

In the new API documentation it's written that to use a facet you add it in the url this way "&facet=location,us:0,fr:0" but it's not written anywhere how to specify multiple facets.

What I am trying to do is to limit my search results by industry and location.

These are my attempts:

application.search_company(selectors=[{'companies':
                 ['industries','locations']}],
                  params={'count':100,'universal-name':'linkedin','facet':'location,us:84','facet':'company-size,H',
                'facet':'industry,43'}))#doesnt work it just picks the last one

I also tried:

application.search_company(selectors=[{'companies':
             ['industries','locations']}],
              params={'count':100,'universal-name':'linkedin',
              'facet':'company-size,H,industry,43'}))#didnt work ignored industry

and this:

application.search_company(selectors=[{'companies':
             ['industries','locations']}],
              params={'count':100,'universal-name':'linkedin',
              'facets':['company-size,H','industry,43']}))#didnt work (error)
1

There are 1 best solutions below

0
On BEST ANSWER

the last one is correct, you just need to use facet not facets in the page you specified "https://developer-programs.linkedin.com/documents/company-search"

facets is the output you get from the request while facet is the input.