# MojangProfile
> Represents a Mojang player profile containing a UUID and username.
`gg.lode.bookshelfapi.api.mojang.MojangProfile`
---
## Signature
```java
public class MojangProfile
```
---
## Constructor
| Constructor | Description |
|-------------|-------------|
| `MojangProfile(String uuid, String username)` | Creates a profile with the given UUID and username. |
### Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| `uuid` | `String` | The player's UUID as a string. |
| `username` | `String` | The player's Minecraft username. |
---
## Methods
| Method | Return Type | Description |
|--------|-------------|-------------|
| `getUniqueId()` | `String` | Returns the player's UUID. |
| `getName()` | `String` | Returns the player's username. |
---
## Static Methods
| Method | Return Type | Description |
|--------|-------------|-------------|
| `getMojangProfile(String username)` | `MojangProfile` | Fetches a profile from Mojang's API by username. Throws `IOException`, `ParseException`. |
| `getMojangProfileFromUUID(String uuid)` | `MojangProfile` | Fetches a profile from Mojang's API by UUID. Throws `IOException`, `ParseException`. |
---
## Usage
```java
try {
MojangProfile profile = MojangProfile.getMojangProfile("Notch");
String uuid = profile.getUniqueId();
String name = profile.getName();
} catch (IOException | ParseException e) {
e.printStackTrace();
}
```
---
## Related Pages
- [[Observer/API/Managers/IPlayerManager]]
- [[PlayerLookupHelper]]