DriveSmart API: Car Search Body Style



About The Body Style Car Search API

Our search APIs allows users to look for cars meeting criteria such as:

  • Body Style: Including factors such as fuel type, seats, gearbox and fuel type;
  • Company Cars: Including P11D value, CO2 output, annual or monthly benefit and tax;
  • Performance: Including top speed, acceleration, BHP and engine configuration;
  • Equipment & Features: Including factors such as standard equipment and zero cost options;
  • Price: Including factors such as list price and on-the-road price;
  • Electric Cars: Including factors such as battery range and recharge time;
  • Monthly Payment: Including factors such as the finance type, term and annual mileage;

The APIs can be combined to produce searches by factors such as company car tax and body style or battery range.

Dataset

Data can be provided as 'JSON' or 'XML' datasets and you can choose the type of data returned in your HTTPS request by declaring 'json' or 'xml' in the 'd_Type' element of the request string.

JSON is the default type for the dataset if no 'd_Type' is set.

Our Demo

Our demonstrator provides an illustration of how the car search API works using XML.

Set the criteria for the search (body style, fuel type, etc) to see a list of cars matching the requirements.

We have set out our demo with a structured approach to each phase of the search request, adding criteria likely to be dependent on each preceding selection.

This allows supplementary {GET:} request to be made after each criteria {GET:} request for a count of the number of cars matching the criteria.

Details of the count {GET:} request are set out in the demo and follow the same key:value pair protocols for the main {GET:} requests.

The relative HTTPS {GET} requests for every stage of the criteria selection are given below, including the final search request using all selected criteria.

You can copy and paste the sample request strings into a browser address bar to see the raw XML data returned for the request (right click on the browser page displayed and you will see the XML dataset).

You can also substitute XML for JSON when you perform the 'copy|paste' exercise.

For our returned datasets we have provided:

  • a table formatted to provide a display similar to a typical end-user experience
  • an unformatted table to display the dataset results
  • an unformatted table to display the dataset results
  • a sample XML dataset for the table

Within each returned dataset we include all the body style search criteria irrespective of those selected so that the end-user can further refine the search.

The dataset also includes the CAPID of each vehicle which then allows a link to data on individual vehicles from other APIs.

{GET} Requirements

The {GET} request follows standard HTTPS key:value pair protocols. No response will be given for an HTTP request.

The {GET} request for a search requires only our standard security login/session token and search parameters according to the pair:value keys below.

All of the keys set out below are independent and can be used individually or in conjunction with other keys to build selection criteria for a car which meet the user's requirements.

The keys from each search can also be combined to create more sophisticated searches, e.g. body style by monthly payment, performance by body style, etc.

Security

A session token is created on initial login and must be included as a cookie with all HTTPS requests or the request will fail.

If the user's browser does not allow functional cookies then the {GET} request will become orphaned and the request cannot be linked to any other requests in the same session.

If the session token is not included then the session will be terminated, any data created in the session may be erased at the server and the user may need to re-authenticate with a new session.

For security reasons the HTTPS protocol must be used for all {GET} requests so that all data passed between the browser and the server is encrypted, including the session token.

Pair:Value Summary

d_type: xml or json for the required return data type (json if not specified)

Optional: v_body: A string from the following values:

ValueRepresents
H Hatchback
S Saloon
E Estate/SUV/Tourer
C Coupe
V Convertible

This includes:
Cabriolets (CAP-HPI body code "B")
Soft Tops (CAP-HPI code "O")
Speedsters (CAP-HPI code "Q")
Roadsters (CAP-HPI code "R")
W 4x4

This includes:
Station Wagon (CAP-HPI code "W")
Hard Top (CAP-HPI code "A")

Optional: v_fuel: A string from the following values

ValueRepresents
A Diesel/Electric Range Extender
B Petrol/LPG
C Hydrogen Fuel Cell
D Diesel
E Electric
F Petrol/Bio Ethanol (E85)
G Petrol/CNG
H Petrol/Electric Hybrid
P Petrol
R Petrol/Electric Range Extender
X Petrol/PlugIn Electric Hybrid
Y Diesel/Electric Hybrid
Z Diesel/PlugIn Electric Hybrid

Optional: v_transmission: A string from either "M" (manual) or "A" (automatic)
Optional: v_seats: An integer (current maximum 9)
Optional: v_drivetrain: A string from "F" (front wheel drive) or "R" (rear wheel drive) or the integer 4 (4 wheel drive)
Optional: v_gears: An integer (current maximum 10)
Optional: v_doors: An integer (current maximum 6)
Optional: v_mfr: A string for the manufacturer's name from the lists derived by the car manufacturer API {GET} request (normally restricted to the manufacturers pre-qualified by prior selections)
Optional: v_mod: A string for the manufacturer's model range from the lists derived by the car model API {GET} request (normally restricted to the manufacturer pre-qualified by the manufacturer selection)


 



Search Criteria

I want a