You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification/nhs-website-content-api.yaml
+68-69Lines changed: 68 additions & 69 deletions
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,15 @@ info:
8
8
## Overview
9
9
This API provides content from the [NHS website](https://www.nhs.uk) as JSON, to be consumed programmatically and used by your application.
10
10
11
-
⚠️ Before April 2025, many pages covering symptoms, tests or treatments were inappropriately included in the Conditions A to Z.
11
+
Before April 2025, many pages covering symptoms, tests or treatments were inappropriately included in the Conditions A to Z.
12
12
13
13
The April 2025 update introduces two new endpoints for 'symptoms' and 'tests-and-treatments' that reflect the reallocation of these pages to new A to Z pages on the website.
14
14
15
15
You can reuse the content from the following sections of the NHS website:
16
16
* Conditions A to Z ([Website](https://www.nhs.uk/conditions/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/conditions))
17
-
* Medicines A to Z ([Website](https://www.nhs.uk/medicines/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/medicines))
18
17
* Symptoms A to Z ([Website](https://www.nhs.uk/symptoms/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/symptoms))
19
18
* Tests and treatments A to Z ([Website](https://www.nhs.uk/tests-and-treatments/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/tests-and-treatments))
19
+
* Medicines A to Z ([Website](https://www.nhs.uk/medicines/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/medicines))
20
20
* Mental health ([Website](https://www.nhs.uk/mental-health/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/mental-health))
21
21
* Live Well ([Website](https://www.nhs.uk/live-well/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/live-well))
| 403 | ACCESS_DENIED | User cannot perform this action. |
468
468
| 404 | RESOURCE_NOT_FOUND | Page not found. |
469
469
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
470
-
471
470
/conditions:
472
471
parameters:
473
472
- $ref: "#/components/parameters/page"
@@ -558,7 +557,7 @@ paths:
558
557
| 403 | ACCESS_DENIED | User cannot perform this action. |
559
558
| 404 | RESOURCE_NOT_FOUND | Page not found. |
560
559
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
561
-
/medicines:
560
+
/symptoms:
562
561
parameters:
563
562
- $ref: "#/components/parameters/page"
564
563
- $ref: "#/components/parameters/category"
@@ -567,13 +566,13 @@ paths:
567
566
- $ref: "#/components/parameters/endDate"
568
567
- $ref: "#/components/parameters/order"
569
568
get:
570
-
summary: Get all pages in the Medicines A to Z
571
-
operationId: get-medicines
569
+
summary: Get all pages in the Symptoms A to Z
570
+
operationId: get-symptoms
572
571
description: |
573
572
## Overview
574
-
Use this endpoint to get details of pages in the [Medicines A to Z](https://www.nhs.uk/medicines).
573
+
Use this endpoint to get details of pages in the [Symptoms A to Z](https://www.nhs.uk/symptoms).
575
574
576
-
Passing in no parameters returns all pages under 'medicines'.
575
+
Passing in no parameters returns all pages under 'symptoms'.
577
576
578
577
The response is limited to 25 child pages and is paginated.
579
578
@@ -585,18 +584,18 @@ paths:
585
584
586
585
However, the `orderBy` parameter can be used with the `startDate` and `endDate` parameters to filter down to the desired date. `startDate` and `endDate` should be given in the YYYY-MM-DD format.
587
586
588
-
For example `https://api.service.nhs.uk/nhs-website-content/medicines?startDate=2022-01-01&orderBy=dateModified`
587
+
For example `https://api.service.nhs.uk/nhs-website-content/symptoms?startDate=2022-01-01&orderBy=dateModified`
589
588
590
589
responses:
591
590
"200":
592
591
description: |
593
-
A valid query for medicines.
592
+
A valid query for symptoms.
594
593
content:
595
594
application/json:
596
595
schema:
597
596
$ref: components/schemas/WebPage.json
598
597
example:
599
-
$ref: components/examples/MedicinesAToZ.json
598
+
$ref: components/examples/SymptomsAToZ.json
600
599
"4XX":
601
600
description: |
602
601
An error occurred as follows:
@@ -607,36 +606,45 @@ paths:
607
606
| 403 | ACCESS_DENIED | User cannot perform this action. |
608
607
| 404 | RESOURCE_NOT_FOUND | Page not found. |
609
608
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
610
-
/medicines/*:
609
+
/tests-and-treatments:
611
610
parameters:
612
-
- $ref: "#/components/parameters/modules"
611
+
- $ref: "#/components/parameters/page"
612
+
- $ref: "#/components/parameters/category"
613
+
- $ref: "#/components/parameters/orderBy"
614
+
- $ref: "#/components/parameters/startDate"
615
+
- $ref: "#/components/parameters/endDate"
616
+
- $ref: "#/components/parameters/order"
613
617
get:
614
-
summary: Get specific medicine page
615
-
operationId: get-medicine-page
618
+
summary: Get all pages in the Tests and Treatments A to Z
619
+
operationId: get-tests-and-treatments
616
620
description: |
617
621
## Overview
618
-
There is an endpoint for each page under the Medicines A to Z, for example https://www.nhs.uk/medicines/acrivastine.
622
+
Use this endpoint to get details of pages in the [tests-and-treatments A to Z](https://www.nhs.uk/tests-and-treatments).
619
623
620
-
This can be used to get specific information about individual medicines.
624
+
Passing in no parameters returns all pages under 'tests-and-treatments'.
621
625
622
-
There is only one query parameter for these pages:
626
+
The response is limited to 25 child pages and is paginated.
| modules | If topic is modularised, only return these modules | boolean |
628
+
There are a number of query parameters that filter the results.
629
+
630
+
## Ordering by dates
631
+
632
+
The `orderBy` parameter can be `dateModified`, `lastReviewed` and `nextReview`. By default if any of the `orderBy` parameters are chosen the results are sorted by newest first.
633
+
634
+
However, the `orderBy` parameter can be used with the `startDate` and `endDate` parameters to filter down to the desired date. `startDate` and `endDate` should be given in the YYYY-MM-DD format.
635
+
636
+
For example `https://api.service.nhs.uk/nhs-website-content/tests-and-treatments?startDate=2022-01-01&orderBy=dateModified`
627
637
628
-
# Modularisation
629
-
We modularise some of our content, meaning that individual parts of the page can be reused. If a page is modularised, content appears in the `hasPart` field.
| 403 | ACCESS_DENIED | User cannot perform this action. |
648
656
| 404 | RESOURCE_NOT_FOUND | Page not found. |
649
657
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
650
-
/symptoms:
658
+
/medicines:
651
659
parameters:
652
660
- $ref: "#/components/parameters/page"
653
661
- $ref: "#/components/parameters/category"
@@ -656,13 +664,13 @@ paths:
656
664
- $ref: "#/components/parameters/endDate"
657
665
- $ref: "#/components/parameters/order"
658
666
get:
659
-
summary: Get all pages in the Symptoms A to Z
660
-
operationId: get-symptoms
667
+
summary: Get all pages in the Medicines A to Z
668
+
operationId: get-medicines
661
669
description: |
662
670
## Overview
663
-
Use this endpoint to get details of pages in the [Symptoms A to Z](https://www.nhs.uk/symptoms).
671
+
Use this endpoint to get details of pages in the [Medicines A to Z](https://www.nhs.uk/medicines).
664
672
665
-
Passing in no parameters returns all pages under 'symptoms'.
673
+
Passing in no parameters returns all pages under 'medicines'.
666
674
667
675
The response is limited to 25 child pages and is paginated.
668
676
@@ -674,18 +682,18 @@ paths:
674
682
675
683
However, the `orderBy` parameter can be used with the `startDate` and `endDate` parameters to filter down to the desired date. `startDate` and `endDate` should be given in the YYYY-MM-DD format.
676
684
677
-
For example `https://api.service.nhs.uk/nhs-website-content/symptoms?startDate=2022-01-01&orderBy=dateModified`
685
+
For example `https://api.service.nhs.uk/nhs-website-content/medicines?startDate=2022-01-01&orderBy=dateModified`
678
686
679
687
responses:
680
688
"200":
681
689
description: |
682
-
A valid query for symptoms.
690
+
A valid query for medicines.
683
691
content:
684
692
application/json:
685
693
schema:
686
694
$ref: components/schemas/WebPage.json
687
695
example:
688
-
$ref: components/examples/SymptomsAToZ.json
696
+
$ref: components/examples/MedicinesAToZ.json
689
697
"4XX":
690
698
description: |
691
699
An error occurred as follows:
@@ -696,45 +704,36 @@ paths:
696
704
| 403 | ACCESS_DENIED | User cannot perform this action. |
697
705
| 404 | RESOURCE_NOT_FOUND | Page not found. |
698
706
| 429 | TOO_MANY_REQUESTS | You have exceeded your application's [rate limit](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#rate-limits). |
699
-
/tests-and-treatments:
707
+
/medicines/*:
700
708
parameters:
701
-
- $ref: "#/components/parameters/page"
702
-
- $ref: "#/components/parameters/category"
703
-
- $ref: "#/components/parameters/orderBy"
704
-
- $ref: "#/components/parameters/startDate"
705
-
- $ref: "#/components/parameters/endDate"
706
-
- $ref: "#/components/parameters/order"
709
+
- $ref: "#/components/parameters/modules"
707
710
get:
708
-
summary: Get all pages in the Tests and Treatments A to Z
709
-
operationId: get-tests-and-treatments
711
+
summary: Get specific medicine page
712
+
operationId: get-medicine-page
710
713
description: |
711
714
## Overview
712
-
Use this endpoint to get details of pages in the [tests-and-treatments A to Z](https://www.nhs.uk/tests-and-treatments).
713
-
714
-
Passing in no parameters returns all pages under 'tests-and-treatments'.
715
-
716
-
The response is limited to 25 child pages and is paginated.
717
-
718
-
There are a number of query parameters that filter the results.
719
-
720
-
## Ordering by dates
715
+
There is an endpoint for each page under the Medicines A to Z, for example https://www.nhs.uk/medicines/acrivastine.
721
716
722
-
The `orderBy` parameter can be `dateModified`, `lastReviewed` and `nextReview`. By default if any of the `orderBy` parameters are chosen the results are sorted by newest first.
717
+
This can be used to get specific information about individual medicines.
723
718
724
-
However, the `orderBy` parameter can be used with the `startDate` and `endDate` parameters to filter down to the desired date. `startDate` and `endDate` should be given in the YYYY-MM-DD format.
719
+
There is only one query parameter for these pages:
725
720
726
-
For example `https://api.service.nhs.uk/nhs-website-content/tests-and-treatments?startDate=2022-01-01&orderBy=dateModified`
| modules | If topic is modularised, only return these modules | boolean |
727
724
725
+
# Modularisation
726
+
We modularise some of our content, meaning that individual parts of the page can be reused. If a page is modularised, content appears in the `hasPart` field.
0 commit comments