---
title: "Get User Avatar by name"
method: GET
path: "/v0/users/{username}/avatar"
tags: ["用户"]
---

# Get User Avatar by name

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

## Request

- The document declares no server URL.
- Auth: none declared

获取用户头像，302 重定向至头像地址，设置了 username 之后无法使用 UID 查询。

## Path parameters

- `username` string, required

## Query parameters

- `type` string, required

## Other responses

- `302`: Successful Response
- `400`: username 太长
- `404`: 对应用户不存在

## Changes

- **2022-11-19** (v0) `bb6bcec42206`: 2 warning, 2 info
  - removed the optional property `detail` from the response with the `400` status
  - removed the optional property `detail` from the response with the `404` status
  - added the optional property `details` to the response with the `400` status
  - added the optional property `details` to the response with the `404` status
- **2022-06-13** (v0) `51cd9e314f43`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bangumi/apis/bangumi-open-api/changes/v0/users/:username/avatar/get.md)

---

[API](https://skmtc.dev/bangumi/apis/bangumi-open-api.md) - [All operations](https://skmtc.dev/bangumi/apis/bangumi-open-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bangumi/apis/bangumi-open-api/revisions/6aafdbda7895?raw)
