Search Service API for Accident and Emergency Services

Hi,

I’m using the Search Service API (v1) to locate the nearest Accident and Emergency Services to a postcode.

This is a replica of the Find your nearest A&E service on the NHS website. This returns the age suitability for each A&E eg. “Open for people of all ages” or “Open for anyone 16 years or over” but I can’t see attribute being returned by the API. Is there any way of getting this from the API?

I also was hoping for some clarification on the “service level” for the API. It says here that:

This API is a bronze service, meaning it is operational and supported only during business hours (8am to 6pm), Monday to Friday excluding bank holidays.

Does operational mean that I can only make requests to this API between 8am to 6pm?

Thanks in advance! :bowing_woman:

Hi Shirley,

We recommend you upgrade to using version 2 of the Service Search API. Here is an example of how to call it, requesting ‘Accident and emergency services’ near ‘EC1V 9NR’ …

curl --location --request POST 'https://api.nhs.uk/service-search/search-postcode-or-place?api-version=2&search=EC1V%209NR' \
  --header 'Content-Type: application/json' \
  --header 'subscription-key: YOUR_TRIAL_OR_V2_SUBSCRIPTION_KEY_GOES_HERE' \
  --data-raw '{
  "filter": "Services/any(service: service/ServiceName eq '\''Accident and emergency services'\'')",
  "top": 20,
  "skip": 0,
  "count": true
}'

In the response JSON you will see an ‘AgeRange’ property. This correlates to the accepted patient age. For example …

All ages

"AgeRange": [
  {
    "FromAgeDays": 0,
    "ToAgeDays": 47481
  }
]

16 years or over

"AgeRange": [
  {
    "FromAgeDays": 5844,
    "ToAgeDays": 47481
  }
]

17 years and over

"AgeRange": [
  {
    "FromAgeDays": 6209,
    "ToAgeDays": 47481
  }
]

18 years or over

"AgeRange": [
  {
    "FromAgeDays": 6574,
    "ToAgeDays": 47481
  }
]

Under 16 and over 16

"AgeRange": [
  {
    "FromAgeDays": 0,
    "ToAgeDays": 5843
  },
  {
    "FromAgeDays": 5844,
    "ToAgeDays": 47481
  }
]

Open (i.e. No age data was provided)

"AgeRange": []