Giter VIP home page Giter VIP logo

motogp-api's Introduction

🚧 The library is not currently working due to major changes in the website it reads the data from.
I may update it in the future but contributions are welcomed 😃

MotoGP-API

GitHub release (latest by date) GitHub all releases

MotoGP-API is a library that reads the results of the MotoGP, 500cc, Moto2 and Moto3 classes from a website. The current version has been developed and tested to read the data from Motorsport Stats.

Contents

Available data

  • Classes

    • Moto3: 2012 - today
    • Moto2: 2010 - today
    • MotoGP/500cc: 1949 - today
  • Sessions

    • Free practices
    • Qualifying practices
    • Grid
    • Race
  • Riders' championship standings

  • Constructors' championship standings

  • Teams' championship standings

Race results example (2019 MotoGP Qatar Grand Prix):

Pos No Rider Nat Team Laps Time (ms)
1 4 Andrea Dovizioso Italy Mission Winnow Ducati 22 2556902
2 93 Marc Márquez Spain Repsol Honda Team 22 2556925
3 35 Cal Crutchlow Great Britain LCR Honda Castrol 22 2557222
4 42 Álex Rins Spain Team Suzuki ECSTAR 22 2557359
5 46 Valentino Rossi Italy Monster Energy Yamaha MotoGP 22 2557502

Championship standings example (2019 season):

Pos Rider Points Results
1 Marc Márquez 420.0 [20.0, 25.0, 0.0, 25.0, ...]
2 Andrea Dovizioso 269.0 [25.0, 16.0, 13.0, 13.0, ...]
3 Maverick Viñales 211.0 [9.0, 0.0, 5.0, 16.0, ...]
4 Álex Rins 205.0 [13.0, 11.0, 25.0, 20.0, ...]
5 Fabio Quartararo 192.0 [0.0, 8.0, 9.0, 0.0, ...]

Getting Started

Installing without Maven

Import the following libraries in your project:

Installing with Maven

First, you need to download the latest motogpapi-x.x.jar release (in the release section) and then install it in your local maven repository. Run the following command:

mvn install:install-file
  -Dfile=<path-to-jar-file>
  -DgroupId="com.github.parsad23"
  -DartifactId="motogpapi"
  -Dversion="3.0.4"
  -Dpackaging="jar"
  -DgeneratePom=true

Then add the motogpapi library to the dependencies in the pom.xml file of your project:

<dependency>
    <groupId>com.github.parsad23</groupId>
    <artifactId>motogpapi</artifactId>
    <version>3.0.4</version>
</dependency>

Usage

Look at the wiki page for a detailed description.

License

This project is under the MIT license. See LICENSE for more information.

Fair Use

For research and study purposes only.

motogp-api's People

Contributors

parsad23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hellequin1600

motogp-api's Issues

Request problem

Hello,

Motorsport stat seems to have changed the whole functioning of their site. So nothing works anymore, do you know what to change or is too much work needed?

Thanks,
Thomas

Don't find Race code

Hello, first of all I wanted to congratulate you for your work!

I am doing this issue because I can't find the race codes in the HTML source code of the pages.
Can you send me the URL of a page of one of the circuits where it can be found so that I understand the logic?

Where can I find the code of the circuit of Jerez for example?

Thanks a lot!
Thomas

getSessionResult not working for MotoGP category

Hi Parsa,

I try to do this :
List<RiderSession> gridByRaceNumber = data.getSessionResults(Category.MotoGP, 2015, "FRA", Session.GRID); or this
List<RiderSession> gridByRaceNumber = data.getSessionResults(Category.MotoGP, 2015, 3, Session.RACE);
but it doesn't work.

I just found the origin of the problem but not the solution. The problem is there when the category is MotoGP, do you have any idea of the solution?
If the category is Moto2 or Moto3 there is no problem.

The error log :

com.github.parsad23.motogpapi.exceptions.DataNotAvailableException: The requested session or data does not exist or is not available
	at com.github.parsad23.motogpapi.reader.URLGenerator.getSessionResultsURL(URLGenerator.java:80)
	at com.github.parsad23.motogpapi.reader.SessionResultsReader.getJSONObjectResults(SessionResultsReader.java:25)
	at com.github.parsad23.motogpapi.reader.SessionResultsReader.getSessionResults(SessionResultsReader.java:17)
	at com.github.parsad23.motogpapi.reader.MotoGPData.getSessionResults(MotoGPData.java:45)
	at testsetstsetmain.main.main(main.java:19)

If it can be helpful I make search and find that in URLGenerator.java :

try{
            races = JsonParser.parseString(JsonReader.readJsonFromUrl(url, referer, base_url)).getAsJsonArray();
        } catch (IOException e){
            throw new DataNotAvailableException("Unable to read the JSONArray containing the races: empty String returned...");
 }

races is an empty array and the URL is https://mssproxy.motorsportstats.com/web/3.0.0/seasons/2015-motogp/races/

Thanks a lot in advance,
Respectfully
Thomas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.