Documentation
JavaScript Quickstart
Note: this is for development and demonstration purposes only. RapidAPI Keys and Client IDs in the below examples will be visible in client-side code, which may or may not meet your implementation needs.
You can easily add Domainr-style instant search to your web and app projects via JavaScript (and optionally, jQuery). The code is available from CDNJS, NPM, or GitHub.
Steps
- Get an API key from RapidAPI, or a
client_id
(for high-volume commercial users). - Via CDNJS, include
domainr-search-box.min.js
anddomainr-search-box.css
in your page (or host these files yourself). - Add an empty
div
under yourinput
element; the Domainr Search Box will fill it with results. - Configure the search box, customizing as needed.
- Style the results accordingly, via CSS.
Note: If you wish to keep your RapidAPI API key secret, you can proxy Domainr API requests through a server you control. In this example the key is published in client-side code, and thus visible (e.g. via browser developer tools) to your site’s visitors, and could be compromised.