MotR
← Back to Widgets

Widget Documentation

Everything you need to install, customise and troubleshoot the MotR Widget.

Overview

The MotR Widget Platform lets you embed free vehicle lookup tools on any website. The widget is a lightweight JavaScript loader (~12KB) that scans your page for data-motr-widget elements and renders a premium search interface inside them.

When a visitor enters a registration, the widget queries official DVLA & DVSA data via MotR's API, displays a preview card with key vehicle details, and provides a button to view the full report on MotR.

Key features: No dependencies, under 30KB, mobile responsive, dark/light/auto themes, full customisation, analytics tracking, and mandatory "Powered by MotR" attribution.

Installation

Add the MotR widget to your website in three simple steps:

Step 1: Add the script tag before your closing </body> tag:

<script src="https://motr.uk/functions/serveWidgetEmbed"></script>

Step 2: Add the widget div anywhere on your page:

<div data-motr-widget="vehicle-report"
  data-motr-theme="dark"
  data-motr-accent="#2563eb">
</div>

Step 3: That's it. The widget auto-initialises and is ready to use.

Configuration Options

All options are set via HTML data attributes on the widget div:

data-motr-widgetvehicle-reportWidget type (see Future Widgets)
data-motr-themeautodark, light, or auto (follows user preference)
data-motr-accent#2563ebHex colour for buttons and focus states
data-motr-radius16Corner radius in pixels (0–24)
data-motr-button-textCheck VehicleText on the search button
data-motr-placeholderEnter registrationInput placeholder text
data-motr-sizemediumsmall, medium, or large
data-motr-compactfalseSet to true for minimal padding
data-motr-width100%Max width (e.g. 400px, 100%)
data-motr-keyOptional API key for partner attribution

Themes

The widget supports three theme modes:

  • dark — Glassmorphism dark card with deep navy gradient. Best for dark websites.
  • light — Clean white card with subtle shadow. Best for light backgrounds.
  • auto — Automatically follows the visitor's system preference.

You can also customise the accent colour to match your brand. Use any valid hex colour:

<div data-motr-widget="vehicle-report"
  data-motr-theme="dark"
  data-motr-accent="#7c3aed">
</div>

Analytics

The widget automatically tracks the following events to MotR's analytics dashboard:

Widget Load

When the widget renders on page

Search

When a user submits a registration

Lookup Success

When a vehicle is found

Lookup Fail

When no vehicle is found

Preview View

When the preview card is shown

Full Report Click

When user clicks to view full report

Analytics include referring domain, page URL, device type, browser, operating system, and country — all GDPR-compliant with no personal data stored.

If you have a partner API key, analytics are attributed to your account and visible in your partner dashboard.

Rate Limits

To prevent abuse, the widget enforces rate limits:

  • Anonymous (no API key): 30 lookups per hour per IP address.
  • Free plan (with API key): 1,000 lookups per month.
  • Pro plan: 10,000 lookups per month.
  • Enterprise plan: 100,000 lookups per month.

Rate limits reset automatically. If you need higher limits, contact MotR support to discuss an Enterprise plan.

Security

The MotR Widget Platform includes multiple layers of security:

  • API Key Validation: Optional API keys validate partner status and enforce domain restrictions.
  • Domain Validation: Partner API keys can be restricted to specific domains.
  • Bot Detection: Known bots, crawlers and headless browsers are blocked from lookups.
  • Rate Limiting: IP-based and partner-based limits prevent abuse.
  • No Full Plates Stored: Registrations are masked (e.g. AB12***) before analytics storage.
  • CORS Headers: Proper cross-origin headers ensure secure browser communication.
  • No Duplicate Content: The widget renders client-side only — no server-side HTML that could be indexed by search engines as duplicate content.

FAQ

Troubleshooting

Widget not appearing

Ensure the script tag is placed before the closing </body> tag. Check that the widget div has the data-motr-widget attribute. Open your browser console for any error messages.

"Too many searches" error

You've hit the rate limit. Anonymous users get 30 lookups per hour. Wait and try again, or register for a partner API key to increase your limits.

Vehicle not found

The registration may not be in the DVLA database. Check for typos — the widget only accepts valid UK registration formats. Very new or imported vehicles may not have records yet.

Styling conflicts

The widget uses scoped CSS class names prefixed with motr-w-. If your site's CSS conflicts, wrap the widget in a container with all: revert or contact support.