About The Car Images API
Our Car Images API delivers an image url for new and used cars from the image library of our vehicle data partner CAP-HPI.
The image url can simply be added to an HTML image place holder such as 'img' as 'src=' or an ASP.Net placeholder ('asp:Image') as 'ImageUrl=' .
The images are currently available only as a 1024 x 768 'jpg' files. Alternative file sizes will be released in due course.
Typically the returned Url will be 'HTTPS://www' followed by the file location and ending in the file name as a serial number followed by the '.jpg' file extension.
Where available in the CP-HPI image library, alternative views of the vehicle can be seen by adapting the image file Url before the '.jpg' extension name by adding:
- '_1' for the side profile positioned rear at the left to front at the right
- '_2' for the front of the vehicle
- '_3' for the offset front profile positioned rear at the left and front to the right
- '_4' for the rear of the vehicle
- '_5' for the offset rear profile positioned rear at the left and front to the right
- '_6' for the front interior cockpit area viewed from the driver's seat including steering wheel and instrument panel
For example, file name '12345.jpg' would become '12345_3.jpg' for the offset front profile image.
Url
The Url can be provided as 'JSON' or 'XML' 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 image Url can be retrieved using XML.
To get a Url just choose a manufacturer, then a range and model from the list boxes below.
We will display the relative HTTPS {GET} requests for each stage of car selection; 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.
As each vehicle model selection is made the standard image Url is returned an displayed in our demo.
{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 the image Url only requires our standard security login/session token and the car's CAPID.
The manufacturer, range and model name are not required for the calculation, but these items will be returned as part of the dataset for verification purposes.
The CAPID can be for any vehicle listed by CAP-HPI where an image file exists including discontinued retired models/derivatives.
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)
CAPID: valid CAPID for a car
Optional: we are currently developing alternative libraries with different image sizes and it is envisaged that the height and width will be selectable based on the following parameters:
i_h: the height of the image in pixels
i_w: the width of the image in pixels
only one of the pairs (i_h or i_w) needs to be selected
the available combinations will be:
1024x768
800x600
528x400
215x161
75x56