Question API to query leaderboard results ?

Discussion in 'Community Support' started by rom_rs, Nov 30, 2018.

  1. rom_rs

    rom_rs Member Beta tester

    Joined:
    Dec 24, 2017
    Ratings:
    +13 / 0 / -0
    Hello,
    Quick question for the developpers.
    Is it possible to query the leaderboards like an API / webservice and get the results in a formatted way (like a json file, for example) ?

    I've developped an application for our league (http://ec2-35-180-32-180.eu-west-3.compute.amazonaws.com/results/) that automatically handles the results of our server races (based on the json files generated by the server) but we also have hotlap competitions for which I would like to have an automatic way to retrieve the results and create our own leaderboard.

    Thanks in advance,

    Rom
     
  2. Racki

    Racki Well-Known Member Beta tester

    Joined:
    Aug 17, 2015
    Ratings:
    +122 / 0 / -0
    Hi,
    try to use the F12 tools in your browser when viewing the leaderboard. You will discover the url and the parameters used to get a JSON resonse.

    I also thought about implementing such a feature into RaceApp too ;-)
     
  3. rad

    rad Well-Known Member

    Joined:
    Jan 29, 2015
    Ratings:
    +416 / 0 / -0
    Well, it would be cool to have custom competitions incorporated into portal :)
     
  4. Racki

    Racki Well-Known Member Beta tester

    Joined:
    Aug 17, 2015
    Ratings:
    +122 / 0 / -0
    Well, following the JSON data there is some additional information which is not on the screen, like the time when the entry was created. It could be used to check if the hotlap was set after the private competition has started.
     
  5. rom_rs

    rom_rs Member Beta tester

    Joined:
    Dec 24, 2017
    Ratings:
    +13 / 0 / -0
    Thanks for the quick answer.
    I tried, and I found some POST HTTP Request returning a javascript object which seems to contains what I need but I did not manage to reproduce the same request, could you tell me how you are able to do so?