# legislation.gov.uk API: Search UK legislation

> Search UK legislation by topic or title, with optional type and year filters. Closest title matches appear first; broader text matches fill remaining places.

Unofficial. Not affiliated with or endorsed by legislation.gov.uk.

- Page: https://fous.com/methods/legislation.gov.uk/search-legislation
- Method: `legislation.gov.uk/search_legislation`, version 1
- Website: legislation.gov.uk
- Returns: title, year, type, number as cited, date enacted or made, link
- Effect: read (it gets data and changes nothing)
- Sign-in: none needed
- Cost: 1 credit per completed run (1¢ with pay as you go); failed runs are free
- Verified: Nov 2, 2026

## Inputs

| Field | Type | Required | In the run below | Description |
|---|---|---|---|---|
| `type` | string | no | `"northern_ireland_act"` | Kind of legislation, for example uk_act; any searches every kind. One of "any", "uk_act", "statutory_instrument", "scottish_act", "welsh_act", "northern_ireland_act". Default "any". |
| `year` | integer | no |  | Year of enactment or making, for example 2018. |
| `query` | string | yes | `"education"` | Topic or title words to search, for example data protection. |
| `max_results` | integer | no | `3` | Maximum laws to return, for example 20. Default 20. |

## Output

From a run on Oct 31, 2026. Its input:

```json
{
  "type": "northern_ireland_act",
  "query": "education",
  "max_results": 3
}
```

Its output:

```json
{
  "laws": [
    {
      "link": "https://www.legislation.gov.uk/nia/2014/12",
      "type": "Northern Ireland Act",
      "year": 2014,
      "title": "Education Act (Northern Ireland) 2014",
      "number": "2014 c. 12 (N.I.)",
      "enacted_or_made_date": "2014-12-11"
    },
    {
      "link": "https://www.legislation.gov.uk/nia/2022/15",
      "type": "Northern Ireland Act",
      "year": 2022,
      "title": "Integrated Education Act (Northern Ireland) 2022",
      "number": "2022 c. 15 (N.I.)",
      "enacted_or_made_date": "2022-04-26"
    },
    {
      "link": "https://www.legislation.gov.uk/nia/2016/20",
      "type": "Northern Ireland Act",
      "year": 2016,
      "title": "Shared Education Act (Northern Ireland) 2016",
      "number": "2016 c. 20 (N.I.)",
      "enacted_or_made_date": "2016-05-09"
    }
  ]
}
```

## Run it

From code, with a Fous API key in `FOUS_API_KEY`; the answer's `data` holds the output:

```bash
curl https://api.fous.com/v1/runs \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method":"legislation.gov.uk/search_legislation","input":{"type":"northern_ireland_act","query":"education","max_results":3}}'
```

From an AI agent connected to the Fous MCP server: its `run` with the same method and input. To connect one, give it `set up https://fous.com/SKILL.md`.

## Ask your agent

- Find UK Acts of Parliament about modern slavery, with their citation numbers and dates of enactment
- Which statutory instruments made in 2020 relate to coronavirus restrictions? Give me up to 50 with links.
- Search legislation.gov.uk for Scottish Acts on land reform
- I need a list of Welsh laws about the environment from 2016, including the date each was made
- Look up Northern Ireland Acts concerning pensions on legislation.gov.uk and show the top 10 matches

## Input schema

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "type": {
      "enum": [
        "any",
        "uk_act",
        "statutory_instrument",
        "scottish_act",
        "welsh_act",
        "northern_ireland_act"
      ],
      "type": "string",
      "default": "any",
      "description": "Kind of legislation, for example uk_act; any searches every kind."
    },
    "year": {
      "type": "integer",
      "maximum": 9999,
      "minimum": 1000,
      "description": "Year of enactment or making, for example 2018."
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Topic or title words to search, for example data protection."
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum laws to return, for example 20."
    }
  }
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "laws"
  ],
  "properties": {
    "laws": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "title",
          "year",
          "type",
          "number",
          "enacted_or_made_date",
          "link"
        ],
        "properties": {
          "link": {
            "type": "string",
            "description": "Legislation page link."
          },
          "type": {
            "type": "string",
            "description": "Legislation type in words."
          },
          "year": {
            "type": "integer",
            "description": "Year of the law."
          },
          "title": {
            "type": "string",
            "description": "Name of the law."
          },
          "number": {
            "type": "string",
            "description": "Number as cited."
          },
          "enacted_or_made_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date enacted or made, if provided."
          }
        },
        "additionalProperties": false
      },
      "description": "Matching laws, closest title first."
    }
  },
  "additionalProperties": false
}
```

## See more

- [legislation.gov.uk API: Get UK law section](https://fous.com/methods/legislation.gov.uk/get-law-section.md): Gets the latest available revised text of a section of a UK Act from legislation.gov.uk, or the Act's section contents when no section is given. The outstanding-changes flag describes the Act and may include changes outside the selected section.
- [European Union API: Search EU law](https://fous.com/methods/eur-lex.europa.eu/search-eu-law.md): Searches EUR-Lex legal acts by topic, ranked by the site's relevance, filtered by document type, year of adoption and in-force status. Short names and ELI links are included when shown in the results.
- [The National Archives API: Search judgments](https://fous.com/methods/caselaw.nationalarchives.gov.uk/search-judgments.md): Searches UK court judgments and tribunal decisions on Find Case Law by keywords or party names. Results can be filtered by court and by judgment date.
- [GOV.UK API: Check a name against the UK Sanctions List](https://fous.com/methods/gov.uk/check-sanctions.md): Checks a name against the current UK Sanctions List and returns possible matches in the site's best-match order, with designation details. Results may include entries that only mention the name in their reasons, so check each entry before identifying anyone.
- [Companies House API: List company filing history](https://fous.com/methods/find-and-update.company-information.service.gov.uk/list-filing-history.md): Lists a UK company's Companies House filings, newest first, with date, form code, type, description, page count and PDF link. Finds the company by name, company number or Companies House link; a category picks accounts, confirmation statements, officers, address, capital, charges or incorporation filings.
- [Companies House API: Search companies](https://fous.com/methods/find-and-update.company-information.service.gov.uk/search-companies.md): Searches the UK Companies House register by company name and returns each company's status, type, incorporation date and registered office address, in result order.
- [European Union API: Get EU law article](https://fous.com/methods/eur-lex.europa.eu/get-law-article.md): Gets the official text and key dates of one article of an EU regulation or directive from EUR-Lex, in the latest consolidated version when there is one, in any official EU language.
- [Federal Register API: Search rules and notices](https://fous.com/methods/federalregister.gov/search-rules.md): Find Federal Register rules, proposed rules, notices, and presidential documents by topic, agency, publication dates, and comment status. Significant means designated significant by the source; documents without that designation show no.
- [All legislation.gov.uk methods](https://fous.com/methods/legislation.gov.uk.md)
