Skip to content

OpenSearch Namespace Reference

The OpenSearch namespace provides elements for communicating search metadata and pagination information in RSS and Atom feeds. It enables search engines and APIs to publish search results in standard syndication formats.

Namespace URIhttp://a9.com/-/spec/opensearch/1.1/
SpecificationOpenSearch 1.1 Draft 2 Response (Original, Web Archive)
OpenSearch 1.1 Draft 6 (GitHub)
Prefix<opensearch:*>
Available inRSS, Atom, RDF
Propertyopensearch

Types

INFO

For details on type parameters (TStrict) and Requirable<T> markers, see TypeScript Reference.

ts
export namespace OpenSearchNs {
  export type Query<TStrict extends boolean = false> = Strict<
    {
      role: Requirable<string> // Required in spec
      title?: string
      totalResults?: number
      searchTerms?: string
      count?: number
      startIndex?: number
      startPage?: number
      language?: string
      inputEncoding?: string
      outputEncoding?: string
    },
    TStrict
  >

  export type Link<TStrict extends boolean = false> = Strict<
    {
      href: Requirable<string> // Required in spec
      rel?: string
      type?: string
      hreflang?: string
    },
    TStrict
  >

  export type Feed<TStrict extends boolean = false> = {
    totalResults?: number
    startIndex?: number
    itemsPerPage?: number
    /** @deprecated Since OpenSearch 1.1 Draft 3. Use atom:link with rel="search" instead. */
    link?: Link<TStrict>
    queries?: Array<Query<TStrict>>
  }
}