Documentation

API Reference

The Autoprice API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

There are two endpoints:

Retail Price: Calculates an estimated retail price (B2C) for a vehicle or batch of vehicles.

Supply Gauge: Matches the make and model of a vehicle to other vehicles of the same make and model within 100kms of the user’s registered business premises.

You can test the Autoprice API in POSTMAN.  

Host for Test environment: https://test-de.autoprice.io/  

Authentication

The Autoprice API uses tokens to authenticate requests for both endpoints. To get a token, make a request to the authentication resource with your username and password.  

Authentication to the API is performed via HTTP Basic Auth.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

POST
/api/login
curl --location --request POST 'https://de.autoprice.io/api/login' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'username={username}' \
--data-urlencode 'password={password}'
'
POST
/api/login
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("username", "{username}");
urlencoded.append("password", "{password}");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("https://de.autoprice.io/api/login", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
POST
/api/login
import requests

url = "https://de.autoprice.io/api/login"

payload='username={username}&password={password}'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
Successful Response
{
    "access_token": {access_token},
    "token_type": "bearer"
}

Get Retail Price for a Vehicle

Parameters

To request a retail price for a vehicle or batch of vehicles you need to provide authorization via the token you have received within the header.

Request Body

The request body must include “brand”, “model” and “manufactureyear” and this value must be in our database otherwise it will return a null value. If "id" is missing, then the "id” for Retail Price response will be null.

POST
/api/retailprice

curl --location --request POST 'https://de.autoprice.io/api/retailprice' \
--header 'Authorization: Bearer {your token here}' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
    "id":1,
    "brand": "AUDI",
    "model":"A1",
    "bodytype": "Cabrio",
    "mileage": 141361,
    "transmission": "Automatik",
    "doors": 2,
    "power": 288,
    "fuel":"Benzin",
    "manufactureyear": "2022",
    "color":"Schwarz",
    "emissionclass": "EURO4"
    }
]
'
POST
/api/retailprice

var myHeaders = new Headers();
myHeaders.append("Authorization", "JWT {your token here}");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify([
  {
    "id": 1,
    "brand": "AUDI",
    "model": "A1",
    "bodytype": "Cabrio",
    "mileage": 141361,
    "transmission": "Automatik",
    "doors": 2,
    "power": 288,
    "fuel": "Benzin",
    "manufactureyear": "2022",
    "color": "Schwarz",
    "emissionclass": "EURO4"
  }
]);

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://de.autoprice.io/api/retailprice", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
  
POST
/api/retailprice

import requests
import json

url = "https://de.autoprice.io/api/retailprice"

payload = json.dumps([
  {
    "id": 1,
    "brand": "AUDI",
    "model": "A1",
    "bodytype": "Cabrio",
    "mileage": 141361,
    "transmission": "Automatik",
    "doors": 2,
    "power": 288,
    "fuel": "Benzin",
    "manufactureyear": "2022",
    "color": "Schwarz",
    "emissionclass": "EURO4"
  }
])
headers = {
  'Authorization': 'JWT {your token here}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Successful Response (200)

For each vehicle “id’ the API sends a Retail Price in euros.

Successful Response
[
  {
    "id": "1",
    "retailprice": 35146.0625
  }
]
Unsuccessful Response

400	BAD REQUEST.	
The body format is incorrect

401	UNAUTHORIZED.
The token is incorrect

404	NOT FOUND.
The endpoint is incorrect
Notes:
If Null value is returned for Retail Price we suggest displaying “Price Unavailable”.

Supply Gauge

This endpoint will take a vehicle, or a batch of vehicles’ make and model and match it to other vehicles of the same make and model within 100kms of the user’s registered business address.

Authentication is via the same method as described for the Retail Price endpoint.

Parameters

To request the supply gauge for a vehicle or batch of vehicles you need to provide authorization via the token you have received within the header.

Request Body

The request must include the vehicle “id”, “brand”, “model” and the postal code of the user’s registered business address.

You can submit multiple vehicles and multiple postal codes.

POST
/api/supplygauge/nearbyvehiclesCount

curl --location --request POST 'https://de.autoprice.io/api/supplygauge/nearbyvehiclesCount' \
--header 'Authorization: Bearer {your token here} ' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
        "id": 1,
        "brand": "Abarth",
        "model": "595",
        "postalcode": 40629
    },
    {
        "id": 2,
        "brand": "audi",
        "model": "a6",
        "postalcode": 66787
    }
]'
POST
/api/supplygauge/nearbyvehiclesCount
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {your token here}");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify([
  {
    "id": 1,
    "brand": "Abarth",
    "model": "595",
    "postalcode": 40629
  },
  {
    "id": 2,
    "brand": "audi",
    "model": "a6",
    "postalcode": 66787
  }
]);

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://de.autoprice.io/api/supplygauge/nearbyvehiclesCount", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
POST
/api/supplygauge/nearbyvehiclesCount
import requests
import json

