Custom API Integration

Use our custom API integration to integrate our API with your website. By integrating our API solution you can access our data and integrate it with your already existing design

Installation

Step by step guide

1

API Token

Before you can start using KlimaAPI you need an API token

2

Call the API

To call KlimaAPI you need a token as mentioned in step 1. Then you can call it with e.g. Javascript. See example here

//Fetch API
myHeaders.append("Authorization", "Bearer ${API_TOKEN}");

var requestOptions = {
    method: 'GET',
};

function callCars() {
    const url = 'https://greenapi.azurewebsites.net/api/EvDataBase';
    const result = fetch(`${url}/SearchExtended?${PARAMETERS__HERE}`, requestOptions)
        .then(response => response.json())
        .then(data => {
            console.log(data);
         })
        .then(response => response.json())
        .catch(err => {
            console.error('Request failed', err)
        })
}

3

Parameters

To give you an accurate result, include parameters in your search against KlimaAPI.

Brand *

string

query

Model *

string

query

Variant

string

query

BatteryCapacity

string

query

HorsePower

string

query

Wltp

string

query

Results *

integer($int32)

query

4

URL Example

An example of a URL with all parameters

https://greenapi.azurewebsites.net/api/EvDataBase/SearchExtended?Brand=${BRAND}&Model=${MODEL}&Variant=${VARIANT}&BatteryCapacity=${BATTERYCAP}&HorsePower=${HP}&Wltp=${WLTP}&Results=10

5

JSON return

KlimaAPI returns a JSON with all the data you need. See example of a JSON here

[
  {
    "id": String,
    "db_id": String,
    "brand": String,
    "brandRange": String,
    "model": String,
    "fullCarName": String
    "fuelType": String,
    "consumption": String,
    "powerKw": Int,
    "powerHP": Int,
    "modelStart": String,
    "modelEnd": String,
    "co2Class": String,
    "driveType": String,
    "zeroto100inSeconds": Int,
    "topSpeedinKm": Int,
    "rangeInKm": Int,
    "wltpCombined": String,
    "co2Emission": String,
    "batteryCapacity": Int,
    "loadingTimes": [
      {
        "percentageCharge": Int,
        "minutes": Int,
        "chargeType": String
      },
      {
        "percentageCharge": Int,
        "minutes": Int,
        "chargeType": String
      }
    ],
    "guarantee": String,
    "rangeEstimated": Int,
    "rangeColdCity": Int,
    "rangeHigWayCold": Int,
    "rangeCombinedCold": Int,
    "rangeCity": Int,
    "rangeHighWay": Int,
    "rangeCombined": Int,
    "yearlyTax": Int
  }
]

6

Schema

id	string
nullable: true
db_id	string
nullable: true
brand	string
nullable: true
brandRange	string
nullable: true
model	string
nullable: true
fullCarName	string
nullable: true
fuelType	string
nullable: true
consumption	string
nullable: true
powerKw	integer($int32)
powerHP	integer($int32)
modelStart	string
nullable: true
modelEnd	string
nullable: true
co2Class	string
nullable: true
driveType	string
nullable: true
zeroto100inSeconds	number($double)
topSpeedinKm	number($double)
rangeInKm	integer($int32)
wltpCombined	string
nullable: true
co2Emission	string
nullable: true
batteryCapacity	number($double)
loadingTimes	[...]
guarantee	string
nullable: true
rangeEstimated	integer($int32)
rangeColdCity	integer($int32)
rangeHigWayCold	integer($int32)
rangeCombinedCold	integer($int32)
rangeCity	integer($int32)
rangeHighWay	integer($int32)
rangeCombined	integer($int32)
yearlyTax	number($double)

Please select prefered langauge