Skip to main content

NHS APIs ETP Dataservice

Electronic Transmission of Prescriptions (ETP) data service

This API is accessed through HTTP and returns data in a JSON format.

Base URL

All requests to this API should start with the following base URL:

https://api.nhs.uk/etp

Authentication and Headers

Your request must include a subscription-key header with a valid subscription key.

Header key Header value
subscription‑key

Login or register to get an API key to use this API

Endpoints

An endpoint is added to the base URL to create the full request URL. Some APIs have more than 1 type of endpoint you can use.

Search dispensers by name

This method retrieves the first 25 pharmacies/ Appliance contractors (in an alphabetical order) with a name LIKE the one entered and the service type/ EPS status chosen.The match should be based on the first part of the stored name. For example, a search for 'Coens' should return 'Coens Plc' but not 'The Coens Chemist'.This is not a geographical search and should return any dispensaries within England that meet the name criteria. It is required to allow searches on a non geographical basis – I.e. name only for virtual pharmacies or appliance contractors.

Endpoint

GET /SearchByName

Parameters

Name Type Required Allowed Default Description
organisationName
query
string true The name of the pharmacy to search on (e.g. Boots)
serviceType
query
string true The service type to search for (i.e. Community Pharmacy (inc. Internet) (1) or Appliance (2))
eps
query
string Eps - Retrieve EPS enabled/ disabled. dispensers (YES/ NO) – The default value will be YES.

Responses

200 - The following is a digest of the returned data. Dispensing Site ODS Code. EPS Status. Dispensing Site Name. Dispensing Site contact details (telephone & fax). Dispensing Site Address and postcode. Order - The results will be ordered alphabetically using the dispensary name.

{
  "organisationCode": "string",
  "name": "string",
  "phone": "string",
  "fax": "string",
  "street": "string",
  "locality": "string",
  "town": "string",
  "administrative": "string",
  "postcode": "string",
  "eps": true,
  "serviceType": "string",
  "distance": 0,
  "services": [
    {
      "serviceName": "string",
      "serviceCode": "string",
      "serviceProvider": "string"
    }
  ],
  "openingTimes": [
    {
      "weekDay": "string",
      "times": "string",
      "offsetOpeningTime": "string",
      "offsetClosingTime": "string",
      "openingTimeType": "string",
      "additionalOpeningDate": "string",
      "isOpen": true
    }
  ]
}

400 - If any of required parameters are not provided

Test this endpoint

Try this API in our developer console.

Try it

Search dispenser by Name and Location

This method retrieves pharmacies/ Appliance contractors with the address/post code specified that have a name LIKE the one entered and the service type/ EPS status chosen. This search will match on either the part postcode or town (if both are supplied the part postcode will be used). Please note that this search will match against the town name or part postcode. For example, if a part postcode of LS1 is entered, the search will only return dispensaries within LS1, no dispensaries in surrounding postcodes will be returned even if there are less than 25 in the supplied part postcode. The match should be based on the first part of the stored name. For example, a search for 'Coens' should return 'Coens Plc' but not 'The Coens Chemist'.

Endpoint

GET /SearchByNameAndLocation

Parameters

Name Type Required Allowed Default Description
OrganisationName
query
string true The name of the pharmacy to search on (e.g. Boots)
serviceType
query
string true The service type to search for (i.e. Community Pharmacy (inc. Internet) (1) or Appliance (2))
partPostcode
query
string First Part of a valid postcode to search on
location
query
string Street name or Town name to search
eps
query
string Eps - Retrieve EPS enabled/ disabled. dispensers (YES/ NO) – The default value will be YES.

Responses

200 - The OK response

Test this endpoint

Try this API in our developer console.

Try it

Search dispensers by OdsCode

Occasionally the end user may not wish to search for a dispenser as the ODS code of a local pharmacy may already be known. This procedure is used to validate that the ODS code entered by the end user is a valid dispenser. It returns pertinent information about the dispenser to allow the end user to validate that the ODS code relates to the dispenser they intended. The information returned will include whether the dispenser is EPS enabled. This procedure will only return organisations registered as dispensers (i.e. if a valid ODS code is supplied but it is not registered as a dispenser, then no data will be returned).

Endpoint

GET /SearchByOdsCode

Parameters

Name Type Required Allowed Default Description
odscode
query
string true Valid ODS Code (e.g. FLH84,FHH81,FW866)

Responses

