DoHS API guide to search identifiers and service codes
How to use search identifiers and service codes using our Directory of Healthcare Services (DoHS) API.
Overview
Use this guide to understand search identifiers and service codes for the Directory of Healthcare Services (DoHS) API.
You can:
-
see some example searches using cURL commands
-
find out how to make searches using search identifiers, such as organisation types and sub-types, and service codes
This API was previously known as the Service Search API.
Search examples
The examples below use cURL commands, so you can test them using a command line interface (CLI). For more information, see Use cURL with RESTful APIs.
The use of --data-urlencode allows us to show the text before URL encoding happens, when, for example, spaces are changed to %20.
Note that all $ characters at the start of field names have been changed to their encoded type, so %24 equals $. This is due to a quirk in cURL and is not a problem if you use Postman as your test application.
For any example that includes <Your API KEY > , you need to replace it with your API key, which you can create by following the instructions in Application-restricted RESTful APIs - API key authentication.
Find all organisations that include a specific service code
This example searches for all organisations, and returns the top 10 results filtered by organisations that include the ServiceCode of EPS0001.
It returns the top 10 organisations that are EPS-enabled.
// Orgs based on service code
curl --get https://int.api.service.nhs.uk/service-search-api?api-version=2 \
--data-urlencode "search=*" \
--data-urlencode "searchMode=all" \
--data-urlencode "%24top=10" \
--data-urlencode "%24count=false" \
--data-urlencode "%24select=*" \
--data-urlencode "%24filter=Services / any (x: x/ServiceCode eq 'EPS0001' )" \
--header "apikey: <Your API KEY >"
Find a specific organisation by its ODS code and service code
This example searches for the text FMM65 in the field ODSCode.
It filters on the service code of EPS0001 so it only returns results that include the EPS0001 service code.
It limits the number of fields returned to the following ones, as you can see in %24select=ODSCode,OrganisationName,Contacts,Address1,Address2,Address3,City,Postcode,OrganisationType,OrganisationSubType.
It returns the top 10 results found, in case there are duplicates.
// Org by ODS code and service code
curl --get https://int.api.service.nhs.uk/service-search-api?api-version=2 \
--data-urlencode "search=FMM65" \
--data-urlencode "searchMode=all" \
--data-urlencode "searchFields=ODSCode" \
--data-urlencode "%24top=10" \
--data-urlencode "%24count=false" \
--data-urlencode "%24select=ODSCode,OrganisationName,Contacts,Address1,Address2,Address3,City,Postcode,OrganisationType,OrganisationSubType" \
--data-urlencode "%24filter=Services / any (x: x/ServiceCode eq 'EPS0001' )" \
--header "apikey: <Your API KEY >"
Find matching organisations by name with a specific service code
This example searches for all organisations that match the organisation name of pharmacy2u
It filters for all organisations that include the service code of EPS0001 and the type of PHA that is classed as a DistanceSelling (internet) Pharmacy
It limits the number of fields returned to the following ones, as you can see in %24select=ODSCode,OrganisationName,Contacts,Address1,Address2,Address3,City,Postcode,OrganisationType,OrganisationSubType.
It returns the top 10 results.
// Get dispenser by name distance sellers / internet pharmacies by name
curl --get https://int.api.service.nhs.uk/service-search-api?api-version=2 \
--data-urlencode "search=pharmacy2u" \
--data-urlencode "searchMode=all" \
--data-urlencode "searchFields=OrganisationName" \
--data-urlencode "%24top=10" \
--data-urlencode "%24count=false" \
--data-urlencode "%24select=ODSCode,OrganisationName,Contacts,Address1,Address2,Address3,City,Postcode,OrganisationType,OrganisationSubType" \
--data-urlencode "%24filter=Services / any (x: x/ServiceCode eq 'EPS0001' ) and OrganisationTypeId eq 'PHA' and OrganisationSubType eq 'DistanceSelling'" \
--header "apikey: <Your API KEY >"
Organisation and service codes
The following tables show the organisation type and sub-type identifiers as well as the service codes you can use to search.
Organisation type identifiers
You can use the following organisation type identifiers to search for organisations.
| Organisation type ID | Type name | Display name |
|---|---|---|
| CCG | Clinical Commissioning Group |
Clinical Commissioning Group |
| LA | Local Authority | Local Authority |
| LAT | Area Team | Area Team |
| GPB | GP | GP |
| GPP | GP Practice | GP Practice |
| STP | Sustainability and Transformation Partnership | Sustainability and Transformation Partnership |
| HOS | Hospital | Hospital |
| TRU | Trust | Trust |
| MIU | Minor Injury Unit | Minor Injury Unit |
| SHA | Strategic Health Authority | Strategic Health Authority |
| UNK | Unknown | Unknown |
| HA | Health Authority | Health Authority |
| RAT | Regional Area Team | Regional Area Team |
| GDOS | Generic Directory of Services | Generic Directory of Services |
| OPT | Optician | Optician |
| SCL | Social Care Provider Location | Social Care Provider Location |
| DEN | Dentists | Dentists |
| All | All | All organisations |
| HWB | Health and Wellbeing Board | Health and Wellbeing Board |
| PHA | Pharmacy | Pharmacy |
| CLI | Clinics | Clinics |
| GSD | Generic Service Directory | Generic Service Directory |
| SCP | Social Care Provider | Social Care Provider |
| UC | Urgent Care | Urgent Care |
Organisation sub-types
You can use the following organisation sub-type identifiers to search for organisations.
| Organisation sub-type | Description |
|---|---|
| DistanceSelling | Internet Dispenser |
| Community | Community Pharmacy |
| DispensingApplianceContractors | Dispensing Appliance Contractor |
| Independent Sector | Independent (non) NHS |
| NHS Sector | NHS |
Service Codes
You can use the following service codes to search for services.
| Service code | Description |
|---|---|
| SRV0002 | Adult Mental Illness |
| SRV0279 | Anticoagulant monitoring and dosing - provided in-house |
| SRV0280 | Asthma Clinic |
| SRV0243 | Audiology services (community) |
| SRV0315 | Care services for people with learning disabilities |
| SRV0317 | Caring for adults over 65 |
| SRV0408 | Child and adolescent mental health services (CAMHS) |
| SRV0016 | Child and Adolescent Psychiatry |
| SRV0309 | Child health and development |
| SRV0282 | Child Immunisations |
| SRV0017 | Children's & Adolescent Services |
| SRV0019 | Cognitive behavioural therapy services |
| SRV0195 | Community care services |
| SRV0020 | Community mental health services |
| SRV0022 | Consultation services |
| SRV0209 | Continence services |
| SRV0284 | COPD clinic with spirometry |
| SRV0196 | COPD services |
| SRV0156 | Counselling services |
| SRV0025 | Day treatment services |
| SRV0028 | Dermatology |
| SRV0287 | Diabetes Clinic providing insulin initiation |
| SRV0009 | Diagnostic Imaging |
| SRV0327 | Diagnostic Physiological Measurement |
| SRV0290 | Drug and alcohol Services |
| SRV0240 | DVT services |
| SRV0034 | Eating disorders (inpatient) |
| SRV0218 | Family planning services |
| SRV0039 | Forensic Psychiatry |
| SRV0125 | GP services |
| SRV0055 | Inpatient mental health services |
| SRV0295 | Joint injections |
| SRV0308 | Laser/cosmetic services - not available on NHS |
| SRV0057 | Learning Disabilities |
| SRV0492 | Learning disability health check |
| SRV0242 | Learning disability services (community) |
| SRV0294 | Long-Acting Reversible Contraception (LARC - eg IUD or implant) |
| SRV0060 | Memory services |
| SRV0061 | Mental Health - Adults of all ages |
| SRV0298 | Minor surgery (e.g. removal of moles and skin lesions) - provided in-house |
| SRV0228 | Musculo-skeletal services |
| SRV0134 | Nursing services |
| SRV0058 | Obstetrics |
| SRV0067 | Occupational therapy services |
| SRV0068 | Old Age Psychiatry |
| SRV0069 | Older people's services |
| SRV0073 | Orthopaedics |
| SRV0074 | Outpatient mental health services |
| SRV0360 | Palliative care |
| SRV0079 | Personality disorder services |
| SRV0267 | Pharmacy Service (NHS): Chlamydia screening and treatment |
| SRV0495 | Pharmacy Service (NHS): Condom supply |
| SRV0498 | Pharmacy Service (NHS): Emergency contraception |
| SRV0261 | Pharmacy Service (NHS): Medication review service |
| SRV0198 | Pharmacy Service (NHS): Minor ailment service |
| SRV0507 | Pharmacy Service (NHS): Stop smoking voucher service |
| SRV0258 | Pharmacy Service (NHS): Supervised consumption of medicines |
| SRV0508 | Pharmacy Service (NHS): Vaccination service |
| SRV0510 | Pharmacy Service (Non-NHS): Blood pressure monitoring |
| SRV0531 | Pharmacy Service (Non-NHS): Chlamydia screening and treatment |
| SRV0530 | Pharmacy Service (Non-NHS): Emergency contraception |
| SRV0529 | Pharmacy Service (Non-NHS): Healthcheck |
| SRV0514 | Pharmacy Service (Non-NHS): Seasonal flu vaccination service (not at risk groups) |
| EPS0004 | Pharmacy Service: Internet Pharmacy |
| SRV0177 | Pharmacy Service: Appliance dispensing |
| EPS0002 | Pharmacy Service: Appliance Dispensing |
| SRV0520 | Pharmacy Service: Appointment booking available for consultations |
| SRV0521 | Pharmacy Service: Appointment booking for consultations not required |
| SRV0557 | Pharmacy Service: Collect Lateral Flow Device |
| EPS0002 | Pharmacy Service: Community Pharmacy |
| EPS0001 | Pharmacy Service: Electronic Prescription Service |
| SRV0523 | Pharmacy Service: Inhaler recycling |
| SRV0524 | Pharmacy Service: Multi-lingual staff |
| SRV0257 | Pharmacy Service: New medicine service |
| SRV0519 | Pharmacy Service: Prescription collection from local General Practices |
| SRV0522 | Pharmacy Service: Prescription delivery service |
| SRV0526 | Pharmacy Service: Private consultation room |
| SRV0527 | Pharmacy Service: Public Health |
| SRV0277 | Pharmacy Service: Seasonal flu vaccination service (at risk groups) |
| SRV0299 | Phlebotomy |
| SRV0081 | Physiotherapy |
| SRV0083 | Podiatry |
| SRV0285 | Primary care counselling service |
| SRV0230 | Psychiatric intensive care unit |
| SRV0085 | Psychiatric liaison services |
| SRV0086 | Psychiatry services |
| SRV0163 | Respite care services |
| SRV00376 | Rehabilitation care services |
| SRV0137 | Sexual health services |
| SRV0095 | Speech and language services |
| SRV0100 | Therapy services |
| SRV0302 | Travel health with yellow fever |
| SRV0303 | Travel health without yellow fever |
| SRV0103 | Urology |
| SRV0112 | Vascular services |
| SRV0104 | Vascular surgery |
Last edited: 24 October 2024 2:17 pm