Search-postcode-or-place returns 500

curl --location --request POST ‘https://api.nhs.uk/service-search/search-postcode-or-place?api-version=2&search=manchester’ --header ‘subscription-key: e065dbe14b074e918566188434ff7dda’

returns 500 with “optionalErrorName”: “We can’t find ‘manchester’”, …

Hello nsenkevich,
Can you help point me towards the service you are using?
Example: Find a GP - NHS (www.nhs.uk)? This particular one only allows 8 characters (Postcode) and does not support partial postcode entries.
Thank you

I’m trying to use this api endpoint with trial key see doc bellow

Hi nsenkevich,

Please could you try the following cURL command …

curl --location 'https://api.nhs.uk/service-search/search-postcode-or-place?api-version=2&search=Manchester' \
--header 'Content-Type: application/json' \
--header 'subscription-key: e065dbe14b074e918566188434ff7dda' \
--data '{
  "filter": "OrganisationTypeId eq '\''DEN'\''",
  "top": 10,
  "skip": 0,
  "count": true
}'

This will return the following JSON response …

{
  "place": [
    {
      "Latitude": 53.478941671902611,
      "Longitude": -2.245277998298477,
      "text": "Manchester, North West",
      "url": "https://api.nhs.uk/service-search/search-postcode-or-place?api-version=1&search=Manchester&latitude=53.4789416719026&longitude=-2.24527799829848"
    },
    {
      "Latitude": 53.514265448236706,
      "Longitude": -2.4199003923191209,
      "text": "New Manchester, North West",
      "url": "https://api.nhs.uk/service-search/search-postcode-or-place?api-version=1&search=Manchester&latitude=53.5142654482367&longitude=-2.41990039231912"
    }
  ]
}

This is an example of when the search parameter matches more than one entry. In this situation you would need to send a second request to the API using one of the suggested endpoints that includes the more specific latitude and longitude.

I hope that helps.