Search
On Enterprise and Spectre, Moveguide's search behind your own search box: a guest types where, when, how many and what they'd like, Moveguide finds the parts of the map that suit it, and your system answers with your stays there, free on their dates for as many as are coming. Your system gets map tiles, the dates and how many — never the guest's words — and we never read your listings.
How it works
- The guest types into your search box:
quiet 2-bed in Lekki Phase 1 for 2 adults, 3 to 7 December, near a gym. - As they type, a checklist under the box ticks off what a search needs — a location, dates, how many people and a preference — and your search button comes on once all four are there (What a search needs).
- Moveguide's search layer sends the words from the browser straight to Moveguide. They never go to your server.
- Moveguide picks the parts of the map that suit it, best first, in the place the search names.
- Your webhook gets those parts of the map with the dates and how many are coming, finds your stays there, and answers with them.
- Your page gets the stays and shows them as your feed, in your own design.
Your search box
The box, the button and the results are yours; Moveguide adds only the checklist under the box. Add the search layer with your key, and name your form. On a page that already has the widget's tag, the first script line isn't needed.
<form id="stay-search">
<input type="search" name="q" placeholder="Where, when, how many, and what you'd like">
<button>Search</button>
</form>
<script src="https://platform.moveguide.co/widget-embed.js"></script>
<script>
Moveguide.initSearch({
apiKey: "YOUR_API_KEY",
form: "#stay-search",
onResults: function (matches, notice) {
// Your stays, best first: show them as your feed. notice says why there are none
},
onError: function (message) {},
onUnavailable: function () {
// Search is off for this visitor's country: use your own search
},
});
</script>form— as the guest types, the layer reads its search field (itstype="search"input, else its first text field) for the checklist; when it's sent, the words go to Moveguide, and the form never sends them to your server.- The guest types their dates; date fields on your page count too (The guest's dates).
- Searching from your own code instead of a form:
Moveguide.search(words);— with the guest's dates,Moveguide.search(words, { checkin: "2026-11-02", checkout: "2026-11-09" }); noticesays why there are no stays to show —Moveguide doesn't cover that city yet., orWe don't know that place well enough yet.— and is empty otherwise. Nothing the layer hands back repeats the guest's words.- It works on your whitelisted domains only, like the widget, and not where your country rules turn search off.
What a search needs
A search runs once the guest has given four things — in the words they type, in any order:
| Check | What ticks it |
|---|---|
| Location | A place in a city Moveguide covers — a neighbourhood, an estate, the city itself — or another place they name: in Lekki Phase 1, ikoyi, near Yaba |
| Date | When they're staying — or the dates in your date fields, or the page's: 3 to 7 December, Dec 3–7, this weekend, from 4 Dec for 3 nights |
| Persons | How many are coming: for 2 adults, 2 adults and 2 kids, a family of four, just me |
| Preference | What they'd like — the kind of stay, what it's for, what it should have or be near, a budget: a shortlet, 2-bed, for a wedding, quiet, with a pool, near a gym, under 50k |
- The checklist sits just after your form, in your page's own type, and ticks each one off as the guest types.
- Your search button is on only once all four are ticked.
- A search without them — Enter pressed early, or a search from your own code — isn't run: what's missing asks for itself in the checklist, as
Add your datesorAdd how many. It isn't counted or charged. - A guest's Moveguide Passport ticks none of them: the preference is the search's own.
- A place Moveguide doesn't know yet isn't searched:
noticesaysWe don't know that place well enough yet.
To place the checklist yourself, draw your own, or gate a button outside the form:
Moveguide.initSearch({
apiKey: "YOUR_API_KEY",
form: "#stay-search",
checklist: "#search-needs", // where it goes; false to draw your own
button: "#search-button", // when it isn't the form's own
onChecklist: function (state) {
// { location: true, date: false, persons: true, preference: true, complete: false, asked: [] }
},
onResults: function (matches, notice) {},
});checklist— where it goes, as a selector or an element;falseto draw your own fromonChecklist.button— your search button, when it isn't the form's own.onChecklist— each time the checklist changes: which of the four are there, whether the search iscomplete, and what a search sent without themaskedfor.- Its parts carry the classes
mg-checklist,mg-checkandmg-check-box, withdata-need,data-doneanddata-asked: style them as you like — your styles come first. - When search is off for a visitor's country, or the layer can't start, the checklist goes and your button is yours again.
The guest's dates
With the guest's check-in and check-out dates, as YYYY-MM-DD, the search reads the rain forecast for those days. A tile prone to flooding with heavy rain, a downpour or rain after a wet spell due on the guest's dates comes after every tile without, marked floodOnDates — never left out, so a wet week still finds stays. For the days the forecast doesn't reach yet, the search leans away from tiles prone to flooding when the dates fall in the city's rainiest months.
The dates the guest types come first — 3 to 7 December, this weekend. Without dates in the words, the search layer sends them from the first of these that has them:
- From your own code, the dates you pass:
Moveguide.search(words, { checkin: "2026-11-02", checkout: "2026-11-09" }); - The date fields you name in
initSearch— when they're outside the form, or named differently:
Moveguide.initSearch({
apiKey: "YOUR_API_KEY",
form: "#stay-search",
checkin: "#arrival", // your date fields, anywhere on the page, holding YYYY-MM-DD
checkout: "#departure",
onResults: function (matches, notice) {},
});- Your form's fields named
checkinandcheckout, else its first two date fields. - When those are empty, the page's dates:
Moveguide.setDates, or Avis's tag on the same page (The guest's dates).
Without dates anywhere, the checklist asks for them. On your listing pages, Avis warns guests of rain on their dates too (Rain and flooding).
The words stay with Moveguide
What guests type is read by Moveguide alone; your system works from the tiles. The box is on your page, so keep its words out of everything else — our terms ask it:
- Not in page addresses: a plain form would put them there — the layer stops it.
- Not in your logs, analytics or session recordings: mask the field in those tools.
- Details about the home itself — bedrooms, price — are in the words too: keep your own filters for them, beside the box.
- Your console counts searches, never their words.
Your webhook
Set its address in Settings → General, under Search: https, and reachable from the internet. Each search is one call:
POST https://api.example.com/moveguide/search
Content-Type: application/json
Moveguide-Signature: t=1760781600,v1=5d8c…
{
"version": 1,
"requestId": "6f1c2a4e-…",
"resolution": 9,
"tiles": [
{ "h3": "89589c8a57bffff", "lat": 6.447289, "lng": 3.473712, "radiusM": 200, "rank": 1 },
{ "h3": "89589c8a54fffff", "lat": 6.44728, "lng": 3.470826, "radiusM": 200, "rank": 2 },
{ "h3": "89589c8a0b7ffff", "lat": 6.444856, "lng": 3.472593, "radiusM": 200, "rank": 3, "floodOnDates": true }
],
"h3Tiles": ["89589c8a57bffff", "89589c8a54fffff", "89589c8a0b7ffff"],
"checkin": "2026-12-03",
"checkout": "2026-12-07",
"guests": 2
}tiles— up to 200, best first: map tiles in the open H3 grid at resolution 9, about a tenth of a square kilometre each. Find your stays in them by each stay's H3 index at resolution 9 — or, without H3, by distance: a stay withinradiusMof a tile's centre is in it.h3Tileslists the same tiles, in the same order.floodOnDates— true on a tile prone to flooding with heavy rain, a downpour or rain after a wet spell due on the guest's dates; those tiles come after the others. Left out otherwise.checkin,checkout— the guest's dates, asYYYY-MM-DD: send back stays that are free then.guests— how many are coming: stays that sleep that many.requestId— one for each search.test— true when the search came from a test key.
Answer within 5 seconds, with JSON:
{
"matches": [
{ "id": "listing-123", "h3": "89589c8a57bffff", "title": "2-bed in Lekki Phase 1", "url": "https://…" },
{ "id": "listing-456", "lat": 6.4490, "lng": 3.4751 }
]
}idis required; up to 100 stays. Everything else in each goes to your page untouched.h3— orlatandlng— where the stay is, so a guest's Passport can order it.- Your page gets the stays in your order, unless a guest's Passport is on.
Checking it's Moveguide
Each call is signed. Moveguide-Signature holds the time it was sent (t, in Unix seconds) and v1, an HMAC-SHA256 of t, a full stop and the raw body, made with your signing secret. Owners and Admins find the secret in Settings, under Search. Turn away a call whose signature doesn't match, or that was sent more than five minutes ago:
import crypto from "node:crypto";
// rawBody: the request body exactly as it arrived, before any JSON parsing
function fromMoveguide(rawBody, header, secret) {
const [, t, v1] = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header ?? "") ?? [];
if (!t || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
const expected = crypto.createHmac("sha256", secret).update(t + "." + rawBody).digest();
return crypto.timingSafeEqual(expected, Buffer.from(v1, "hex"));
}With a Moveguide Passport
A guest unlocks their Moveguide Passport in Avis; on a page with Avis and your search box, it's on for both. Your webhook gets the same call with or without it. Moveguide then orders the stays you send back by how well each one's vicinity suits the guest; stays without h3 or lat and lng keep your order, after the others. You never receive the Passport.
A passport number typed in your search box is never searched: Avis opens the Passport with it, and onError says so.
What's counted
- Searches are billed in sessions, like conversations with Avis: a visitor's searches are one session for as long as each comes within 30 minutes of the last, up to 10 — then the next search starts a new one. Each session comes from your plan's included sessions, then at your plan's rate.
- Each search is a search in the Overview and a call in Logs — never its words. Its session counts among your sessions.
- A search without all four checks isn't run, counted or charged; Logs show it as Search incomplete.
- Test keys' searches reach your webhook, marked
test, and aren't counted or charged. - When your wallet can't pay for a new session, or a spending cap set to pause is reached, search pauses as Avis does:
onErrorgetsSearch is taking a short break — please try again a little later.Use your own search meanwhile. A session under way carries on.
Limits
| Limit | Value |
|---|---|
| Words in a search | Up to 500 characters |
| Tiles in a call | Up to 200 |
| Stays in an answer | Up to 100 |
| Time to answer | 5 seconds |
| Searches a minute | The widget's own limits — one visitor, and one network |
| Searches in a session | Up to 10, each within 30 minutes of the last |
| Plans | Enterprise and Spectre |
What each message means: Errors and limits.