openapi: 3.0.1
servers:
  - url: https://api.parliament.uk/search
info:
  contact:
    email: data@parliament.uk
    name: Data & Search team at UK Parliament
    url: https://www.parliament.uk/
  description: Performs search on parliament.uk domain. Implements [OpenSearch specification](https://github.com/dewitt/opensearch). Throttled at 10 requests per second per IP address.
  license:
    name: Open Parliament Licence
    url: https://www.parliament.uk/site-information/copyright-parliament/open-parliament-licence
  title: UK Parliament Search Service
  version: Live
  x-TODO-termsOfService: null
  x-apisguru-categories:
    - open_data
  x-origin:
    - format: openapi
      url: https://api.parliament.uk/search/openapi.json
      version: "3.0"
  x-providerName: parliament.uk
  x-serviceName: search
externalDocs:
  description: OpenSearch github repository
  url: https://github.com/dewitt/opensearch
paths:
  /description:
    get:
      externalDocs:
        description: OpenSearch github repository
        url: https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md#opensearch-description-document
      responses:
        "200":
          content:
            application/opensearchdescription+xml: {}
          description: Open Search Description
      summary: OpenSearch description document
      tags:
        - Description
  /query:
    get:
      externalDocs:
        description: OpenSearch github repository
        url: https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md#opensearch-response-elements
      parameters:
        - $ref: "#/components/parameters/q"
        - $ref: "#/components/parameters/start"
        - $ref: "#/components/parameters/count"
        - $ref: "#/components/parameters/subdomains"
        - $ref: "#/components/parameters/inUrlPrefixes"
      responses:
        "200":
          $ref: "#/components/responses/searchResponse"
      summary: Search results
      tags:
        - Query
  "/query.{extension}":
    get:
      externalDocs:
        description: OpenSearch github repository
        url: https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md#opensearch-response-elements
      parameters:
        - description: extension
          in: path
          name: extension
          required: true
          schema:
            enum:
              - atom
              - rss
              - html
              - json
            type: string
        - $ref: "#/components/parameters/q"
        - $ref: "#/components/parameters/start"
        - $ref: "#/components/parameters/count"
        - $ref: "#/components/parameters/subdomains"
        - $ref: "#/components/parameters/inUrlPrefixes"
      responses:
        "200":
          $ref: "#/components/responses/searchResponse"
      summary: Search results
      tags:
        - Query
components:
  parameters:
    count:
      in: query
      name: count
      schema:
        type: number
    inUrlPrefixes:
      in: query
      name: inUrlPrefixes
      schema:
        type: string
    q:
      in: query
      name: q
      required: true
      schema:
        type: string
    start:
      in: query
      name: start
      schema:
        type: number
    subdomains:
      in: query
      name: subdomains
      schema:
        type: string
  responses:
    searchResponse:
      content:
        application/atom+xml: {}
        application/json: {}
        application/rss+xml: {}
        text/html: {}
      description: Search results
