Documentation

Learn how to easily start using the wheelpope API in your website

Registration

To be eligible for using this API you first have to be in possession of a license key to register your web domains for your account. This is usually done within one workday. If delays occur, please refer to our contact page here.

Once you have acquired a license key, proceed to registering a new account. After which you can log in to your account and receive access to your API keys needed to send a valid request to our API.

Order a license key

Send a form request with your order information. After the payment has been processed, our system-manager will send you a license key with the ordered privileges.

shopping_cartOrder a license key
Register your account

Register your account here, you will need a license key to finish the registration.

Log in to your account

Log in to your existing account here, this will lead you to the account page where you can find your api key, and all other information about your account.



Setting up a request

With this API, you can send two types of requests: POST or GET. Each of which having a different way of sending your input parameters. Here you can also find the options to customize the looks of your svg image, each option having effects on the svg image explained further down this page.

JSON POST requests

To send a valid POST request, you must fill in these standard parameters to get a result, in the following JSON format. With each parameter defined below. Finally, including in the request, your own api key found on your account page. Be sure to set "Content-type: application/json" as a header or it might not work. Then, proceed to sending your request to: "http://wheelpope.com/API.php"

                      
{
  "width1": 28,
  "width2": 245,
  "aspect1": 10.5,
  "aspect2": 40,
  "diameter1": 16,
  "diameter2": 20,
  "wheelwidth1": 6.5,
  "wheelwidth2": 9.5,
  "offset1": 40,
  "offset2": 30,
  "key": "{YOUR_API_KEY_HERE}",
}
                  
Options

If you want to add options to this request, to get a more customized response, just extend the JSON with one or more of these option parameters, with a filled in value for each. Leaving out the options you wouldn't like to see changed.

You can find a reference to each option's definition, further down this page.

                      

  "tyrecolor1": "#828282",
  "tyrecolor2": "black",
  "wheelcolor1": "#cacaca",
  "wheelcolor2": "#c4161c",
  "wheelcolor1-fill": "rgba(0,0,0,0.1)",
  "wheelcolor2-fill": "rgba(174,26,26,0.5)",
  "textcolor1": "#acacac",
  "textcolor2": "#c4161c",
  "text1": "text_on_wheel_1",
  "text2": "text_on_wheel_2"
                      
                  
GET requests

To send a valid GET request, you must fill in these standard parameters to get a result. With each parameter defined in the previously mentioned definition list. Finally, including in the request, your own api key found on your account page.

                      
https:/www.wheelpope.com/API.php?
width1=28
&aspect1=10.5
&diameter1=16
&wheelwidth1=6.5
&offset1=40
&width2=245
&aspect2=40
&diameter2=20
&wheelwidth2=9.5
&offset2=30
&key={YOUR_API_KEY_HERE}
                  
                  
Options

If you want to add options to this request, to get a more customized response, just concatenate the url-string with more GET parameters, each having the name of the optional property you would like to change. Leaving out the options you wouldn't like to see changed.

You can find a reference to what each option means further down this page.

                      
&tyrecolor1=%23828282
&tyrecolor2=%23cacaca
&wheelcolor1=black
&wheelcolor2=%23c4161c
&wheelcolor1-fill=rgba%280%2C0%2C0%2C0.1%29
&wheelcolor2-fill=rgba%28174%2C26%2C26%2C0.5%29
&textcolor1=%23acacac
&textcolor2=%23c4161c
&text1=text_on_wheel_1
&text2=text_on_wheel_2

Options explained

Here every option and their effect on the resulting svg image will be shown. Each option parameter name has a number 1 or 2 set behind it to indicate the first, orginal wheel or tyre, and the second, new wheel or tyre.

Note, that for the GET request, the option parameters have to be url-encoded, as GET requests don't accept the following used characters: '(', ')', '#', ',' which can be used for setting custom colors.

tyrecolor

Note, that you can use any css-recognisable color code as well, instead of the color names.


"tyrecolor1": "orange",
"tyrecolor2": "green"
Resulting svg

Here you can see, that the tyre of wheel_1, has turned orange, and the other tyre of wheel_2 has turned green.

wheel_1wheel_2
wheelcolor

"wheelcolor1": "orange",
"wheelcolor2": "green"
Resulting svg

Here you can see, that the wheem of wheel_1, has turned orange, and the other wheel of wheel_2 has turned green.

wheel_1wheel_2
wheelcolor1-fill and wheelcolor2-fill

Now, because the previous example didn't look great, with only the outline changing, we will add the wheelcolor-fill options.


"wheelcolor1": "orange",
"wheelcolor2": "green",
"wheelcolor1-fill": "rgba(255, 166, 0, 0.6)",
"wheelcolor2-fill": "rgba(0, 128, 0, 0.6)"
Resulting svg

The resulting wheels now look much better for a orange-green colored website. Let's proceed to change the text colors to make it workable result.

wheel_1wheel_2
textcolor

It is also possible to change the color of each individual text next to each wheel, This makes it easier to differentiate between each wheel. So let's change the text colors to the appropriate colors.


"textcolor1": "orange",
"textcolor2": "green",
"wheelcolor1-fill": "rgba(255, 166, 0, 0.6)",
"wheelcolor2-fill": "rgba(0, 128, 0, 0.6)",
"textcolor1": "orange",
"textcolor2": "green"
Resulting svg

Now we have a deliverable svg result to be used for a reference in a orange-green themed website.

wheel_1wheel_2


Handling the output

This API returns a JSON string, which holds all the resulting information calculated with your input. In the following examples, we will leave out the svg tag content for reading purposes.

The output

                      
{
"status": 200,
"status_message": "Result Found, total api call count this month: 50",
"data": {
    "firstIsMetric": true,
    "secondIsMetric": true,
    "calculation": {
        "Width": "205",
        "Aspect": "55",
        "Width2": "245",
        "Aspect2": "40",
        "ExistingDiameter": 640.92,
        "NewDiameter": 635.64,
        "ExistingCircumference": 2013.5095635387702,
        "NewCircumference": 1996.9219543278161,
        "Poke": 42.55,
        "Poke2": 100.64999999999999,
        "Inset": 122.55,
        "Inset2": 140.64999999999998,
        "Speederror": 0.8306588635076384,
        "Reading30": 30.249197659052292,
        "Reading100": 100.83065886350764,
        "HeightLoss": -2.6399999999999864,
        "EU_reg": -0.008238157648380429
        },
    "svg": " <svg>...</svg> "
    }
}
                  
Interpreting the result

There are results found on multiple levels of the JSON result. The first ones being status, and status_message. Both of which will give the same result as this example for when your input was correct. Also giving the amount of api calls you have done this month, counted from registration. In case that your output is different, status_message will tell you what is wrong, please refer to the input references section in case of this happening.

We will be focusing more on the data tag, as it contains all the results that can be worked with later.

firstIsMetric

This tells if the measurements of the first wheel have been interpreted as being in ISO Metric units i.e. 205/55-16, or in LT High Flotation units i.e. 25x8-16.

Similarly for secondIsMetric, but for the second wheel.

Width

This is the converted width of the tyre, in millimeters.

Similarly for Width2, but for the second wheel.

Aspect

This is the converted aspect-ratio of the tyre, in percent. When multiplied by it's width, you get the height of the tyre wall.

Similarly for Aspect2, but for the second wheel.

ExistingDiameter

This is the total diameter of the wheel, including the tyre, noted in centimeters.

Similarly for NewDiameter, but for the second wheel.

ExistingCircumference

This is the total circumference of the wheel, including the tyre, noted in centimeters.

Similarly for NewCircumference, but for the second wheel.

Inset

This is how much the wheel sticks in from the center line, towards the brake side.

Similarly for Inset2, but for the second wheel.

Reading30 and Reading100

Here the speed error is applied on both 30 and 100, giving the resulting new actual speeds a car would be going at given no change to the speedometer.

EU_reg

If this value goes below -1.5%, or over 2%, noted it is not allowed by EU law to change to this new set of wheels.

Poke

This is how much the wheel sticks out from the center line, going away from the brake side.

