# Get Redis Key Example

> Example of accessing and managing Redis keys for caching with API Maker.

Source: https://docs.apimaker.dev/v1/examples/sys/cache/getKey.html

`g.sys.cache.getKey` calls the [get redis key system API](https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-get-redis-key-api.html) from your code.

### Get redis keys

Get redis key using global object 'g'.

- Get single redis key value.

```ts
await g.sys.cache.getKey("REDIS_KEY_NAME");
```

- Get multiple redis keys values.

```ts
await g.sys.cache.getKey(["REDIS_KEY_NAME", "ANOTHER_REDIS_KEY_NAME"]);
```

## Related

- [Get redis key system API](https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-get-redis-key-api.html) · [Automatic caching](https://docs.apimaker.dev/v1/docs/features/automatic-caching.html) · [The global object g](https://docs.apimaker.dev/v1/docs/pre-defined-terms/global-object-g.html)
