Difference between revisions of "Mojang API"
Thinkofdeath (talk | contribs) |
Thinkofdeath (talk | contribs) |
||
Line 55: | Line 55: | ||
=== Payload === | === Payload === | ||
− | + | ||
− | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
[ | [ | ||
"maksimkurb", | "maksimkurb", | ||
− | " | + | "nonExistingPlayer" //Test for non-existing player |
] | ] | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Response === | === Response === | ||
+ | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
[ | [ | ||
Line 73: | Line 73: | ||
"demo": true //Game wasn't bought (Only appears, when true) | "demo": true //Game wasn't bought (Only appears, when true) | ||
} | } | ||
− | // | + | // This will return only information about real (existing) profiles. |
] | ] | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== Player Public Skin Information == | == Player Public Skin Information == |
Revision as of 23:31, 17 July 2014
Contents
Notes
All public APIs are rate limited so you are expected to cache the results. This is currently set at 600 per 10 minutes but this may change
Username -> UUID
https://api.mojang.com/users/profiles/minecraft/<username>
This will return the player's current username and uuid
Response
{
"id": "7125ba8b1c864508b92bb5c042ccfe2b",
"name": "KrisJelbring"
}
Username -> UUID at time
https://api.mojang.com/users/profiles/minecraft/<username>?at=<timestamp>
This will return the player's username that they had at the timestamp provided and their uuid. The timestamp is a unix timestamp
Response
{
"id": "7125ba8b1c864508b92bb5c042ccfe2b",
"name": "KrisJelbring"
}
UUID -> All current/previous names
https://api.mojang.com/user/profiles/<uuid>/names
Returns all the usernames this user has used in the past and the one they are using currently
Response
[
"KrisJelbring"
]
Players profiles by names
https://api.mojang.com/profiles/minecraft
Where 'minecraft' - agent name
This will return players profiles.
Payload
[
"maksimkurb",
"nonExistingPlayer" //Test for non-existing player
]
Response
[
{
"id": "0d252b7218b648bfb86c2ae476954d32", //Profile uuid
"name": "maksimkurb", //Profile nickname
"legacy": true, //Profile not migrated to mojang.com? (Only appears, when true)
"demo": true //Game wasn't bought (Only appears, when true)
}
// This will return only information about real (existing) profiles.
]
Player Public Skin Information
https://sessionserver.mojang.com/session/minecraft/profile/<uuid>
This will return the player's username plus any additional information about them (e.g. skins). Example: https://sessionserver.mojang.com/session/minecraft/profile/4566e69fc90748ee8d71d7ba5aa00d20
This has a much stricter rate limit, once a minute per a uuid
Response
{
"id":"profile identifier",
"name":"player name",
"properties":[
{
"name":"textures",
"value":"base64 string",
"signature":"base64 string; signed data using Yggdrasil's private key" // Only provided if ?unsigned=false is appended to url
}
]
}
"value" base64 string decoded:
{
"timestamp":"some numbers",
"profileId":"profile identifier",
"profileName":"player name",
"isPublic":"true or false",
"textures":{
"SKIN":{
"url":"player skin URL"
}
"CAPE":{
"url":"player cape URL"
}
}
}