Similar Cars Widget by Marketcheck Cars, Inc.

Rohit Lalwani
Marketcheck APIs
Published in
3 min readFeb 8, 2021
Similar Cars widget showing Jeep Grand Cherokee active listings in CA, USA
Similar Cars widget showing Jeep Grand Cherokee active listings in CA, USA

What are Marketcheck Widgets ?

Marketcheck Widgets are web widgets for automotive websites powered by Marketcheck APIs. Marketcheck widgets allow you to enrich your auto website using data from Marketcheck APIs. The portal playground allows you to modify the look and feel of your widgets and provides ready to use code snippets that you could simply copy-paste to embed the widget in your existing website or create a car search portal from scratch.

Similar Cars Widget

As the name suggests, this widget shows similar cars around a given location along with few other parameters which can be tweaked that I will discuss in this article.

Similar cars widget can be used on Vehicle’s Details Page (VDP) to show cars that might interest visitors based on current vehicle they are viewing.

How to embed?

It is as easy as importing some scripts in your web application and start using tags right away. Following are basic steps required to get started with using any available Marketcheck Widget.

  1. Import zone.js with version > 0.9.0 from https://cdnjs.com/libraries/zone.js/0.9.0
  2. Import MarketCheck widgets JS file from Marketcheck Widgets code section.
  3. Start using widget. On Marketcheck Widgets you can find all parameters available for this widget. We will go into details of how to use Marketcheck Widgets Playground in this blog.
Note: zone.js must be added before adding widgets js file.

Sample tag for Similar Cars

<similar-cars 
access_token=''
vin="1C4RJFLGXLC379303"
vdp_root = "your-vdp-root"
target ="_blank"
car_type="used"
rows="20"
location='{"latitude":"34.05","longitude":"-118.24","radius":"100"}'
match="year,make,model"
version='1'
></similar-cars>

You can fill in all the parameters according to your requirements and start using it.

Link to Vehicle Description Page(VDP) ?

Similar Cars widget shows Show Details button at the bottom of each listing card which is link to your VDP page. It follows a pattern for VDP link generation.

<vdp_root>/<YEAR>_<MAKE>_<MODEL>_<MC_API_LISTING_ID>

<vdp_root> here is is vdp_root parameter provided in tag.

APIs used

Similar cars widget uses Inventory Search API to fetch Similar Listings. As inventory search API supports search using city, state, zip as well, you can modify location parameter like

location='{"city":"","state":"","zip":""}

you can omit any of these values , it is not mandatory to provide all 3 city, state, zip together. For lat-log location object all 3 values are required.

location ='{"latitude":"", "longitude":"", "radius":""}'

Marketcheck widgets support OAuth 2.0 which lets you create short lived access_tokens for authentication using your API Key and Client Secret. You can find more info on access_token generation in this blog.

For testing widgets on playground on widgets.marketcheck.com , you can generate access_token by logging in to that portal and entering the details in dashboard.Generated access_token is automatically populated in playground for testing.

Conclusion

Marketcheck provides many such widgets which can be used to improve an existing car search portal / create a car search portal. In this blog we saw how to embed similar cars widget. Marketcheck APIs can be used to create many such widgets.

For suggestions or queries , you can reach us at widgets@marketcheck.com

--

--