url = "https://de.autoprice.io/api/supplygauge/nearbyvehiclesCount"

payload = json.dumps([
  {
    "id": 1,
    "brand": "Abarth",
    "model": "595",
    "postalcode": 40629
  },
  {
    "id": 2,
    "brand": "audi",
    "model": "a6",
    "postalcode": 66787
  }
])
headers = {
  'Authorization': 'Bearer {your token here}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Successful Response

Number of similar cars within 100kms of the postal code sent per each vehicle id in the request.

Successful Response
[
    {
        "id": "1",
        "brand": "ABARTH",
        "model": "595",
        "postalcode": "40629",
        "nearby_vehicle_count": 34
    }
    {
        "id": "2",
        "brand": "AUDI",
        "model": "A6",
        "postalcode": "66787",
        "nearby_vehicle_count": 129
    }
]
Unsuccessful Response

400	BAD REQUEST.	
The body format is incorrect

401	UNAUTHORIZED.
The token is incorrect

404	NOT FOUND.
The endpoint is incorrect
Notes:
If Null value is returned for Supply Gauge we suggest displaying “Matches Unavailable”.

Schemas for Retail Price

Authentication

{ 

username	string 
			required: true 
			minLength: 1 
			The username to access to the API 

password	string 
			required: true 
			minLength: 1 
			The password to access to the API 

} 
AuthResponse

string 
	properties: OrderedMap  
	{"access_token": OrderedMap  
	{"type": "string",  
	"description": "Token needed to get retail price" }  
} 
RetailPrice

[{

id						string/float/int
						required: true 
						minLength: 1 
						The identifier of the car 
          

brand					string 
						required: true 
						minLength: 1 

model					string 
						required: true 
						minLength: 1 

bodytype				string 
						minLength: 1 

mileage					string/float/int 
						minLength: 1 
						Mileage of the car in Kilometers 

transmission			string 
						minLength: 1 

doors					string/float/int 
						minLength: 1 

power					string/float/int 
						minLength: 1 
						Power of the car in KW 

fuel					string 
						minLength: 1 

manufactureyear			string/float/int 
						required: true 
						Length: 4 
						Year when the car was manufactured 

color					string 
						minLength: 1 

emissionclass			string 
						minLength: 1 

}] 
RetailPriceResponse

[{

id				string/float/int 
				minLength: 1 
				The identifier of the car 

retailprice		int 
				minLength: 1 
				Price Estimated of the car in EUROS 
}]
Notes:
A null value will occur if the data sent in the fields “Brand”, “Model” and/or “Manufacturer Year” is incorrect.
Please refer to RetailPrice Schema for correct format.

Schemas for Supply Gauge

Authentication

{ 

username	string 
			required: true 
			minLength: 1 
			The username to access to the API 

password	string 
			required: true 
			minLength: 1 
			The password to access to the API 

} 
AuthResponse

string 
	properties: OrderedMap  
	{"access_token": OrderedMap  
	{"type": "string",  
	"description": "Token needed to get supply gauge" }  
} 
SupplyGauge

[{ 

id				int/string
        		required: true 
				minLength: 1 
				The identifier of the car 

brand			string 
				required: true 
				minLength: 1 

model			string 
				required: true 
				minLength: 1 

postalcode		int/string 
				required: true 
				Postal Code of the user’s registered business address as stored in the API user’s database in Germany 

}] 
SupplyGaugeResponse

[{ 

id						string
						required: true 
						minLength: 1 
						The identifier of the car 

postalcode				string 
						required: true 
						Postal Code of the user’s registered business address as stored in the API user’s database in Germany 

similar_cars_count		int 
						minLength: 1 
						Number of similar cars around 100 kilometers 

brand					string
						required: true
              			min-length: 1
      
model					string
						required: true
      					min-length: 1  

}] 
Notes:
A null value will occur if the data sent in the fields “Brand”, “Model” and/or “Postal Code” is incorrect. Please refer to
SupplyGauge Schema for correct format.