﻿{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Parliament API",
    "description": "This application programming interface exposes authoritative information about the Parliament of the United Kingdom as permissively licensed, standards-compliant, machine-readable linked data.",
    "contact": {
      "name": "Data & Search team at UK Parliament",
      "email": "data@parliament.uk"
    },
    "license": {
      "name": "Attribution 3.0 Unported (CC BY 3.0)",
      "url": "https://creativecommons.org/licenses/by/3.0/"
    },
    "version": "Live"
  },
  "tags": [
    {
      "name": "api.parliament.uk",
      "description": "A collection of APIs serving authoritative information about UK Parliament as permissively licensed, standards-compliant, machine-readable linked data.",
      "externalDocs": {
        "description": "UK Parliament API fundamentals",
        "url": "https://medium.com/@langsamu/api-parliament-uk-7b87597019a4"
      }
    },
    {
      "name": "id.parliament.uk",
      "description": "Authoritative Unique Resource Identifiers for UK Parliament data.",
      "externalDocs": {
        "description": "Cool URIs for the Semantic Web",
        "url": "https://www.w3.org/TR/cooluris/#r303gendocument"
      }
    }
  ],
  "externalDocs": {
    "description": "UK Parliament API fundamentals",
    "url": "https://medium.com/@langsamu/api-parliament-uk-7b87597019a4"
  },
  "servers": [
    {
      "url": "https://api.parliament.uk"
    }
  ],
  "paths": {
    "/odata/openapi.json": {
      "summary": "OData Service OpenAPI Document",
      "get": {
        "externalDocs": {
          "description": "OpenAPI Specification",
          "url": "https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md"
        },
        "responses": {
          "200": {
            "description": "An OpenAPI document describing the (UK Parliament OData Service)[https://api.parliament.uk/odata].",
            "content": {
              "application/json": {}
            }
          }
        },
        "tags": [ "api.parliament.uk" ]
      }
    },
    "/photo/openapi.json": {
      "summary": "Photo Service OpenAPI Document",
      "get": {
        "externalDocs": {
          "description": "OpenAPI Specification",
          "url": "https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md"
        },
        "responses": {
          "200": {
            "description": "An OpenAPI document describing the (UK Parliament Photo Service)[https://api.parliament.uk/photo].",
            "content": {
              "application/json": {}
            }
          }
        },
        "tags": [ "api.parliament.uk" ]
      }
    },
    "/query/openapi.json": {
      "summary": "Query Service OpenAPI Document",
      "get": {
        "externalDocs": {
          "description": "OpenAPI Specification",
          "url": "https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md"
        },
        "responses": {
          "200": {
            "description": "An OpenApi document describing the (UK Parliament Query Service)[https://api.parliament.uk/query].",
            "content": {
              "application/json": {}
            }
          }
        },
        "tags": [ "api.parliament.uk" ]
      }
    },
    "/search/openapi.json": {
      "summary": "Search Service OpenAPI Document",
      "get": {
        "externalDocs": {
          "description": "OpenAPI Specification",
          "url": "https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md"
        },
        "responses": {
          "200": {
            "description": "An OpenAPI Document describing the (UK Parliament Search Service)[https://api.parliament.uk/search].",
            "content": {
              "application/json": {}
            }
          }
        },
        "tags": [ "api.parliament.uk" ]
      }
    },
    "/{id}": {
      "summary": "Dereference Service",
      "description": "This service resolves identifiers of known UK Parliament resources to documents about those resources.",
      "servers": [
        {
          "url": "https://id.parliament.uk"
        }
      ],
      "get": {
        "externalDocs": {
          "description": "W3C Cool URIs for the Semantic Web",
          "url": "https://www.w3.org/TR/cooluris/#r303gendocument"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Local part of identifier",
            "example": "1AFu55Hs",
            "examples": {
              "House of Commons": {
                "value": "1AFu55Hs"
              },
              "Ontology": {
                "value": "schema"
              },
              "Ontology document": {
                "value": "schema/"
              },
              "Class of Houses of Parliament": {
                "value": "schema/House"
              }
            },
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "See Other redirect to a resource lookup endpoint on the Query Service that outputs a content-negotiated canonical representation of the resource.",
            "headers": [
              {
                "Location": {
                  "description": "URL of resource lookup endpoint parametrised with this URI",
                  "schema": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            ]
          },
          "302": {
            "description": "Found redirect for ontology base URI (only for https://id.parliament.uk/schema).",
            "headers": [
              {
                "Location": {
                  "description": "URL of ontology document endpoint on the Query Service",
                  "schema": {
                    "type": "string",
                    "format": "uri",
                    "default": "https://api.parliament.uk/query/schema"
                  }
                }
              }
            ]
          },
          "404": {
            "description": "Not Found error for well-formed URIs that don't represent known UK Parliament resources (with short textual description).",
            "content": {
              "text/plain": {}
            }
          },
          "400": {
            "description": "Bad Request error with short textual description of the Dereference Service.",
            "content": {
              "text/plain": {}
            }
          }
        },
        "tags": [ "id.parliament.uk" ]
      }
    }
  }
}
