Overview
Open Data NHS Scotland is a free public data platform maintained by Public Health Scotland, offering datasets on hospitals, patient activity, waiting times, and health statistics across Scotland. All datasets are available via a REST API with no authentication needed and can be exported as JSON or CSV. It is a great resource for researchers, journalists, and health tech developers.
Beginner Tip
Browse the dataset catalog at opendata.nhs.scot first to find the resource ID for the dataset you want, then use that ID in the /api/3/action/datastore_search endpoint.
Available Data
The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.
Example Response
Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.
{
"status": "success",
"data": {
"result": "Data from Open Data NHS Scotland",
"description": "Medical reference data and statistics by Public Health Scotland",
"timestamp": "2025-01-15T10:00:00Z"
}
} Field Reference
result Container object holding the query results and metadata. records Array of data rows matching the query. total Total number of records available in the dataset. fields Schema information describing each column name and data type. _id Auto-incremented row identifier within the datastore. Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://www.opendata.nhs.scot/api/3/action/datastore_search?resource_id=f1c7b8a4-4df0-4e8d-b3b3-bc4b0f0cf7f9&limit=5";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Metadata Score Breakdown
Estimated from metadata — endpoint not independently tested
Metadata estimate · endpoint not independently tested
Technical Specifications
Related Tags
Similar APIs
View All →Coronavirus
This Coronavirus API provides the latest global Covid-19 case counts, deaths, and recoveries aggregated from public health sources.
Coronavirus in the UK
The Coronavirus in the UK API provides official UK Government data on Covid-19 cases, deaths, and vaccinations broken down by region and nation.
Covid Tracking Project
⭐ Beginner's PickThe Covid Tracking Project API provides historical US Covid-19 data including tests, hospitalizations, and deaths at the state and national level.
Covid-19
⭐ Beginner's PickThe Covid-19 API by M-Media Group provides daily case counts, deaths, and recoveries for every country in the world.
Infermedica
Infermedica is an AI-powered health API that analyzes symptom descriptions in plain text and suggests possible conditions or next steps.