How the website works ?: Our website is based on the use of the Apex Legends APIs to retrieve specific data about the player we wish to search for.
Detailed explanations: There is a text field available to the user on the website and a button to perform the search once the nickname of the player is entered.
Then, we execute all our functions and getJSON request only when we click on the button and this is done by inserting all our code in the following function:
$("#button2").click(function() {.....}
We then retrieve the data related to the player corresponding to the nickname the user has entered and we first store the url that the getJSON request will use in the variable playerS. You will be able to see, at the end of the code in the following line, the API key which corresponds to my ID on the Apex Legends API website and which allows my request to be correctly authentified:
var playerS = "https://api.mozambiquehe.re/bridge?version=4&platform=PC&player=" + value + "&auth=fI8sff337gKXXXXXXXXXXXXX"; (key hidden)
Finally, after defining our CallbackpS function, we execute the getJSON request and store its value in the variable jqxhr :
var jqxhr = $.getJSON(playerS, CallbackpS);
This storage allows to perform a test in order to check that the getJSON request worked and didn't present any particular errors (404, 405...):
jqxhr.fail(function() {$("#errorp").text("This player cannot be found");}
What is the purpose of this website ?: The objective of this website is to allow regular or experienced players to directly retrieve the most relevant statistics on professional players in particular but also other players. The recovered information allows to determine the difficulty of the season (rank score) or even the legends considered as unavoidable (most played legend of professional players) because the choice of the legend is a very strategic aspect of the game.