# key2name

:::tip
Avoid using key2name in a loop, instead @[check out the new `keys2names`](mention://a06d7d5b-bc64-4b4b-943c-d712e9da1695/document/1203345f-0361-406f-aca1-841ab1fae2a7) action!

:::

Returns an avatar’s Second Life name by their UUID. This command works in opposition to [name2key](/doc/88619a93-265a-4959-b98f-ffd4af0eeb36).

```csharp
// See "LSL Helper Functions" page for this function
smartbotsAPI("key2name", [
  "key", "76e96174-ddcf-482f-86aa-c9394664082f",
  "request_case", 1
]);
```

```snippet http-api-variables-OmJyUigTgO
```


:::info
This API command applies only for **Standard bots**.

:::

```snippet http-api-input-basic-parameters-5FcVlaJbq0 action="key2name"
```

```snippet http-api-input-q5yvAagqsZ
key          | yes      | The UUID of the avatar
request_case | optional | Set to `1` to get the avatar’s name in the exact case as it appears in Second Life (otherwise it may be lowercase)
```

```snippet http-api-output-JAwUcmg7i7
key  | The UUID you sent
name | The avatar’s Second Life name
```

# Return value

The command returns the Second Life name associated with the specified UUID.  
Use [name2key](/doc/88619a93-265a-4959-b98f-ffd4af0eeb36) to perform the reverse lookup (get a UUID from a name).

# Example

**Requesting the avatar’s Second Life name by UUID:**

```
https://www.mysmartbots.com/api/bot.html?action=key2name&key=76e96174-ddcf-482f-86aa-c9394664082f&...
```

**Result:**

```
name = BarKeeeper Resident
key = 76e96174-ddcf-482f-86aa-c9394664082f
```