---
title: "Retrieve user avatar"
method: GET
path: "/api/users/{username}/avatar"
tags: ["users"]
---

# Retrieve user avatar

`GET /api/users/{username}/avatar`

This endpoint returns a JSON with the avatar URL for the user.

If called with the `Sec-Fetch-Dest: image` header, it instead redirects to the avatar URL

## Path parameters

- `username` string, required

## Query parameters

- `redirect` string — Redirect to the avatar url instead of returning it

## Response `200`

Avatar URL

- object
  - `avatarUrl` string, uri, required

## Changes

- **2026-09-08** `bd17546f47b8` — 1 info
  - for the `query` request parameter `redirect`, the type was generalized from no type to `string`

[Change history](https://skmtc.dev/huggingface/apis/hub-api-endpoints/changes/api/users/:username/avatar/get.md)

---

[API](https://skmtc.dev/huggingface/apis/hub-api-endpoints.md) · [All operations](https://skmtc.dev/huggingface/apis/hub-api-endpoints/llms.txt) · [OpenAPI document](https://skmtc.dev/huggingface/apis/hub-api-endpoints/revisions/61b0b9b74a8a?raw)
