micheleberardi / racingmike_motogp_import

Version 2.0
MIT License
10 stars 1 forks source link

MotoGP API Documentation

This README provides detailed instructions on how to use various MotoGP APIs to retrieve results, seasons, categories, events, and session details.

This API are from MOTOGP OFFICIAL WEBSITE

on my github you can find the code to import the data from the API to the database.

Getting Started

These instructions will guide you through the process of fetching data from the MotoGP APIs.

Prerequisites

Before you start, ensure you have a stable internet connection and an API client like Postman or a similar tool to make requests to the provided URLs.

API Endpoints

1. List Seasons

2. List Categories for a Season

3. List Events

4. List Sessions


5. Getting Race Session Results

This section explains how to fetch results for a particular MotoGP race session.

API Endpoint for Race Session Results

Example

To retrieve results for a specific race session, use the session ID obtained from the 'List Sessions' API. For instance, to get results for the session with the ID cb7655d9-387b-4247-9bbe-a067bbe484ff, the request URL will be:

https://api.motogp.pulselive.com/motogp/v1/results/session/cb7655d9-387b-4247-9bbe-a067bbe484ff/classification?test=false

Sample Response

A successful request will return a JSON response containing the classification of riders for the session. Here is a snippet of what the response might look like:

{
  "classification": [
    {
      "id": "f5315e45-c742-4e94-a1d3-5dbee24b5edb",
      "position": 1,
      "rider": {
        "full_name": "Alex Marquez",
        "country": {"iso": "ES", "name": "Spain"},
        "number": 73
        // more rider details...
      },
      "team": {
        "name": "Gresini Racing MotoGP",
        // more team details...
      },
      "constructor": {
        "name": "Ducati",
        // more constructor details...
      },
      "best_lap": {"number": 12, "time": "01:38.7820"},
      "total_laps": 15,
      "top_speed": 339.6,
      "gap": {"first": "0.000", "prev": "0.000"},
      "status": "INSTND"
    },
    // more riders...
  ]
}

6. Retrieving MotoGP Season Standings

This section details how to obtain the standings for a specific MotoGP season and category.

API Endpoint for Standings

Example

To get the standings for the MotoGP category in the 2023 season, use the following request URL:

https://api.motogp.pulselive.com/motogp/v1/results/standings?seasonUuid=db8dc197-c7b2-4c1b-b3a4-6dc534c023ef&categoryUuid=e8c110ad-64aa-4e8e-8a86-f2f152f6a942

Sample Response

The API response provides details about the riders' standings, including their position, points, team, and more. Here's a snippet of the response:

{
  "classification": [
    {
      "position": 1,
      "rider": {"full_name": "Francesco Bagnaia", "country": {"iso": "IT", "name": "Italy"}, "number": 1},
      "team": {"name": "Ducati Lenovo Team"},
      "constructor": {"name": "Ducati"},
      "session": "RAC",
      "points": 412
    },
    // More riders...
  ],
  "file": "https://resources.motogp.com/files/results/2023/MAL/MotoGP/RAC/worldstanding.pdf"
}

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Data Attribution and Disclaimer

Data Source

The data utilized in this project is sourced from the official MotoGP APIs. This includes race results, standings, and other related information.

Ownership and Rights

All data provided through these APIs is the property of MotoGP or its respective owners. The use of this data within this project is for informational and non-commercial purposes.

Disclaimer

This project is not affiliated with, endorsed by, or in any way officially connected with MotoGP or any of its subsidiaries or affiliates. The official MotoGP website can be found at https://www.motogp.com.

Contact and Issues

If there are any concerns or questions regarding the use of MotoGP data in this project, or if it is believed that the data usage infringes on any rights or terms of use, please reach out to hello@micheleberardi.com for immediate action.

https://api.motogp.pulselive.com/motogp/v1/timing-gateway/livetiming-lite