NHS API: Search nearby services
Find nearby NHS service listings from a UK postcode or town, nearest first. NHS service search covers England; urgent_care returns A&E listings. Hours, patient availability and websites are null when not shown.
Unofficial. Not affiliated with or endorsed by NHS.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- Service, required
service Service to find, for example pharmacy.
pharmacy
One of
gp_surgery,pharmacy,dentist,urgent_care,hospital,optician.- Location, required
location UK postcode or town, for example SW1A 1AA or Leeds.
SW1A 1AA
- Max Results optional
max_results Maximum listings to return, for example 10 (up to 50).
3
Whole number from 1 to 50. Default
10.
Input as JSON
{ "service": "pharmacy", "location": "SW1A 1AA", "max_results": 3}Output
{ "services": [ { "name": "Boots", "phone": "020 7828 6013", "address": "5 CATHEDRAL WALK, VICTORIA, LONDON, SW1E 5JH", "website": "https://www.boots.com/" , "postcode": "SW1E 5JH", "nhs_page_link": "https://www.nhs.uk/services/pharmacy/boots/XFHV67" , "distance_miles": 0.3, "opening_hours_today": "7:30am to 8pm", "accepting_new_patients": null }, { "name": "Boots", "phone": "020 7834 5792", "address": "107 VICTORIA STREET, LONDON, SW1E 6RA", "website": "https://www.boots.com/" , "postcode": "SW1E 6RA", "nhs_page_link": "https://www.nhs.uk/services/pharmacy/boots/XFQT75" , "distance_miles": 0.3, "opening_hours_today": "8am to 7pm", "accepting_new_patients": null }, { "name": "Dolphins Pharmacy", "phone": "020 7222 1828", "address": "9-11 THE BROADWAY, LONDON, SW1H 0AZ", "website": null, "postcode": "SW1H 0AZ", "nhs_page_link": "https://www.nhs.uk/services/pharmacy/dolphins-pharmacy/XFKE09" , "distance_miles": 0.4, "opening_hours_today": "9am to 5:30pm", "accepting_new_patients": null } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"nhs.uk/search_nearby_services","input":{"service":"pharmacy","location":"SW1A 1AA","max_results":3}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "nhs.uk/search_nearby_services" , "input": { "service": "pharmacy", "location": "SW1A 1AA", "max_results": 3 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "nhs.uk/search_nearby_services" , "input": { "service": "pharmacy", "location": "SW1A 1AA", "max_results": 3 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run nhs.uk/search_nearby_services# with {"service":"pharmacy","location":"SW1A 1AA","max_results":3}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "location", "service" ], "properties": { "service": { "enum": [ "gp_surgery", "pharmacy", "dentist", "urgent_care", "hospital", "optician" ], "type": "string", "description": "Service to find, for example pharmacy." }, "location": { "type": "string", "description": "UK postcode or town, for example SW1A 1AA or Leeds." }, "max_results": { "type": "integer", "default": 10, "maximum": 50, "minimum": 1, "description": "Maximum listings to return, for example 10 (up to 50)." } }}Output schema
{ "type": "object", "required": [ "services" ], "properties": { "services": { "type": "array", "items": { "type": "object", "required": [ "name", "address", "postcode", "phone", "distance_miles", "opening_hours_today", "accepting_new_patients", "website", "nhs_page_link" ], "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "address": { "type": [ "string", "null" ] }, "website": { "type": [ "string", "null" ] }, "postcode": { "type": [ "string", "null" ] }, "nhs_page_link": { "type": "string" }, "distance_miles": { "type": [ "number", "null" ] }, "opening_hours_today": { "type": [ "string", "null" ] }, "accepting_new_patients": { "type": [ "boolean", "null" ] } }, "additionalProperties": false } } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
nhs.uk/search_nearby_services- Returns
- name, address, postcode, phone, distance, today's opening hours, new-patient status, website, NHS page link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method nhs.uk/search_nearby_services with the inputs above.
Ask your agent
- Find dentists near LS6 2AB that are currently taking on new NHS patients, closest first
- Which pharmacies close to Bristol are open today? Give me their hours and phone numbers
- List the nearest A&E departments to M14 5RB, up to 5, with distances
- Using nhs.uk, show me 20 GP surgeries near Norwich and whether they're accepting new patients
- I need an optician near SE15 4QF — check the NHS website for the closest ones with addresses and websites
See more
All NHS methodsLooks up a medicine in the NHS medicines A to Z and returns its guidance: uses, key facts, who can take it, how to take it, side effects, pregnancy and interactions. Sections absent from NHS guidance are null; a plain name with separate adult and child pages selects the adult page.
nhs.uk/get_medicineGets NHS guidance for a named health condition, including symptoms, when to seek help, causes, treatment and prevention. Sections not shown on NHS pages are null; for conditions with several guidance pages, the review date is the latest among the pages used.
nhs.uk/get_conditionFinds US healthcare providers by name, place, specialty and provider type in the NPI Registry, with practice contact details and primary taxonomy. Results may include providers with similar names.
npiregistry.cms.hhs.gov/search_providersLists UK postcodes nearest to a postcode or named place, with distance, ward, council and coordinates. For places sharing a name, a city or town is preferred.
postcodes.io/list_nearby_postcodesFinds open UK public-sector tender notices on Find a Tender matching keywords, optionally filtered by contract region, estimated value and closing date, newest first.
find-tender.service.gov.uk/search_tendersLooks up a provider in the NPI Registry by 10-digit NPI number and returns the public name, specialties, addresses, contact details and registry dates.
npiregistry.cms.hhs.gov/get_providerFinds the neighbourhood policing team for a UK postcode (England, Wales, Northern Ireland) with its force, contacts, officers, priorities and upcoming events.
police.uk/get_neighbourhood_teamFinds Starbucks cafés near a city, address or ZIP code, nearest first, with whether each is open now, today's local hours and amenities; optionally only cafés open now.
starbucks.com/search_stores