200 - The following is a digest of the returned data. Dispensing Site ODS Code. EPS Status. Dispensing Site Name. Dispensing Site contact details (telephone & fax). Dispensing Site Address and postcode. Service types - The service types of the dispenser (i.e. Community and/or Appliance).

{
  "organisationCode": "string",
  "name": "string",
  "phone": "string",
  "fax": "string",
  "street": "string",
  "locality": "string",
  "town": "string",
  "administrative": "string",
  "postcode": "string",
  "eps": true,
  "serviceType": "string",
  "distance": 0,
  "services": [
    {
      "serviceName": "string",
      "serviceCode": "string",
      "serviceProvider": "string"
    }
  ],
  "openingTimes": [
    {
      "weekDay": "string",
      "times": "string",
      "offsetOpeningTime": "string",
      "offsetClosingTime": "string",
      "openingTimeType": "string",
      "additionalOpeningDate": "string",
      "isOpen": true
    }
  ]
}

204 - OdsCode not found

400 - If the OdsCode is null or empty

Test this endpoint

Try this API in our developer console.

Try it

Search dispensers by postcode

This method retrieves the 25 nearest pharmacies/appliance contractors to the supplied postcode and the service type/EPS status chosen.

Endpoint

GET /SearchByPostcode

Parameters

Name Type Required Allowed Default Description
fullpostcode
query
string true Full postcode to search on
serviceType
query
string true The service type to search for (i.e. Community Pharmacy (inc. Internet) (1) or Appliance (2))
eps
query
string Eps - Retrieve EPS enabled/ disabled. dispensers (YES/ NO) – The default value will be YES.

Responses

200 - The following is a digest of the returned data. Dispensing Site ODS Code. EPS Status. Dispensing Site Name. Dispensing Site contact details (telephone & fax). Dispensing Site Address and postcode. Distance from supplied postcode. Order - The results will be ordered by distance from the supplied postcode with the nearest appearing first in the list.

{
  "organisationCode": "string",
  "name": "string",
  "phone": "string",
  "fax": "string",
  "street": "string",
  "locality": "string",
  "town": "string",
  "administrative": "string",
  "postcode": "string",
  "eps": true,
  "serviceType": "string",
  "distance": 0,
  "services": [
    {
      "serviceName": "string",
      "serviceCode": "string",
      "serviceProvider": "string"
    }
  ],
  "openingTimes": [
    {
      "weekDay": "string",
      "times": "string",
      "offsetOpeningTime": "string",
      "offsetClosingTime": "string",
      "openingTimeType": "string",
      "additionalOpeningDate": "string",
      "isOpen": true
    }
  ]
}

400 - If any of required parameters are not provided

Test this endpoint

Try this API in our developer console.

Try it

Attribution

Any syndicated content must incorporate the following attribution (credit) to the NHS website:

Content supplied by the NHS website logo

The logo should be clearly visible and in line with the associated content on every web page that contains the syndicated content. You should also link this logo to the relevant page on the NHS website that the content has been supplied from. This URL is supplied as part of the feed under author:

"author": {
  "url": "https://www.nhs.uk",
  "logo": "https://www.nhs.uk/nhscwebservices/documents/logo1.jpg",
  "email": "nhswebsite.servicedesk@nhs.net",
  "@type": "Organization",
  "name": "NHS website"
}

If you are displaying NHS syndicated content in a context where a functional link back to the article on the NHS website is not possible then you should use the following attribution (credit):

From www.nhs.uk

Caching

Caching all content supplied through our API is recommended where possible. Unless otherwise notified by the syndication team, you should refresh cached content at least once every 7 days. If instructed to refresh cached our content, you must do so immediately.

Certain topics on the NHS website need to be refreshed more frequently than every 7 days. Find out about content not covered by our standard terms and conditions.

Usage caps

When using a trial subscription, you will only be able to run 10 calls/minute up to a maximum of 1,000 calls per month. A full subscription caps usage at 4,000 calls per hour. You are not to call the APIs over 4,000 times in any one-hour period, unless you have notified the syndication team in advance and they have confirmed in writing that you can do so.

Standard licence terms

By using an NHS website API, you agree to our standard licence terms (PDF, 189KB).

Your contact details

You must provide accurate contact details that must be kept up to date while you are using our content. Failure to keep contact details updated is a breach of our licence terms and may result in your subscription being disabled. You can check your details on your profile.

Help and support

If you need help using any of our APIs , please email the NHS website service desk at nhswebsite.servicedesk@nhs.net.