tomquirk / linkedin-api

👨‍💼 LinkedIn API for Python
https://pypi.org/project/linkedin-api
MIT License
2.16k stars 456 forks source link

Support Posts Search #152

Open dericferreira opened 3 years ago

dericferreira commented 3 years ago

Hello,

I'm trying to do "Posts search" and was not able to make it work!

I would like to get all mentions of an specific keyword. The URI looks like this when i'm navigating on the website. Could you help me?

https://www.linkedin.com/voyager/api/search/dash/clusters?decorationId=com.linkedin.voyager.dash.deco.search.SearchClusterCollection-86&origin=FACETED_SEARCH&q=all&query=(keywords:nubank,flagshipSearchIntent:SEARCH_SRP,queryParameters:(datePosted:List(past-24h),sortBy:List(date_posted),resultType:List(CONTENT)))&start=0

I've tried changing the url and the parameters using the search as base method but I get 400.

architdate commented 3 years ago

Bump to this ^^ Getting this exact issue. Managed to get to this url as well

Trying to fetch this with the correct headers ends up returning a JSON which just says status 500 and includes = []

stone0018 commented 3 years ago

hi guys,Have you solved this problem? This problem also gives me a headache

alvaroserrrano commented 3 years ago

For now, I would recommend using the the search endpoint with the keywords inside the keywords array parameter according to your needs and maybe calling get_profile_posts function for every profile that you found

TheophileDiot commented 2 years ago

Hi, any solution found ?

DreamITSoftware commented 1 year ago

I have figured this out and got it working

sadeghtkd commented 2 months ago

Hi, I have used this code to get posts by keyword :

from linkedin_api import Linkedin
api = Linkedin('you@mail.com', 'password')

data = {"filters": 'List((key:resultType,value:List(CONTENT)))',
        "origin": "GLOBAL_SEARCH_HEADER",
        "keywords": "FreePalestine", }
posts= api.search(data, limit=100)
for p in posts:
    print(p['summary']['text'])