# LinkedIn profile picture or company logo API

> LinkedIn lookups at avatarsapi.com/linkedin/<handle> are currently failing. Handle format and status.

Put a LinkedIn Handle in the URL and the response is the profile picture or company logo as image bytes, ready for an `<img src>`. avatarapi fetches it from LinkedIn, checks it is a real image, and caches it at the edge.

```html
<img src="https://avatarsapi.com/linkedin/company%3Aanthropic" alt="">
```

## What goes in the URL

`https://avatarsapi.com/linkedin/<handle>`

A profile slug from `linkedin.com/in/<slug>` (default), or `company:` plus a company slug.

**Currently failing.** LinkedIn lookups are failing right now while we fix this Source. Ship a fallback. Company pages are the most reliable; many personal profiles hide their photo from logged-out visitors.

Percent-encode the Handle if it contains a `/`, a space, or other reserved characters.

## Options

- `?size=16..1000` sets the square size in pixels (default 400): `https://avatarsapi.com/linkedin/company%3Aanthropic?size=64`
- `?json` returns the resolved image URL instead of the bytes:

```json
{ "version": 1, "data": { "url": "https://…", "source": "linkedin", "kind": "username" } }
```

Starter Projects can also set `?ttl=1h..28d` for the cache lifetime (default 7 days).

## When there is no picture

If the account does not exist or has no profile picture or company logo, the response is a 404 with a JSON body whose `code` is `ENOTFOUND`. That makes `onerror` a reliable fallback:

```html
<img
  src="https://avatarsapi.com/linkedin/company%3Aanthropic"
  onerror="this.onerror=null; this.src='/default-avatar.svg'"
  alt="">
```

`EUPSTREAM` (502) means LinkedIn itself failed or changed; it is usually transient. All codes are in the [error table](https://avatarsapi.com/docs#errors).

## Related

- [Mastodon profile picture API](/platforms/mastodon)
- [Medium profile picture API](/platforms/medium)
- [NetEase Cloud Music profile picture API](/platforms/netease-music)
- [npm profile picture API](/platforms/npm)
- [All 67 platforms](/platforms/)
