Skip to content

Repository files navigation

Parliament.uk Search.Api

Search API for everything public under the parliament.uk domain.

Currently powering beta.parliament.uk/search.

This project is compliant with the OpenSearch 1.1 specification.

The search API can be configured to use different search result providers.

Search API endpoint

Query String Parameters

The search API currently supports one combination of parameters (matching parameters described in the OpenSearch 1.1 specification).

Query string parameterRequiredValidationDefaultOpenSearch parameter
qTruestringsearchTerms
startFalseint, min(1)1startIndex
countFalseint, min(1), max(100)10count

n.b. Corresponding OpenSearch URL template query string "?q={searchTerms}&start={startPage?}&count={count?}".

e.g. Example query "/search?q=who+is+my+mp&start=1&count=10".

Headers

The search API supports 4 feed serialisation formats for its response feeds through the Accept header.

HeaderValue
Accept"application/atom+xml" or "application/rss+xml" or "text/xml" or "application/xml"

Description API endpoint

The /description endpoint returns a valid OpenSearch description document.

OpenSearch description documents can be used to add a search engine to your browser or file explorer.

Search Engine providers

OpenSearch parameters have corresponding search engine providers parameters.

Google CSE

OpenSearch parameterQuery string parameterRequiredValidationDefault
searchTermsqTruestring
startIndexstartFalseint, min(0)0
countnumFalseint, min(1), max(10)10

n.b.Google CSE will be completely shut down by April 1st 2018.

Bing search API

OpenSearch parameterQuery string parameterRequiredValidationDefault
searchTermsqTruestring
startIndexoffsetFalseint, min(0)0
countcountFalseint, min(1), max(50)10

Credits

Authors/contributors to this project in alphabetical order:

  • Matthieu Bosquet
  • Raphael Leung
  • Robert Brook
  • Samu Lang
  • Wojciech Starwiarski

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages