Skip to content

Instantly share code, notes, and snippets.

@jomo
Last active October 30, 2024 01:49
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 Jul 25, 2024

No program is required, read previous comment for how to / breakdown of situation. I think you might find it's worth your time if you need the information for something like account recovery.

I feel it is worth mentioning for those newly discovering this thread but the original code no longer works as intended for several reasons. The most prominent being fairly recent massive changes to the API and the possible discontinuation of the current API version. Also as I mentioned in an earlier post some time before the most recent account migration, several changes were made to the API, the method that the original program used to narrow the date to a very specific time broke as those values no longer exist. so the original program no longer works to any degree. Again for some accounts simply going to the web directory https://api.ashcon.app/mojang/v2/user/ and putting in your username or the desired username after the last / gives you the creation date. This is essentially what the original and various other programs made by other users is doing to determine the creation date but is limited to just the day of creation not the time. Also since exact times can no longer be determined, creating or using a program to check account age is redundant. Simply put the URL into your search bar, put the username in and hit enter. The date created will show up towards the bottom of the page of text and if the value is Null, No value, etc it could be due to a number of reasons. The account may not have been migrated at some point, not migrated "properly", made after or before certain dates (usually associated with changes to the API made by Mojang.), changes to the original username over time, and so many other things it can be difficult to say for sure why any given account returns a Null or other than normal value. It is also very important to note that even if an account does return a date that date may be incorrect. I can not say for sure prior to the last major migration/API changes but as of the current state of the API some account ages are incorrect or inaccurate due to reasons such as: the value changing after previous migration/API changes to the date the account was migrated, the API mistaking a new user for an old user or username that no longer owns a valid account so the value is overwritten with the date of that original user/username, or the value can just be flat out wrong due to odd inaccuracies in the way Mojang's API works. My account still works surprisingly but rarely can I find any accounts anymore that still return accurate dates or any dates at all, likely as they will possibly be removing it entirely some time soon. If you didnt start playing around 2010-2013, odds are that you get Null or something similar and even old players are not guaranteed to work or even be correct. As of or around Nov 4, 2020 the functionality and accuracy of determining a minecraft accounts age has essentially become impossible without directly contacting mojang and requesting the information which they are not very likely to give due to "security concerns". If things still don't make sense I suppose look at the previous comments or read this one again as I'm pretty sure the OP has either abandoned this project, their account, or moved onto other things entirely so ating OP's username is pointless. Mojang nor OP support this feature any longer so really it's just up to us to search the API manually via URL. And if copying and pasting a URL into your search bar is really more work than typing out the username and a comment asking someone to search it for you, then you are truly beyond help.

@mtndewv
Copy link

mtndewv commented Jul 25, 2024

@mtndewv nvm im smooth brained i figured it out

Glad it helped, if only people read the comments lol

@Narrotorbadev
Copy link

@mtndewv nvm im smooth brained i figured it out

Glad it helped, if only people read the comments lol

Was on my phone automatically thought i could not do it, glad to know it works on any device.

@Me123dk
Copy link

Me123dk commented Sep 2, 2024

@glee75 sorry, another null :(

hi can you check " TechwizardDK" ?

@nimbus321
Copy link

@glee75 sorry, another null :(

hi can you check " TechwizardDK" ?

sorry, another null

@Glynnshed2012
Copy link

@glee75 sorry, another null :(

hi can you check " TechwizardDK" ?

sorry, another null

Hello, could you try Glynnshed? If that doesn't work try either Lyndhurst2016 or Glynnshed2012.

@nimbus321
Copy link

@glee75 sorry, another null :(

hi can you check " TechwizardDK" ?

sorry, another null

Hello, could you try Glynnshed? If that doesn't work try either Lyndhurst2016 or Glynnshed2012.

Glynnshed2012 was created at 2020-10-01

@nimbus321
Copy link

LISTEN!!

For anyone that is new to this post, just open https://api.ashcon.app/mojang/v2/user/YOUNICKHERE
You don't need anything else.

@P3nguinMinecraft
Copy link

P3nguinMinecraft commented Sep 24, 2024

LISTEN!!

For anyone that is new to this post, just open https://api.ashcon.app/mojang/v2/user/YOUNICKHERE You don't need anything else.

what does it mean if the creation history is null

oh i backread and it seems like most accounts cant find creation date because of api and migration

@Srelock
Copy link

Srelock commented Oct 22, 2024

This is what i got from running the script.
range: 1263146630 <-| 1263146633
range: 1263146630 <-| 1263146631
target is <= 1263146630
PS C:\Windows\system32>
i tried the web lint it says 2020 i have screenshots from 2019

@mtndewv
Copy link

mtndewv commented Oct 30, 2024

For anyone just joining us or actually reading the comments (thank you to those who have done so)
A seemingly new method has been found to determine a more exact account creation date using the inspect element/dev tool in chrome on Minecraft.net in order to find your own account creation date. (i've tested it myself and since I've already determined the exact time prior to the API changes using the original script for my own account, I can confirm the date/time matches with the new method.)

One catch being that you must be able to log into your account on minecraft.net, and therefore you can only check the creation date/time for your own account, not that of others. If you are looking to determine the account age for someone else, they will have to do so themselves, This is due to the requirement of needing the access token associated with that account. For obvious security reasons only the owner of the account should have access to this.

Instructions for the new method:
Go to minecraft.net.
Log in to your Microsoft account.
Go to your profile page.
Click on Profile Name under Minecraft: Java Edition.
Open Inspect Element (press Ctrl + Shift + I on Windows or Command + Option + I on Mac).
Navigate to the Network tab.
Refresh the Minecraft webpage.
In the filter box (usually at the top-left of the Network tab), type namechange.
Click on "namechange" from the list below.
In the right panel, click on Preview or Response.
Look for "createdAt"; that is your account creation date/time.
(e.g., "createdAt": "2012-04-30T00:00:00Z").

If that's still unclear search something like "How to see when you've created your minecraft account" on Youtube.

While Id love to create a basic program that simply asks you to log into your Microsoft/Minecraft account and tells you the date, I severely lack the coding experience. If any one else would like to do so instead it doesn't seem like too difficult of a task and we could finally get people to stop asking others to do searches for them.

Mine on, Gamers.

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