> For the complete documentation index, see [llms.txt](https://docs.tnid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tnid.com/api-reference/001_user/011_users_and_search/002__get_user_by_username.md).

# Get User By Username

GraphQL endpoint: `/user`

Fetches a user profile by username. Profile fields are filtered by the owner's visibility settings and the viewer's relationship to the user, exactly like fetching a user by id.

## Query

```graphql
query ($username: String!) {
  userByUsername(username: $username) {
    id
    username
    firstName
    middleName
    lastName
    aboutMe
    emails {
      email
      visibility
    }
    telephoneNumbers {
      number
      visibility
    }
    nameVisibility
    aboutMeVisibility
  }
}

```

## Variables

```json
{
  "username": "username3"
}
```

## Response

```json
{
  "data": {
    "userByUsername": {
      "aboutMe": "this is my generic intro",
      "aboutMeVisibility": [
        "PUBLIC"
      ],
      "emails": [
        {
          "email": "test1@email.com",
          "visibility": [
            "PUBLIC"
          ]
        }
      ],
      "firstName": "1john",
      "id": "00000000-0000-4000-8000-000000000001",
      "lastName": "2doe",
      "middleName": "ray",
      "nameVisibility": [
        "PUBLIC"
      ],
      "telephoneNumbers": [
        {
          "number": "2",
          "visibility": [
            "PUBLIC"
          ]
        }
      ],
      "username": "username3"
    }
  }
}
```
