Before you are able to call our API you need a SportMonks account which can be created here.
To make our first request, we’ll need a way to get authenticated first. Formula One API V1.0 utilizes API tokens for the authentication of requests. You can obtain your free API token here. API tokens can be viewed and managed in Mysportmonks. For the sake of simplicity, we’ll be working with an API token from the free plan.
Example API token: [HdoiD312ND….]
The API token is only meant for your eyes and, as such, should be stored away safely.
Formula One API V1.0 utilizes response codes to indicate successful and failed API requests. When making a request, a code response will always be returned. See below for a short list of possible code responses:
Successful request and data was returned
Part of the request is malformed; the exact reason can be found in the response
Request is not authenticated
Unauthorized request to access data from an ineligible plan
You have reached the response rate limit of your plan
Internal error with our servers
With our token in hand, we can finally make the first request!
Now that all prerequisites have been fulfilled, we’re ready to send our first request to the API!
The request consists of the following components:
The base URL
A path parameter, in this example, we use [leagues]
A query string parameter, this is optional, so we leave this out for now
And finally, your API token
An example of a correctly authenticated request would be:
This request will return all of the seasons eligible for our free plan.