# llRequestUserKey

*LSL function*

```lsl
key key llRequestUserKey(string username);
```

- `string username`: Current or historical username of the avatar to resolve.

- Returns: `key`
- Energy: 10

Requests the Agent ID for the agent identified by name from the dataserver. The name given may be either the current name of an avatar or a historical name that has been used in the past. If no agent can be found with the supplied name this function returns the value [NULL_KEY](/constants/NULL_KEY/).

Returns a handle (a key) that can be used to identify the request when the dataserver event is raised.

The agent being searched for with this function does not need to be signed on to Second Life.

```lsl title="How to use" frame="terminal"
key result = llRequestUserKey("");
```

## Caveats

- This function is throttled. The throttle is undocumented, but as of October 2018 the function appears to support bursts of up to 20 requests and sustained use at an average rate of 1.9 requests per second per owner, per region. (Meaning the throttle applies to all objects in the region with the same owner.) Once tripped, the function fails and says "Too many `llRequestUserKey` requests. Throttled until average falls." on [DEBUG_CHANNEL](/constants/DEBUG_CHANNEL/).
- This function will return a [NULL_KEY](/constants/NULL_KEY/) for any agent that has yet to log on to the grid the function is used on.

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={9-16}
key name_key_query;
default
{
   state_entry()
   {
       name_key_query = llRequestUserKey("rider.linden");
   }

   dataserver(key queryid, string data)
   {
       if ( name_key_query == queryid )
       {
           llSay(0, "The key for this user is : " + data);
       }
   }
}
```

</details>

## Notes

Names are always provided in the form "First\[ Last\]" or "first\[.last\]" (first name with an optional last name.) If the last name is omitted a last name of "Resident" is assumed. Case is not considered when resolving agent names.

## See also

### Functions

- [llRequestUsername](/functions/llRequestUsername/) — to translate a key to a name
- [llName2Key](/functions/llName2Key/) — to fetch avatar UUID by name.

---

*Source: [LlRequestUserKey](https://wiki.secondlife.com/wiki/LlRequestUserKey) on the Second Life Wiki. Content from the Second Life Wiki article LlRequestUserKey (revision 1219012, 2026-08-25), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llRequestUserKey/
