The OpenSearch protocol lets you describe a search engine for your website,
so that browsers or other search clients can use that search engine.
How OpenSearch works
In your website or web application, you include a link to an OpenSearch description document. In this document, you describe how browsers can interact with an underlying search engine. This interaction is based on URL templates, for example,https://mysite.com?q={searchTerms}
,
which tell browsers how to make search requests.
Since the interaction between the browser and search engine is based on a URL,
you need to enable URL synchronization.
Create an OpenSearch description document
The OpenSearch description document is an XML file following the OpenSearch specification. For example:XML
<ShortName>
is the name of your app or website search. It must be 16 or fewer characters.<Description>
is a human readable description of your search engine. It must be 1024 or fewer characters.<Url>
has thetemplate
attribute, that browsers use to create the URL to your search engine.<Image>
has a URL (linkToImage) to a PNG image that represents your website, for example, the favicon.
The XML document must be served with
Content-Type: application/opensearchdescription+xml
media type.Include the OpenSearch description document in your website
You can reference the XML document in the<head>
of your web pages:
HTML