# `client.KeyDetails()`

Details

Returns private data on a key: remaining lookups, licensed datasets, usage limits, notification settings and the search contexts the key can serve.

## Endpoint

`GET /keys/{key}/details`

See the [API reference](/docs/api/key-details.md) for this endpoint.

This operation needs a Management Key. Pass it with `addresszen.WithManagementKey(...)` when you create the client, which sends it in the `Authorization` header. See [setup](/docs/sdks/go/setup.md).

## Signature

```go
func (c *Client) KeyDetails(ctx context.Context, key string) (*APIKeyDetailsResponse, error)
```

## Arguments

| Name  | Type              | Required | Description                                |
| ----- | ----------------- | -------- | ------------------------------------------ |
| `ctx` | `context.Context` | yes      | Cancels the request and sets its deadline. |
| `key` | `string`          | yes      | API Key                                    |

## Query Parameters

*None.*

## Response

`*addresszen.APIKeyDetailsResponse`. Fields the API may leave out or send as null are pointers. `RawJSON()` returns the body as received. See [responses](/docs/sdks/go/responses.md).

## Errors

An HTTP error returns `*addresszen.APIError` with the HTTP status, the API error code and the body; match it with `errors.AsType`. A transport failure returns the `net/http` error, wrapped. See [error handling](/docs/sdks/go/errors.md).

## Example

key-details/main.gogo

```go
package main

import (
	"context"
	"fmt"
	"log"

	addresszen "go.addresszen.com/sdk"
)

func main() {
	client := addresszen.NewClient("ak_test", addresszen.WithManagementKey("uk_test"))
	res, err := client.KeyDetails(context.Background(), "ak_test")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%s: %d lookups remaining\n", res.Result.Name, res.Result.LookupsRemaining)
}
```
