Add flight & hotel search to your site
One script tag puts a Fareomagic search card on your page. Visitors search flights or hotels there; results open on fareomagic.com in a new tab, credited to your site.
1. Paste this where the search should appear
<div id="fareomagic-search"></div>
<script src="https://fareomagic.com/embed.js"
data-ref="yoursite"
data-theme="auto"
data-tab="flights"
data-tabs="flights,hotels" async></script>
Replace yoursite with a short name for your site (letters, digits, dots, dashes) — it’s how your visitors’ searches are credited to you.
2. Options
| Attribute | Values | What it does |
|---|---|---|
data-ref | your site name | Added as ref=… to every search; shows up in our partner reports. |
data-theme | light (default), auto, dark | auto follows the visitor’s light/dark setting. |
data-tab | flights (default), hotels | Which search the card opens with. |
data-tabs | flights,hotels | Shows Flights / Hotels tabs. Leave it out for a single search. |
More than one card on a page: give the other containers data-fareomagic-search instead of the id; their own data-* attributes override the script’s.
3. Good to know
- Self-contained. The card renders in a Shadow DOM: your CSS can’t change it and its CSS can’t change your page. It adapts to the width it’s given (one column on phones).
- Small and dependency-free — one script under 12 KB, loaded
async, no fonts or images. - Privacy. The widget sets no cookies and stores nothing. While someone types a city it asks fareomagic.com for place suggestions; nothing else is sent until they press Search. See our privacy policy.
- Opens in a new tab, so your visitor keeps your page.