---
title: "Search for organisations"
method: GET
path: "/"
tags: ["Organisation"]
---

# Search for organisations

`GET /`

## Overview
Use this endpoint to find information about services provided by NHS organisations.

For more information on how to use search identifiers with this endpoint, see [DoHS API guide to search identifiers and service codes](https://digital.nhs.uk/developer/api-catalogue/directory-of-healthcare-services/guide-to-search-identifiers-and-service-codes).

## Sandbox test scenarios
You can test the following scenarios in our sandbox environment:

| Scenario                                                           | Request                                                                                                                                                                                                                                   | Response                                 |
| -------------------------------------------------------------------| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------- |
| All organisations                                                  | No parameters                                                                                                                                                                                                                             | HTTP status 200 with all organisations   |
| Single organisation                                                | `search`=`Y02494`                                                                                                                                                                                                                         | HTTP status 200 with single organisation |
| Search By ODS Code and Filter by EPS enabled                       | `searchFields`=`ODSCode` <br /> `$filter`=`IsEpsEnabled eq 'true'`                                                                                                                                                                        | HTTP status 200 with filtered results    |
| Filtered by EPS enabled and organisation type                      | `search`=`pharmacy2u` <br /> `searchfields`=`OrganisationName` <br /> `$filter`=`IsEpsEnabled eq 'true' and OrganisationTypeId eq 'PHA' and OrganisationSubType eq 'DistanceSelling'`                                                     | HTTP status 200 with filtered results    |
| Search by location                                                 | `search`=`Bletchley` <br /> `searchfields`=`Address3,City,County`                                                                                                                                                                         | HTTP status 200 with found organisations |                                                                                                                             
| Filtered by EPS enabled, organisation type and ordered by geocode  | `$filter`=`"IsEpsEnabled eq 'true' and OrganisationTypeId eq 'PHA' and OrganisationSubType eq 'Community'"` <br /> `$orderby`= `geo.distance(Geocode, geography'POINT(-0.76444095373153675 52.000820159912109)')`                         | HTTP status 200 with ordered results     | 
| Filtered by postcode, EPS enabled and organisation type            | `$filter`=`search.ismatch('B11', 'Postcode') and IsEpsEnabled eq 'true' and OrganisationTypeId eq 'PHA' and OrganisationSubType eq 'Community'`                                                                                           | Http status 200 with filtered results    | 
| Filtered by closing time and location                              | `search`=`Bletchley` <br /> `searchFields`=`Address3` <br /> `$filter`=`OpeningTimes / any (x: x/ClosingTime eq '14:00')`                                                                                                                 | Http status 200 with filtered results    | 
| Filtered by location, EPS enabled and wheelchair access            | `search`=`Bletchley` <br /> `searchFields`=`Address3` <br /> `$filter`=`Facilities / any (x: x/Name eq 'Wheelchair access' and x/Value eq 'Yes') and IsEpsEnabled eq 'true'`                                                              | Http status 200 with filtered results    | 
| No organisations found                                             | `search`=`no-organisation`                                                                                                                                                                                                                | HTTP status 200 with no organisations    |
| Invalid API version                                                | No api-version parameter                                                                                                                                                                                                                  | HTTP status 404 with problem description |

You can try out the sandbox using the 'Try this API feature' on this page.

## Query parameters

- `api-version` number, required
- `search` string
- `searchMode` 'any' | 'all'
- `searchFields` string
- `queryType` 'simple' | 'full'
- `$skip` number
- `$top` number
- `$count` boolean
- `$orderBy` string
- `$select` string
- `$filter` string

## Response `200`

Search Response

- object
  - `@odata.context` string, uri
  - `@odata.count` number
  - `@odata.next` string, uri
  - `value` object[]
    - `@search.score` number
    - `SearchKey` string — Unique identifier for entity
    - `ODSCode` string — Unique code for an organisation, service or trust
    - `OrganisationName` string — Name for an organisation
    - `Organisation Aliases` object — Optional alias(es) for organisation
      - `OrganisationAlias` string — Legacy feature - where trading name might be different from legal registered name
      - `OrganisationAliasId` string — Alias ID for organisation
    - `OrganisationTypeId` string — identifies sector, e.g. DEN for dentist
    - `OrganisationType` string — Verbose representation of organisation type, identifying sector for org
    - `OrganisationStatus` string — ((Always should exist, should always have value of 'visible'))
    - `Address 1` string — Address line 1
    - `Address 2` string — Address line 2
    - `Address 3` string — Address line 3
    - `City` string — City or town
    - `County` string — County
    - `Latitude` number — Specific location latitude
    - `Longitude` number — Specific location longitude
    - `Postcode` string — Post code
    - `Geocode` number — Nested data - { type, coordinates, crs { type, properties { name } } }
    - `ParentOrganisation` object — Parent for NHS organisations. Potentially nullable based on sector. Generally parent trust for primary care organisations.
      - `ODSCode` string — Unique code for an organisation, service or trust
      - `OrganisationName` string — Name for an organisation
    - `Services` object — Medical services offered
      - `ServiceName` string — Name for a service, e.g. Urgent dental appointments
      - `ServiceCode` string — Code for a service, e.g. SRV0165
      - `Contacts` object — Contact service
        - `ContactMethodType` string — Medium for contact - telephone, email, web, fax
        - `ContactValue` string — Contact number, email, et c.
      - `ServiceProvider` object — Trust that provides service
        - `ODSCode` string — Unique code for an organisation, service or trust
        - `OrganisationName` string — Name for an organisation
      - `Treatments` object — bullet list of treatments provided
        - `Name` string — Name of treatment
      - `OpeningTimes` object — Contains subfields for service opening times
        - `Weekday` string — Day of the week
        - `OpeningTime` string — Opening time for service in 24hr clock
        - `ClosingTime` string — Closing time for service in 24hr clock
        - `OffsetOpeningTime` number — Opening time offset in minutes from midnight
        - `OffsetClosingTime` number — Closing time offset in minutes from midnight
        - `OpeningTimeType` string — General, Additional, Reception, Surgery - opening times for each
        - `AdditionOpeningDate` string — Temporary changes and bank holidays - bank holidays must be validated
        - `IsOpen` boolean — If set to true there should be opening times, if set to false there should be none.
        - `FromAgeDays` number — Age range based opening times - e.g. under 16s or over 60s
        - `ToAgeDays` number — Age range based opening times - e.g. under 16s or over 60s
      - `AgeRange` object — List of age ranges for service
        - `FromAgeDays` number — Age range based opening times - e.g. under 16s or over 60s
        - `ToAgeDays` number — Age range based opening times - e.g. under 16s or over 60s
      - `Metrics` object — Indicators of service health -
        - `MetricID` number — Id for Metric
        - `MetricName` string — Name for metric
        - `Description` string — Description of metric
        - `Text` string — Verbose description
        - `BandingClassification` string — representation of grading for metric in words - e.g. "good," "adequate," "yes," "no,"
      - `KeyValueData` object — Meta data about service
        - `Key` string — Key for meta data - e.g. "flu booking link"
        - `Value` string — Value for meta data - e.g. flu booking link url
    - `OpeningTimes` object — Opening times at organisational level
      - `Weekday` string — Day of the week
      - `OpeningTime` string — Opening time for organisation in 24hr clock
      - `ClosingTime` string — Closing time for organisation in 24hr clock
      - `OffsetOpeningTime` number — Opening time offset in minutes from midnight
      - `OffsetClosingTime` number — Closing time offset in minutes from midnight
      - `OpeningTimeType` string — General, Additional, Reception, Surgery - opening times for each
      - `AdditionOpeningDate` string — Temporary changes and bank holidays - bank holidays must be validated
      - `IsOpen` boolean — If set to true there should be opening times, if set to false there should be none.
    - `Contacts` object — Contact organisation
      - `ContactType` string — can be primary, pals, alternative - usually primary.
      - `ContactAvailabilityType` string — Office hours, out of hours, or weekend
      - `ContactMethodType` string — Medium for contact - telephone, email, web, fax
      - `ContactValue` string — Contact number, email, et c.
    - `Facilities` object — Facilities offered by organisation
      - `Id` number — number identifier for facility
      - `Name` string — Name of facility
      - `Value` string — "Yes" or "No" string value indicating whether facility is offered at organisation
      - `FacilityGroupName` string — Groups facilities by category - e.g. accessibility, parking, other
    - `GSD` object — General service directory (general directory of services) profiles - non-NHS managed service providers
      - `Metrics` object — Indicators for GSD profile health
        - `ElementTitle` string — Title for metric
        - `ElementText` string — Body text for metric
        - `ElementOrder` number — Sort order
        - `MetricId` string — Id for metric
      - `DataSupplier` object — Outside organisation providing information
        - `ProvidedBy` string — Organisation providing info
        - `ProvidedByImage` string — Image logo
        - `ProvidedByUrl` string — Link to org
        - `ProvidedOn` string, date-time — Last time updated
      - `GsdServices` object — GSD Services
        - `ServiceId` string — Service ID
        - `ServiceName` string — Service Name
    - `LastUpdatedDates` object — Date a field was last updated
      - `OpeningTimes` string, date-time — Date Opening Times was last updated
      - `BankHolidayOpeningTimes` string, date-time — Date Bank Holiday Opening Times was last updated
      - `TemporaryChangesOpeningTimes` string, date-time — Date Temporary Opening Times (holidays outside of bank holidays) was last updated
      - `DentistsAcceptingPatients` string, date-time — Date Dentists Accepting Patients was last updated
      - `Facilities` string, date-time — Date Facilities was last updated
      - `HospitalDepartment` string, date-time — Date Hospital Department was last updated
      - `Services` string, date-time — Date Services was last updated
      - `ContactDetails` string, date-time — Date Contact Details were last updated
      - `AcceptingPatients` string, date-time — Date Accepting Patients was last updated (only applies to Dentists and GPs)
      - `ServiceOpeningTimes` string, date-time — Date Service Opening Times was last updated
      - `KeyValueData` object — Date KeyValueData was updated - one entry per key
        - `ServiceCode` string — Service code
        - `Key` string — Key changed
        - `LastUpdatedDated` string, date-time — Date last updated
    - `AcceptingPatients` object — Information on whether the organisation accepting patients
      - `Dentist` object — Information on whether a dentist is accepting patients
        - `Id` number — Number identifier for type of acceptance
        - `Name` string — Name/description of type of acceptance, e.g. "Adults (18 and over)"
        - `AcceptingPatients` boolean — is the dentist accepting patients?
      - `GP` string — "Yes," or "no," indicating whether GP is accepting dentists
    - `GPRegistration` object — Information for registering with GP
      - `RegistrationLink` string — Registration Link
      - `AcceptingOutOfArea` boolean — Accepting patients outside of catchment area
    - `RelatedIAPTCCGs` object — Psychological therapies comission group - only applies to hospitals and clinics
      - `ODSCode` string — Unique code for an organisation, service or trust
      - `OrganisationName` string — Name for an organisation
    - `OrganisationSubType` string — Organisation sub type - e.g. Distance selling for pharmacy. Not all org types have a sub type
    - `Trusts` object — If the entity is a trust, this contains a list of organisations managed by that trust
      - `ODSCode` string — ODSCode for orgs that provide services at this location
      - `OrganisationName` string — Organisation name for orgs that provide services at this location
    - `Metrics` object — Indicators for organisational health e.g. Care Quality Commission inspection ratings, Hospital waiting times for department
      - `MetricID` number — Id for Metric
      - `MetricName` string — Name for metric
      - `DisplayName` string — Description of metric
      - `Description` string — Verbose description
      - `Value` string — Value
      - `Value2` string — Optional value
      - `Value3` string — optional value
      - `Text` string — Description of metric
      - `LinkUrl` string — Describe URL to put on link
      - `LinkText` string — Describe text to put on link
      - `MetricDisplayTypeID` number — Defines type of metric - e.g. yes or no field
      - `MetricDisplayTypeName` string — Name to describe type of metric
      - `HospitalSectorType` string — Hospital Sector Type
      - `MetricText` string — Description of metric
      - `DefaultText` string — Description of metric
      - `IsMetaMetric` boolean — Is metric meta
      - `BandingClassification` string — representation of grading for metric in words - e.g. "good," "adequate," "yes," "no,"
      - `BandingName` string — Descriptive name for banding
    - `Country` string — Country organisation is located (England or Wales)
    - `ServiceOpeningTimes` object — Opening times for pharmacies, covid clinics and vaccination centres.
      - `Id` number — Number identifier for clinic
      - `TypeId` number — Identifies age range of clinic
      - `Name` string — Name of clinic
      - `StartDate` string — Start date of clinic
      - `EndDate` string — End date of clinic
      - `Services` object — Age ranged based services which apply to this clinic
        - `ServiceCode` string — Code for service
        - `ServiceName` string — Name of service - e.g. "children aged 5 to 11"
      - `DailyOpeningTimes` object — Opening times at organisational level
        - `Weekday` string — Day of the week
        - `OpeningTimes` object — Opening times for organisation
          - `OpeningTime` string — Opening time for organisation in 24hr clock
          - `ClosingTime` string — Closing time for organisation in 24hr clock
          - `OffsetOpeningTime` number — Opening time offset in minutes from midnight
          - `OffsetClosingTime` number — Closing time offset in minutes from midnight
    - `IsEpsEnabled` string — "Yes" or "No" string value indicating whether the organisation is EPS enabled

## Other responses

- `4XX` — Below are examples of potential HTTP status codes and their associated error codes, which could be returned in the event of a fault. Guidance on error handling within BaRS can be found [here](https://simplifier.net/guide/nhsbookingandreferralstandard/Home/Design/Design--Core#Error-handling). | HTTP status | Error code | Description | | ----------- | -------------------------- | --------------------------------------------- | | 400 | SEND_BAD_REQUEST | The API was unable to process the request. | | 400 | REC_BAD_REQUEST | The Receiver has responded stating the message was malformed. | | 401 | SEND_UNAUTHORIZED | The API deemed you unauthorized to make this request. | | 401 | REC_UNAUTHORIZED | The receiver deemed you unauthorized to make request. | | 403 | SEND_FORBIDDEN | Missing or Expired Token. | | 404 | PROXY_NOT_FOUND | No related people exist for given NHS number. | | 404 | REC_NOT_FOUND | Patient record for given NHS number has been invalidated and not superseded by another NHS number. | | 405 | SEND_METHOD_NOT_ALLOWED | HTTP Verb is not correct for this scenario.| | 405 | REC_METHOD_NOT_ALLOWED | Receiver does not allow this.| | 405 | PROXY_METHOD_NOT_ALLOWED | Proxy does not allow this.| | 406 | SEND_NOT_ACCEPTABLE | Senders message had an incorrect content type defined for a response.| | 408 | REC_TIMEOUT | The downstream domain processing has not completed within the configured timeout period. | | 409 | SEND_CONFLICT | | | 409 | REC_CONFLICT | | | 409 | PROXY_CONFLICT | | | 422 | SEND_UNPROCESSABLE_ENTITY | Message was not malformed but deemed unprocessable. | | 422 | REC_UNPROCESSABLE_ENTITY | Message was not malformed but deemed unprocessable. | | 422 | PROXY_UNPROCESSABLE_ENTITY | Message was not malformed but deemed unprocessable. | | 429 | SEND_TOO_MANY_REQUESTS | The user has sent too many requests in a given amount of time| | 429 | REC_TOO_MANY_REQUESTS | The user has sent too many requests in a given amount of time|

---

[API](https://skmtc.net/nhs/apis/service-search-api.md) · [All operations](https://skmtc.net/nhs/apis/service-search-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nhs/service-search-api/versions/ed9300a18c4f/schema)
