DriveSmart API: Company Car Search



About The Company Car Search API

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

  • 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 basic and on-the-road price;
  • Monthly Payment: Including factors such as the finance type, term and annual mileage;
  • Body Style: Including factors such as fuel type, seats, gearbox and fuel type;
  • Electric Cars: Including factors such as battery range and recharge time;

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

The company car search API can find cars by:

  • P11D value;
  • CO2 output;
  • Taxable percentage;
  • annual or monthly benefit;
  • annual or monthly tax;

When no vehicles match the selected criteria (or combination of criteria) an empty table is returned.

In addition to individual criteria the API can display the data across all criteria for a manufacturer's models or a specific model range. Simply select a manufacturer (optionally with model range) to see the data across all criteria.

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 company car search API works using XML.

Set the criteria for the search (taxable benefit, tax due, P11D value, CO2 output or taxable percentage) from the radio button list to choose the minimum and maximum values for the search criteria.

For tax rates you can use the tax API

For tax

The HTTPS {GET} request for each variation in the criteria selection are given once the search is initiated.

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 company car search criteria irrespective of those selected so that the end-user can further refine the search locally.

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

The dataset is sorted by the search criteria, lowest value at the top of the table. For example, a search by annual company car benefit will be sorted by the lowest annual benefit first.

{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. company car tax 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)
target: The string 'COCAR' to define the type of search (company car)
d_set: A string type variable to denote the dataset required from:

"BEN" - Taxable benefit
"TAX" - Tax due
"CO2" - CO2 output
"P11D" - P11D value
"PERCENT" - Taxable percentage of P11D value

cc_min: An integer type variable to define the minimum value for the search
cc_max: An integer type variable to define the maximum value for the search

Optional: p_t_rate: An integer type variable to define the tax rate for the tax due search (e.g. 19, 20 etc)
Optional: p_t_per: A string type variable to define the search period from either 'A' (Annual) or 'M' (Monthly) - this value is required for taxable benefit ('BEN') and tax due ('TAX') searches to denote whether an annual or monthly value is required for the results




 



Search Criteria

Choose how to search: