Linkedin API-从网址获取公司ID [英] Linkedin API - get company ID from url

查看:118
本文介绍了Linkedin API-从网址获取公司ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从Linkedin上公司页面的网址中获取数字公司ID? 该ID是我用来查询Linkedin API并获取有关公司的更多信息的ID. 我需要从URL附带的信息中获取ID,然后使用它来获取与公司页面相关的其余信息.

Is there a way to get the numeric company id from the url of a company page on Linkedin? This id is the one I'll use to query the Linkedin API and get more information on the company. I need to get the id from the information provided with the URL, to use it to get the rest of the information related to the company page.

在我看来,您需要挖掘HTML代码以获取需要用于使用Linkedin API进行交互的公司ID的情况似乎不寻常,如果我错了,请纠正我.

It seems unusual to me that you need to dig in the HTML code to get the company ID you need to use to interact using the Linkedin API, so correct me if I'm wrong.

我知道也有类似的请求处理程序,但是我想知道为什么没有可用的处理程序来获取公司ID,就像从其url中获取配置文件ID一样:

I know there have been similar request handlers, but I'm wondering why there isn't a handler available to get the company ID like there is to get the profile id from its url:

https://api.linkedin.com/v1/people/url=xxxx

https://api.linkedin.com/v1/people/url=xxxx

我知道有搜索公司的处理程序,但这是一项基于文本的研究,我发现自己的结果有时会不一致.

I know there is the search company handler, but that is a text based research and I found myself with some inconsistent results from time to time.

我不想为ID爬网公司页面,因为如果我从同一个ip上进行太多次了,我就会被Linkedin列入黑名单.

I don't want to crawl the company page for the ID since I get blacklisted by Linkedin if I do it too many times from the same ip.

我知道以下答案:

  • how to get companies id from linkedin jsapi
  • How to get the company id from Linkedin Company URL in PHP?
  • LinkedIn API for Company Directory

但是它们似乎与我的要求过时或略有关联,并且由于LI API在过去一年中发生了很大变化,因此是否有任何进展.

but they seem outdated or marginally related to what I ask and since LI API has changed much over the past year, if there was any development on this.

添加了有关我要查找的ID种类的更多信息.我错误地将@display的答案标记为正确,但不幸的是,这不是我想要的.我指的是用于查询与该公司有关的Linkedin API的 companyId .

added more info on the kind of ID I am looking for. I had erroneously marked @display's answer as correct but unfortunately it's not what I am looking for. I am referring to the companyId that I'd use to query the Linkedin API concerning that company.

推荐答案

2019更新

任意页面

以前提供的解决方案已过时.以下不是最佳解决方案,但会在某些情况下起作用.不幸的是,它不需要. (我知道这不能回答OP的问题,但是它应该会帮助到达这里的其他人,因为这是Google的最高成绩)

2019 update

Arbitrary Pages

The solutions provided previously are outdated. The following is not the best solution, but it will work in a pinch. It does require "crawling", unfortunately. (I know this doesn't answer OP's question, but it should help others who arrive here since this is the top Google result)

查看您要查找其ID的公司主页"的HTML源.搜索字符串https://www.linkedin.com/company/.该字符串在页面上的第一个实例之后是公司ID.

View the HTML source for the "home page" of the company whose ID you are trying to discover. Search for the string, https://www.linkedin.com/company/. The first instance of this string on the page is followed immediately by the company ID.

您可以通过访问整个链接(包括公司ID)来验证您拥有正确的公司ID,例如https://www.linkedin.com/company/123456.

You can verify that you have the right company ID by visiting the entire link (including the Company ID), e.g. https://www.linkedin.com/company/123456.

如果这种方法在某个时候停止工作,请在下面发表评论,我将更新此答案.

If this approach stops working at some point, please comment below and I'll update this answer.

更新:我今天(2019/2/7)使用该策略,并且由于LinkedIn进行了一些更改,我发现最后一个实例目前更可靠.最终,总体策略仍然是正确的.查看源并找到一些可重复的方式来搜索公司ID.寻找可靠的方法可能需要做一些实验.

UPDATE: I'm using the strategy today (7/2/2019) and am finding that the last instance is currently more reliable due to some changes made by LinkedIn. Ultimately, the overall strategy remains sound. View the source and find some repeatable way to search for the company ID. It may take some experimentation to find a reliable approach.

如果您具有该页面的管理员权限,则查找公司ID并不重要.登录后,访问您的公司页面.在网址中直接使用公司ID.

If you have admin rights to the Page, finding the Company ID is trivial. While signed in, visit your Company Page. The Company ID is used right within the URL.

例如:

公司页面的管理员URL:https://www.linkedin.com/company/123123123/admin/

Admin URL for Company Page: https://www.linkedin.com/company/123123123/admin/

公司ID:123123123

或者,您当然可以使用该API查找您作为管理员的任何公司页面的公司ID.

Or, you can of course use the API to find the Company ID for any Company Page of which you are an admin.

这篇关于Linkedin API-从网址获取公司ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