Work with LinkdAPI Python SDK for accessing LinkedIn professional profile and company data. Use when you need to fetch profile information, company data, job listings, or search for people/jobs on LinkedIn. The skill uses uv script pattern for ephemeral Python scripts with inline dependencies.
用于LinkdAPI的Python SDK——以企业级可靠性获取来自LinkedIn的专业个人资料和公司数据。
获取您的API密钥: https://linkdapi.com/signup?ref=K_CZJSWF
使用 uv脚本模式 创建带有内联依赖的临时Python脚本:
python
from linkdapi import LinkdAPI
client = LinkdAPI(YOURAPIKEY)
profile = client.getprofileoverview(ryanroslansky)
print(profile)
运行方式:
bash
uv run script.py
这将自动安装依赖、运行脚本并清理——非常适合一次性任务。
始终以uv脚本块开头:
python
获取个人资料概览:
python
from linkdapi import LinkdAPI
client = LinkdAPI(YOURAPIKEY)
profile = client.getprofileoverview(ryanroslansky)
if profile.get(success):
data = profile[data]
print(f{data[fullName]} - {data.get(headline, )})
print(f位置:{data.get(location)})
获取公司信息:
python
from linkdapi import LinkdAPI
client = LinkdAPI(YOURAPIKEY)
company = client.getcompanyinfo(name=google)
if company.get(success):
data = company[data]
print(f{data[name]})
print(f行业:{data.get(industry)})
print(f员工数:{data.get(employeeCount, N/A)})
搜索职位:
python
from linkdapi import LinkdAPI
client = LinkdAPI(YOURAPIKEY)
result = client.search_jobs(
keyword=软件工程师,
location=加利福尼亚州旧金山,
time_posted=1week
)
if result.get(success):
for job in result[data][jobs][:5]:
print(f{job[title]} 在 {job[company]})
批量个人资料丰富(异步):
python
import asyncio
from linkdapi import AsyncLinkdAPI
async def enrich():
async with AsyncLinkdAPI(YOURAPIKEY) as api:
profiles = await asyncio.gather(
api.getprofileoverview(ryanroslansky),
api.getprofileoverview(satyanadella),
api.getprofileoverview(jeffweiner08)
)
for p in profiles:
if p.get(success):
print(p[data][fullName])
asyncio.run(enrich())
当用户请求LinkedIn数据时:
用户:获取jeffweiner08的个人资料
代理:
bash
cat > /tmp/linkdapi_query.py << EOF
from linkdapi import LinkdAPI
import os
client = LinkdAPI(os.getenv(LINKDAPIAPIKEY))
profile = client.getprofileoverview(jeffweiner08)
if profile.get(success):
data = profile[data]
print(f姓名:{data[fullname]})
print(f头衔:{data.get(headline, N/A)})
print(f位置:{data.get(location, N/A)})
print(f公司:{data.get(company, N/A)})
else:
print(f错误:{profile.get(message)})
EOF
uv run /tmp/linkdapi_query.py
rm /tmp/linkdapi_query.py
要使用LinkdAPI,您需要一个API密钥。请在此注册:
🔗 https://linkdapi.com/signup?ref=K_CZJSWF
注册后,您将获得一个API密钥,可用于验证您的请求。
将API密钥设置为环境变量:
bash
export LINKDAPIAPIKEY=yourapikey_here
在脚本中使用:
python
import os
from linkdapi import LinkdAPI
client = LinkdAPI(os.getenv(LINKDAPIAPIKEY))
检查响应并处理错误:
python
result = client.getprofileoverview(username)
if result.get(success):
data = result[data]
# 处理数据
else:
print(fAPI错误:{result.get(message)})
完整API文档:https://linkdapi.com/docs
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 linkdapi-1776128771 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 linkdapi-1776128771 技能
skillhub install linkdapi-1776128771
文件大小: 2.79 KB | 发布时间: 2026-4-15 13:14