Skip to content

Instantly share code, notes, and snippets.

@jomo
Last active April 16, 2024 21:57
Show Gist options
  • Save jomo/be7dbb5228187edbb993 to your computer and use it in GitHub Desktop.
Save jomo/be7dbb5228187edbb993 to your computer and use it in GitHub Desktop.
Tracking down Minecraft account creation

Tracks down when a Minecraft account was created.

How it works

Mojang has an API endpoint for usernames:

https://api.mojang.com/users/profiles/minecraft/<name>?at=<timestamp>

It can be used to find the UUID of an account, by username it used at the given time.
It returns either 200 OK or 204 No Content – indicating that the username was not in use at the time.

That means we can find out whether an account existed at a specific time.
We always look at a range of time, starting with Jan 2010 - now.
The range is then split in half, and a request is made for the intermediate time.
200 means the account already existed, thus created in the first half; 204 means the account did not yet exist, thus created in the second half.
This step is repeated with the respective time range until the exact second is found.
See also: Babylonian Method

Currently it needs about 27 requests to find the creation date.

Caveats

This works with nodejs, however it's not a proper module and the track function doesn't have a callback.

Due to Mojang being Mojang, the API endpoint is horribly broken:

  • It does not work with legacy accounts
  • It does not work with accounts that have been renamed
    • Except sometimes™
    • The result may be inaccurate though

Example usage

The arrow indicates in which half of the time range the account was created.

> track("dinnerbone")

range: 1263146630	<-|  	1453566749
range: 1263146630	<-|  	1358356689
range: 1263146630	<-|  	1310751659
range: 1263146630	  |->	1286949144
range: 1275047888	  |->	1286949144
range: 1280998517	  |->	1286949144
range: 1283973831	<-|  	1286949144
range: 1283973831	  |->	1285461487
range: 1284717660	  |->	1285461487
range: 1285089574	  |->	1285461487
range: 1285275531	  |->	1285461487
range: 1285368510	  |->	1285461487
range: 1285414999	<-|  	1285461487
range: 1285414999	  |->	1285438243
range: 1285426622	<-|  	1285438243
range: 1285426622	<-|  	1285432432
range: 1285426622	  |->	1285429527
range: 1285428075	<-|  	1285429527
range: 1285428075	  |->	1285428801
range: 1285428439	  |->	1285428801
range: 1285428621	<-|  	1285428801
range: 1285428621	  |->	1285428711
range: 1285428667	  |->	1285428711
range: 1285428690	  |->	1285428711
range: 1285428701	  |->	1285428711
range: 1285428707	<-|  	1285428711
range: 1285428707	<-|  	1285428709
range: 1285428707	<-|  	1285428708
found: Sat, 25 Sep 2010 15:31:47 GMT
function check(name, num, callback) {
https.get("https://api.mojang.com/users/profiles/minecraft/" + name + "?at=" + num, function(resp) {
callback(resp.statusCode === 200);
});
};
function track(name, a, b, lastfail) {
a = a || 1263146630; // notch sign-up
b = b || Math.floor(Date.now()/1000);
lastfail = lastfail || 0;
if(a === b) {
check(name, a, function(ok) {
if (ok && lastfail === a-1) {
console.log("found:", new Date(a*1000).toUTCString());
} else {
if (lastfail === 0) {
console.log("target is <= " + a);
} else {
console.log("target is > " + a);
}
}
});
} else {
var mid = a + Math.floor((b-a)/2);
check(name, mid, function(ok) {
if (ok) {
console.log("range: " + a + "\t<-| \t" + b);
track(name, a, mid, lastfail);
} else {
console.log("range: " + a + "\t |->\t" + b);
track(name, mid+1, b, mid);
}
});
}
}
@mtndewv
Copy link

mtndewv commented Aug 6, 2023

@Official-CalcOS pls check my username "sickiss" i cant run program

Literally all you had to do is type https://api.ashcon.app/mojang/v2/user/sickiss into your web browser and you'd get as much info as anyone else can get atm. As sizquirt said, mojang accounts dying soon and this thread will be totally useless. Regardless you nd the 100 other people should read comments more carefully before ating someone. no program is required. Says "sickiss" is null, that's all the info your gonna get. Id guess since you said its not migrated thats why, or its just a newer account so no original mojang account would exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment