{"description":"Searches legislation.gov.uk like its full-text search: title, year and number, legislation type and link, in the site's order. First page of results (about 10 items). Returns an empty list when nothing matches.","effect":"read","id":"legislation.gov.uk/search-government","keywords":["legislation","legislation.gov.uk","law","laws","act","acts","statute","regulation","gesetz","gesetze","recht","uk law","statutory instrument"],"output":{"schema":{"properties":{"items":{"items":{"properties":{"reference":{"description":"Year and number as shown, e.g. '2016 No. 679'","type":["string","null"]},"title":{"type":"string"},"type":{"description":"Legislation type, e.g. 'Regulations originating from the EU'","type":["string","null"]},"url":{"type":"string"}},"required":["title","url"],"type":"object"},"type":"array"},"query":{"type":"string"}},"required":["query","items"],"type":"object"},"value":"{query: params.query, items: steps.search.items[?title != `null` && href != `null`].{title: title, reference: reference || `null`, type: type || `null`, url: join('', ['https://www.legislation.gov.uk', href])}}"},"params":{"additionalProperties":false,"properties":{"query":{"description":"Words that appear in the title or text of UK legislation, e.g. 'data protection', 'equality act', 'housing act'","maxLength":100,"minLength":2,"type":"string"}},"required":["query"],"type":"object"},"provenance":{"method":"har","notes":"GET /search?text=… (redirects to /all?text=…) returns server-rendered result rows (tr.oddRow, tr.evenRow) with the title link in the first cell, the year and number in the second, and the legislation type in the third. The q parameter used by the search_url gives only the search form, so the text parameter is used. Fetched once with the same page a visitor loads. Only the first page of results is read.","recorded_at":"2026-11-08T16:50:00.000Z","recorded_by":"wield-forge (claude-haiku agent)"},"requires_login":false,"schema":"https://wield.run/schema/recipe/v1.json","site":{"country":"GB","id":"legislation.gov.uk","language":"en","name":"legislation.gov.uk","origin":"https://www.legislation.gov.uk","origins":["https://www.legislation.gov.uk"]},"steps":[{"description":"Server-rendered full-text search results (read-only GET). /search?text=… redirects to /all?text=…; the result rows are tr.oddRow / tr.evenRow with the title link in the first cell.","expect":{"content_type":"html","status":[200]},"extract":{"html_items":{"items":{"fields":{"href":{"attr":"href","selector":"td:nth-child(1) a"},"reference":{"selector":"td:nth-child(2)"},"title":{"selector":"td:nth-child(1) a"},"type":{"selector":"td:nth-child(3)"}},"max":50,"selector":"tr.oddRow, tr.evenRow"}}},"id":"search","request":{"headers":{"Accept":"text/html"},"method":"GET","query":{"text":"{{params.query}}"},"url":"/all"}}],"task":"Search UK legislation on legislation.gov.uk","tos":{"notes":"Not reviewed. One search page per call, the same page a visitor loads. The site's terms on automated access were not checked.","reviewed":false},"verify":{"checks":["length(output.items) > `0`","length(output.items[?title != `null`]) == length(output.items)","length(output.items[?starts_with(url, 'https://www.legislation.gov.uk/')]) == length(output.items)"],"example_params":{"query":"data protection"},"max_ms":5000},"version":1}