GOV.UK · Search
gov-uk/government-publications/searchSearch public records with GOV.UK · Search from Alexandria through one Spiral API key. To find GOV.UK pages on a topic or from a department (e.g. DESNZ consultation outcomes since August 2026, HMRC guidance on VAT, the latest news and communications), to page a GOV.UK finder URL without scrolling, or to list what changed since a date; then read one with get_page. It runs in the background and returns structured JSON. Pay as you go, with no subscription.
Pricing
$0.00873 per call.
Limits
- Runs
- In the background
- Returns
- json
- Longest queue wait
- 1 hour
- Run deadline
- 5 minutes
- Longest run, end to end
- 225 minutes
- Largest inline input
- 1 MB
- Largest input file
- 2 GB
- Largest output
- 5 GB
Input
| Field | Kind | Default | Description |
|---|---|---|---|
q | text | — | Search words. Optional: without q the filters list documents newest first. |
to | text | — | Latest public timestamp, YYYY-MM-DD (inclusive). Pattern: ^\d{4}-\d{2}-\d{2}$. |
url | text | — | A pasted GOV.UK finder URL instead of filters: https://www.gov.uk/search/all, /search/news-and-communications, /search/guidance-and-regulation, /search/policy-papers-and-consultations, /search/research-and-statistics, /search/transparency-and-freedom-of-information-releases or /search/services, with or without .atom. Its keywords, organisations[], people[], world_locations[], topical_events[], level_one_taxon, content_store_document_type, public_timestamp[from]/[to] (dd/mm/yyyy or yyyy-mm-dd) and order are mapped to the Search API; combine only with limit and cursor. Pattern: ^https?://. |
from | text | — | Earliest public timestamp, YYYY-MM-DD (inclusive). Pattern: ^\d{4}-\d{2}-\d{2}$. |
limit | number 1 to 50 | — | Results per page, 1 to 50 (default 10). |
order | one of relevance, newest, oldest, most_viewed | — | relevance (default with q; needs q), newest (default without q), oldest (by public timestamp, the last public change) or most_viewed. |
taxon | list | — | GOV.UK topic taxonomy content ids (the finder's level_one_taxon / level_two_taxon); matches the taxon and everything below it. |
cursor | text | — | next_cursor from an earlier call (a result offset). Pattern: ^[0-9]+$. |
person | list | — | Person slugs, e.g. keir-starmer (the people[] finder filter). |
supergroup | list | — | Content purpose supergroups (any of them), the groupings behind the GOV.UK finders: news_and_communications, guidance_and_regulation, policy_and_engagement (policy papers and consultations), research_and_statistics, transparency (transparency and FOI releases), services. |
organisation | list | — | Organisation slugs (any of them), e.g. department-for-energy-security-and-net-zero, hm-revenue-customs, office-for-product-safety-and-standards. list_organisations returns slugs. |
document_type | list | — | GOV.UK document types to include (any of them), e.g. consultation_outcome, closed_consultation, open_consultation, guidance, detailed_guide, policy_paper, news_story, press_release, official_statistics, research, product_safety_alert_report_recall. An unknown type matches nothing. |
topical_event | list | — | Topical event slugs. |
world_location | list | — | World location slugs, e.g. ukraine. |
Same request in code
curl https://api.spiral.ai/v1/runs \
-H "Authorization: Bearer $SPIRAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"provider": "alexandria",
"model": "gov-uk/government-publications/search",
"input": {
"q": "<q>"
}
}'Frequently asked questions
How much does GOV.UK · Search cost?
$0.00873 per call. You pay as you go from one Spiral balance, with no subscription, and a failed run is not charged.
How do I use GOV.UK · Search through an API?
Send `POST /v1/runs` with `"provider": "alexandria"`, `"model": "gov-uk/government-publications/search"` and the input fields on this page, using one Spiral API key. It runs in the background: poll the run, or name a webhook to be told when it finishes.
Do I need an account with Alexandria to use GOV.UK · Search?
No. Spiral runs it on its own Alexandria account and charges your Spiral balance.
Can my AI agent use GOV.UK · Search?
Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.