'how to get companies data using linkedin api?
I am trying to get the data from linkedin companies api.The below is the api I am using.
https://api.linkedin.com/v1/companies/162479/shares?format=json
While I am running the code I am getting 403 error for this api
ERROR :
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.linkedin.com/v1/companies/162479/shares?format=json
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at com.aail.linkedin.Linkedin.main(Linkedin.java:75)
I don't know whether the API is working or not but, I am getting that 403 error.
Is the following api's are still working or deprecated ?
Share API — https://api.linkedin.com/v1/people/~/shares
Companies API — https://api.linkedin.com/v1/companies/{id}
Please share the sample code examples if the above api's are working.
Solution 1:[1]
Under new requirements for Companies API:
All calls to Companies API endpoints will require the authenticated user to be flagged as an administrator of the LinkedIn Company Page that is the target of the API call. You become the administrator of a page when you create it. If the page already exists, you will have to contact the existing administrator to grant admin access to other LinkedIn members.
Your API call will return a 403 Forbidden error if you do not have the appropriate admin permission to interact with the target company.
https://developer.linkedin.com/support/developer-program-transition
Solution 2:[2]
I've found a this third party/unofficial linkedin company api to be reliable and really useful: https://rapidapi.com/williambarberjr/api/linkedin-company-data/
You can see the postman documentation (which I found easier to read than rapidapi's documentation) for it here: https://documenter.getpostman.com/view/10812513/UVeGpQqo
It pulls the following variables for a given company when they are available on linkedin:
- Company Name
- Company Size
- Company LinkedIn Url (sometimes the linkedin url you feed the api is outdated and the url that is the result of a redirect is shown here)
- Country Code Of Primary
- Primary - full address provided of primary location (typically the company headquarters), another variable is provided with this address parsed into country, postal code, street address etc
- Follower Count - number of followers the company has
- Domain
- Specialties
- Description
- Type - Public, Private etc.
- Website - company’s website
- Original LinkedIn Url - in case the link you provide redirects, this is the original input you provided
- Employee Count On LinkedIn - probably the most valuable data point that you can only get from linkedin.
- Industries
- Employees - Information about 1 to 4 Employees displayed on the company page are also available. Specifically:
- Employee Name, Title, Profile Link
- Locations - list of all locations mentioned
- Updates - most recent posts from the company
- Similar Pages - list of similar pages (usually similar companies)
- Logo - link to company logo image
- Slogan - company slogan when available
- Crunchbase Funding Info - some companies have limited funding information available, this comes from Crunchbase but is displayed on their LinkedIn company page. The creator of this api also offers a crunchbase api that is good as well if you want info from crunchbase as well.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Peter Szabo |
| Solution 2 | Michael Roader |
