# App Store app icon API

> Get any App Store app icon from one image URL: avatarsapi.com/apple-store/<handle>. No App Store API key, no scraping code.

Put a App Store Handle in the URL and the response is the app icon as image bytes, ready for an `<img src>`. avatarapi fetches it from App Store, checks it is a real image, and caches it at the edge.

```html
<img src="https://avatarsapi.com/apple-store/name%3AThings%203%40us" alt="">
```

## What goes in the URL

`https://avatarsapi.com/apple-store/<handle>`

`id:` plus the numeric App Store id, or `name:` plus the exact app name. Append `@us` (or another country code) to pick a storefront.

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/apple-store/name%3AThings%203%40us?size=64`
- `?json` returns the resolved image URL instead of the bytes:

```json
{ "version": 1, "data": { "url": "https://…", "source": "apple-store", "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 app icon, 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/apple-store/name%3AThings%203%40us"
  onerror="this.onerror=null; this.src='/default-avatar.svg'"
  alt="">
```

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

## Related

- [Apple Music artist, album, or song artwork API](/platforms/apple-music)
- [Baidu Tieba profile picture API](/platforms/tieba)
- [Behance profile picture API](/platforms/behance)
- [Bilibili profile picture API](/platforms/bilibili)
- [All 67 platforms](/platforms/)
