# Get a user

From **GitHub v3 REST API**.

`GET /users/{username}`

Provides publicly available information about someone with a GitHub account.

GitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub Enterprise Server plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub Enterprise Server plan information' below"

The `email` key in the following response is the publicly visible email address from your GitHub Enterprise Server [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub Enterprise Server. For more information, see [Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#authentication).

The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/enterprise-server@3.0/rest/reference/users#emails)".

## Parameters

### `username`

- Location: path
- Required: true
- Type: `string`

## Responses

### `200`

Response

### `application/json`

```json
{
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "bio": "There once was...",
  "blog": "https://github.com/blog",
  "company": "GitHub",
  "created_at": "2008-01-14T04:33:35Z",
  "email": "octocat@github.com",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "followers": 20,
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following": 0,
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "gravatar_id": "",
  "hireable": false,
  "html_url": "https://github.com/octocat",
  "id": 1,
  "location": "San Francisco",
  "login": "octocat",
  "name": "monalisa octocat",
  "node_id": "MDQ6VXNlcjE=",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "public_gists": 1,
  "public_repos": 2,
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "site_admin": false,
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "twitter_username": "monatheoctocat",
  "type": "User",
  "updated_at": "2008-01-14T04:33:35Z",
  "url": "https://api.github.com/users/octocat"
}
```

```json
{"oneOf":[{"$ref":"#/components/schemas/private-user"},{"$ref":"#/components/schemas/public-user"}]}
```

### `404`

Resource not found

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/users/{username}
```
