NHS Organisation Data Service API
Free NHS Organisation Data Service API with no key: look up GP practices, hospitals, trusts and other NHS organisations by ODS code, role, postcode or status.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the NHS Organisation Data Service API?
The NHS Organisation Data Service API is a free, key-free directory of organisations in UK health and social care. It returns each organisation's ODS code, name, status, primary role, postcode and last change date, and supports filtering by role, postcode and modification date.
ODS codes are the identifiers that hold NHS data together — every GP practice, hospital trust, pharmacy and commissioning body has one, and prescribing, referral and activity datasets are keyed by them. This API is the authoritative directory behind those codes, so it is usually the first join in any piece of NHS data analysis.
Two properties of the register catch people out. It is historical as well as current: the example's first two records are inactive local authorities last changed in 2013, because ODS retains organisations after they close so that old data still resolves. Filter on `Status` unless you specifically want the archive. And the role taxonomy is doing the heavy lifting — `PrimaryRoleId` codes such as `RO141` distinguish a GP practice from a trust from a pharmacy, and querying by role is far more reliable than pattern-matching on names. A `LastChangeDate` filter makes incremental syncing straightforward once you have an initial copy.
Quick facts
- Base URL
https://directory.spineservices.nhs.uk/ORD/2-0-0- Authentication
- No API key or account for the public ODS directory. The data is published under the Open Government Licence v3, permitting reuse including commercially with attribution.
- Rate limit
- No published limit. NHS Digital also publishes full ODS extracts, which suit initial bulk loads better than paging the API.
- Pricing
- Free. Open Government Licence v3.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the NHS Organisation Data Service API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. List NHS organisations from the ODS directory
GET https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations?Limit=2
curl 'https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations?Limit=2' \
-H 'Accept: application/json'const res = await fetch("https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations?Limit=2", {
headers: {
"Accept": "application/json",
},
});
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
headers = {
"Accept": "application/json",
}
res = requests.get("https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations?Limit=2", headers=headers, timeout=20)
res.raise_for_status()
print(res.json()){
"Organisations": [
{
"Name": "CLWYD",
"OrgId": "001",
"Status": "Inactive",
"OrgRecordClass": "RC1",
"PostCode": "",
"LastChangeDate": "2013-05-08",
"PrimaryRoleId": "RO141",
"PrimaryRoleDescription": "LOCAL AUTHORITY",
"OrgLink": "https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations/001"
},
{
"Name": "DYFED",
"OrgId": "002",
"Status": "Inactive",
"OrgRecordClass": "RC1",
"PostCode": "",
"LastChangeDate": "2013-05-08",
"PrimaryRoleId": "RO141",
"PrimaryRoleDescription": "LOCAL AUTHORITY",
"OrgLink": "https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations/002"
}
]
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Limit | query | Optional | Maximum records to return, up to 1000. Note the capital letter — parameters here are case-sensitive. 2 |
Offset | query | Optional | Zero-based offset for paging through the register. 0 |
PrimaryRoleId | query | Optional | Filter by organisation role, such as `RO177` for a pharmacy or `RO76` for a GP practice. RO177 |
PostCode | query | Optional | Filter by postcode, full or partial. LS1 |
Status | query | Optional | `Active` or `Inactive`. The register keeps closed organisations, so filter unless you want them. Active |
LastChangeDate | query | Optional | Return only organisations changed on or after this date — the basis for incremental syncing. 2026-01-01 |
(endpoint) /organisations/{code} | path | Optional | Full record for one organisation, including addresses, roles and relationships. /organisations/RGT01 |
Response fields
Organisations[]array- The matched organisations. Summary records only — fetch the code endpoint for full detail.
Organisations[].OrgIdstring- The ODS code. Your join key to prescribing, referral and NHS activity datasets.
Organisations[].Namestring- Organisation name in the register's upper-case convention.
Organisations[].Statusstring- `Active` or `Inactive`. Historical organisations are retained deliberately.
Organisations[].OrgRecordClassstring- `RC1` for an organisation, `RC2` for a site. Sites are physical locations belonging to an organisation.
Organisations[].PrimaryRoleId / PrimaryRoleDescriptionstring- Role code and its label — the reliable way to filter by organisation type.
Organisations[].PostCodestring- Postcode, empty for some historical records.
Organisations[].LastChangeDatestring- When the record last changed. Use it for incremental sync.
Organisations[].OrgLinkstring- URL of the full record for that organisation.
What you can build with the NHS Organisation Data Service API
- Resolve an ODS code found in NHS data to an organisation name
- List every GP practice or pharmacy in an area
- Validate organisation codes submitted through a form
- Keep a local copy of the NHS organisation register in sync
- Distinguish organisations from their individual sites
Common errors and how to fix them
Parameter ignored
Query parameter names are case-sensitive.
Fix: `Limit` and `PostCode` are capitalised. Lower-case variants are silently ignored rather than rejected, so you get unfiltered results.
Unexpected closed organisations
The register retains inactive entries.
Fix: Add `Status=Active`. Historical organisations are kept so that archived datasets still resolve, which is a feature until it is not.
Sites appearing as organisations
`OrgRecordClass` distinguishes them.
Fix: `RC2` records are physical sites belonging to an `RC1` organisation. Counting both double-counts trusts with many hospitals.
Truncated results
The default page size is small.
Fix: Set `Limit` up to 1000 and page with `Offset`, or download the full ODS extract for an initial load.
NHS Organisation Data Service API — frequently asked questions
Is the NHS ODS API free?
Yes, free with no key or registration for the public organisation directory. The data is published under the Open Government Licence v3, so commercial reuse is permitted with attribution.
What is an ODS code?
The identifier the NHS Organisation Data Service assigns to every organisation in UK health and social care — GP practices, trusts, pharmacies, commissioners. NHS datasets are keyed by these codes, so this directory is normally the first lookup in any NHS analysis.
Why does the API return organisations that no longer exist?
Because the register is historical by design. Keeping closed organisations means an ODS code in a ten-year-old prescribing dataset still resolves to something meaningful. Filter on `Status=Active` when you only want current organisations.
How do I find only GP practices?
Filter on `PrimaryRoleId` with the relevant role code rather than matching on names. The role taxonomy is what distinguishes practices, trusts, pharmacies and commissioning bodies, and name patterns are far less reliable.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
JSON to CSV Converter
Convert a JSON array of objects to CSV online. Automatic column headers from the union of all keys, delimiter choice and proper quoting — all in-browser.
CSV Viewer & Table
View CSV as a clean HTML table online. Live search filter, row and column counts, delimiter and header options — all processed locally in your browser.
NHS Organisation Data Service is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.