> For the complete documentation index, see [llms.txt](https://tuneguycodr.gitbook.io/robloxy-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tuneguycodr.gitbook.io/robloxy-docs/users/get-username-from-id.md).

# Get Username From ID

The function for getting a username from roblox user's ID

It's easy to get a Roblox username from their ID with Robloxy, this function returns a promise which can be resolved into a string

```javascript
const blox = require('robloxy')

blox.getUsername(1)
.then(username => console.log(username))
.catch(err => console.log('That user does not exist'))
```

In this case we are getting the username of a Roblox user whose ID is 1, feel free to replace 1 with any user ID, the value you enter in the function can be a string or an integer, but it should be a valid Roblox user ID or it will throw errors! In this case, this should be logged in the console :

```javascript
ROBLOX
```
