You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

LinkedIn Companies API无Logo企业返回500错误问题咨询

Fixing LinkedIn API 500 Error When Retrieving Companies Without Logos

I’ve run into this exact quirk with the LinkedIn v1 API before—when you request the logo-url field for a company that hasn’t uploaded a logo, the API throws a 500 internal server error instead of gracefully returning null or omitting the field. Here are practical ways to resolve this:

Immediate Workaround: Remove the logo-url Field

If you can temporarily do without company logos, simply exclude the logo-url parameter from your fields list. This will let the API return valid data for all companies, including those missing logos.

Modified curl request example:

curl "https://api.linkedin.com/v1/companies:(id,name,universal-name,website-url,industries,status,blog-rss-url,twitter-id,employee-count-range,specialties,locations,description,stock-exchange,founded-year,end-year,num-followers)?is-company-admin=true&format=json&count=1&start=2&oauth2_access_token=XXXX"

Better Long-Term Solution: Migrate to LinkedIn API v2

The v1 API is deprecated and unmaintained, which is why you’re seeing this unhandled error. LinkedIn’s v2 API handles missing fields far more gracefully—it returns null for logoUrl (note the camelCase naming in v2) instead of crashing with a 500.

To get started with v2, use the organizationalEntityAcls endpoint to retrieve companies you’re an admin of, then fetch details via the organizations endpoint. Example of a v2 company details request:

curl "https://api.linkedin.com/v2/organizations/{ORG_ID}?fields=id,name,vanityName,websiteUrl,industries,status,rssUrl,logoUrl,twitterHandle,employeeCountRange,specialties,localizedDescription,stockExchange,foundedYear,endYear,followerCount" -H "Authorization: Bearer XXXX"

Alternative: Handle Errors and Fetch Companies Individually

If you must stay on v1 and need logo data:

  • First fetch all company IDs without including logo-url
  • Make individual requests for each company ID, adding logo-url to the fields list
  • Catch the 500 error for specific companies and treat them as having no logo

This is more labor-intensive, but it lets you retain logo data where it exists while avoiding batch failures.

Note: LinkedIn may shut down the v1 API entirely at any point, so migrating to v2 is strongly recommended to avoid future disruptions.

内容的提问来源于stack exchange,提问作者Rishikesan Varudharajan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 07:55:12