# Get contextual information for a user

From **GitHub v3 REST API**.

`GET /users/{username}/hovercard`

Provides hovercard information when authenticated through basic auth or OAuth with the `repo` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations.

The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository via cURL, it would look like this:

```shell
 curl -u username:token
  https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192
```

## Parameters

### `username`

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

### `subject_type`

- Location: query
- Required: false
- Type: `string`
- Allowed values: `"organization"`, `"repository"`, `"issue"`, `"pull_request"`

Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`.

### `subject_id`

- Location: query
- Required: false
- Type: `string`

Uses the ID for the `subject_type` you specified. **Required** when using `subject_type`.

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Hovercard

```json
{
  "contexts": [
    {
      "message": "Owns this repository",
      "octicon": "repo"
    }
  ]
}
```

```json
{"description":"Hovercard","properties":{"contexts":{"items":{"properties":{"message":{"type":"string"},"octicon":{"type":"string"}},"required":["message","octicon"],"type":"object"},"type":"array"}},"required":["contexts"],"title":"Hovercard","type":"object"}
```

### `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"}
```

### `422`

Validation failed

### `application/json`

- Type: `object`

Validation Error

```json
{"description":"Validation Error","properties":{"documentation_url":{"type":"string"},"errors":{"items":{"properties":{"code":{"type":"string"},"field":{"type":"string"},"index":{"type":"integer"},"message":{"type":"string"},"resource":{"type":"string"},"value":{"oneOf":[{"nullable":true,"type":"string"},{"nullable":true,"type":"integer"},{"items":{"type":"string"},"nullable":true,"type":"array"}]}},"required":["code"],"type":"object"},"type":"array"},"message":{"type":"string"}},"required":["message","documentation_url"],"title":"Validation Error","type":"object"}
```

## Request examples

### cURL

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