Similarly for Poke2, but for the second wheel.

Speederror

This is the speed error in percentage between the old wheels and the new wheels. This is used to calculate the new speed-readings for 30 and 100 km/h or mph.

HeightLoss

This is the difference in height towards the fender.



References

Here, references for error handling, allowable inputs and other useful information will be provided.

Allowable inputs

Note, that widths below 50, will currently make the API consider the aspect value to be the tyre wall-height in LT High Flotation units, instead of the ratio for ISO Metric units.

  • Widths
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 100
    • 105
    • 110
    • 115
    • 120
    • 125
    • 130
    • 135
    • 140
    • 145
    • 150
    • 155
    • 160
    • 165
    • 170
    • 175
    • 180
    • 185
    • 190
    • 195
    • 200
    • 205
    • 210
    • 215
    • 220
    • 225
    • 230
    • 235
    • 240
    • 245
    • 250
    • 255
    • 260
    • 265
    • 270
    • 275
    • 280
    • 285
    • 290
    • 295
    • 300
    • 305
    • 310
    • 315
    • 320
    • 325
    • 330
    • 335
    • 340
    • 345
    • 350
    • 355
    • 360
    • 365
    • 370
    • 375
    • 380
    • 385
  • Aspects
    • 7
    • 7.5
    • 8.5
    • 9.5
    • 10.5
    • 11.5
    • 12.5
    • 13.5
    • 14.5
    • 15.5
    • 16.5
    • 20
    • 25
    • 30
    • 35
    • 40
    • 45
    • 50
    • 55
    • 60
    • 65
    • 70
    • 75
    • 80
    • 85
    • 90
    • 95
  • Diameters
    • 10
    • 12
    • 13
    • 14
    • 15
    • 16
    • 16.5
    • 17
    • 17.5
    • 18
    • 19
    • 19.5
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
  • Wheelwidths
    • 4
    • 4.5
    • 5
    • 5.5
    • 6
    • 6.5
    • 7
    • 7.5
    • 8
    • 8.5
    • 9
    • 9.5
    • 10
    • 10.5
    • 11
    • 11.5
    • 12
    • 12.5
  • Offsets
    • -65
    • -64
    • -63
    • -62
    • -61
    • -60
    • -59
    • -58
    • -57
    • -56
    • -55
    • -54
    • -53
    • -52
    • -51
    • -50
    • -49
    • -48
    • -47
    • -46
    • -45
    • -44
    • -43
    • -42
    • -41
    • -40
    • -39
    • -38
    • -37
    • -36
    • -35
    • -34
    • -33
    • -32
    • -31
    • -30
    • -29
    • -28
    • -27
    • -26
    • -25
    • -24
    • -23
    • -22
    • -21
    • -20
    • -19
    • -18
    • -17
    • -16
    • -15
    • -14
    • -13
    • -12
    • -11
    • -10
    • -9
    • -8
    • -7
    • -6
    • -5
    • -4
    • -3
    • -2
    • -1
    • 0
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
Errors

There are multiple different possibilities for errors, if you encounter a different one, please report it to one of our system-mangers through our contact page.

Response message Possible solution
JSON format is incorrect. See if your JSON input has as an exact make-up to the examples above.
Key not registered in our system: 'bad_key' Look if your copied your API key correctly or if you haven't accidentally added whitespace to your api string. If this doesn't work, try generating a new API key on your account page.
Some inputs are empty: "argument-name", ... Check if all your basic inputs are filled in.
Some inputs are invalid, and not found in the valid input choices list: "argument-name", ... Check if these inputs are possible by looking at the allowable inputs section. If you are sure we missed some inputs, let us know by contacting our system-managers on the contact page.
Monthly api call count has been exceeded. Next monthly limit reset in: _____ seconds You have exceeded your api-call limit linked to your account license. Increase your request limit by upgrading your license, or you can choose to wait the specified time.
Demo files

This zip file contains PHP and Javascript examples for making both GET and POST requests correctly. These are available for reference, and for saving you some development time. If something still doesn't work in your tests, don't hesitate to contact us.

file_downloadDownload (2Kb)