Product
Search
Suggestions by name as people type: up to 8 brands, closest first, in Arabic or English, by other, short and former names too. Hamzas and diacritics don’t get in the way, and each result says what it matched. Search isn’t counted as a pull.
Endpoints
- Counts as a pull
- No
- Results
- Up to 8, closest first
- Starts at
- 2 letters
- Limit
- 90 a minute without a key
What you get
Every name
Arabic and English, other and short names, acronyms, former names and version titles.
In Latin letters
An Arabic name written in Latin letters finds it too.
Spelling doesn’t get in the way
Hamzas, taa marbuta, alif maqsura and diacritics: «الأتصالات» finds «الاتصالات».
What it matched
matchedKindsays which name matched, so you can show «former name» beside a result.Light
Slug, both names, thumbnail and verification: enough for a list, without the whole record.
A slug to store
Each result has a
slugto store and read the record with whenever you need.
Try search
Type a name and watch each letter and each request. Change the wait after the last letter to see how many requests it saves.
Every letter you typed; the dark ones sent a request
Type to see how many requests go out.
How it matches
It reads q and answers up to 8 brands, closest first, with total, the count of every match.
It matches the Arabic and English names, other and short names, acronyms, former names, version titles, and an Arabic name written in Latin letters. matchedKind says which of them matched.
It searches the Wasmenia archive only: not websites, not the web. What isn’t in the archive doesn’t appear.
How to use it
- 01
Get a key
Open a developer account in the console and make a key. The free plan is enough to start, and the key stays on your server in an environment variable.
- 02
A route of yours that holds the key
Your page asks your server, and your server calls search with its key.
- 03
Wait after the last letter
200 to 300 milliseconds, and cancel the previous request when a new letter arrives.
- 04
Show the suggestions
A list that works by keyboard: arrows move, Enter picks, Esc closes.
- 05
Store the slug
When the user picks a brand, store
slug, and read its record if you need its logo and colours.
The request
curl -sS -G 'https://new.wasmenia.com/api/v1/search/suggest' \ -H "Authorization: Bearer $WASMENIA_API_KEY" \ --data-urlencode 'q=الاتصالات'With an input field
// In the page: it asks your route, never Wasmenia with your key.let timer;let pending; // the request still in flight, if anyinput.addEventListener('input', () => { clearTimeout(timer); timer = setTimeout(async () => { pending?.abort(); // a newer keystroke makes the older answer useless pending = new AbortController(); try { const url = '/brand-suggest?q=' + encodeURIComponent(input.value); const res = await fetch(url, { signal: pending.signal }); if (res.status === 429) return pauseFor(Number(res.headers.get('Retry-After') ?? 60)); render(await res.json()); } catch (e) { if (e.name === 'AbortError') return; // replaced by a newer request showError(); } }, 250);});The limit
90 requests a minute per address without a key, and your plan’s rate with one. Fewer than two letters answers empty and isn’t counted. With a wait between letters, a normal user stays well below the limit.
Questions
Does it search by website?
No. It searches names only. The website is in the record, in website.
Why nothing for one letter?
One letter matches almost everything. From two letters results become useful; fewer answers an empty list.
I want every result, not the first eight
Search is for suggesting as people type. For the full list use Lists with q, in pages of up to 50.
Use cases that use it
Employer at sign-up
A picker that suggests brands as people type, instead of a free text field.
AI agents
Two tools an agent calls over HTTP: search by name, and read the record.
A brand picker in a form
Search as you type by keyboard, storing the slug, and handling 429.