Wrong Country Parameter Mapping

The Companies House API “Search Officer” method results maps postal code into country parameter.
Please let me know if there is any data issue for this country field.

Thank you for taking the time to report this.
It will be passed to development for investigation.

Please let me know if there is any update on the query.

I found the following: Searching for e.g. “gibson” using e.g. curl to access API:

curl -u{api-key}: "https://api.companieshouse.gov.uk/search/officers?q=gibson"

…gives quite a few entries with postcode in country field, but not all. Wrong ones (most fields removed for clarity):

{
“address”: {
“premises”: “Treen House”,
“address_line_2”: “Winchfield”,
"country": “RG27 8BS”,
“address_line_1”: “Odiham Road”,
“region”: “Hampshire”,
“locality”: “Hook”
},
“address_snippet”: “Treen House, Odiham Road, Winchfield, Hook, Hampshire, RG27 8BS”,
“title”: “Jeremy BAILY GIBSON”,
“links”: {
“self”: “/officers/XAhLtKjkXmoA8cKFNoJcMJHotTc/appointments”
},

}

{
“address”: {
“premises”: “119b”,
"country": “SW17 8RS”,
“address_line_1”: “Drakefield Road”,
“locality”: “London”
},
“address_snippet”: “119b Drakefield Road, London, SW17 8RS”,
“title”: “Simon Charles CECIL GIBSON”,
“links”: {
“self”: “/officers/BhXBOC2Z5Mj4TfgBsem9NQ3DZkQ/appointments”
},

}

However some (e.g. where country is specified) seem OK:
{
“address”: {
“region”: “Tenessee 38128”,
“locality”: “Memphis”,
“address_line_1”: “3943 N.Lakewood Dr”,
"country": "U S A"
},
“address_snippet”: “3943 N.Lakewood Dr, Memphis, Tenessee 38128, U S A”,
“title”: “Kathy BUCKMAN GIBSON”,

}

{
“address”: {
"country": “England”,
“premises”: “Stirling House”,
“postal_code”: “CB25 9PB”,
“address_line_2”: “Waterbeach”,
“locality”: “Cambridge”,
“region”: “Cambridgeshire”,
“address_line_1”: “Denny End Road”
},
“address_snippet”: “Stirling House, Denny End Road, Waterbeach, Cambridge, Cambridgeshire, England, CB25 9PB”,
“title”: “Aaron Iain GIBSON”,
“links”: {
“self”: “/officers/grAaCMqjrRDfPdclapANdjFhFCA/appointments”
},

}

In some cases the address snippet doesn’t match the address (maybe not updated after a recent change has left postal_code in country)?

{
“address”: {
“address_line_1”: “Daisy Green”,
“locality”: “Bury St. Edmunds”,
“region”: “Suffolk”,
“premises”: “Holly Lodge”,
“address_line_2”: “Great Ashfield”,
"country": "IP31 3HX"
},
“address_snippet”: “Holly Lodge, Daisy Green, Great Ashfield, Bury St. Edmunds, Suffolk, England, IP31 3HX”,
“links”: {
“self”: “/officers/EpYXZ6Uw1ZvHpNSv3WtRu8Dew0s/appointments”
},
“title”: “Aaron Paul GIBSON”,

}

Checking Simon Charles CECIL GIBSON there are two companies. Checking the officer appointments for these gives the addresses with postal codes as you’d expect:

BLUETAIL LIMITED (08296624) - /company/08296624/officers
In the officer list:
{
“etag”: “0c11fa9cdc74eb53e3fab267196d9b10ef929ba2”,
“address”: {
"postal_code": “SW17 8RS”,
“premises”: “119b”,
“locality”: “London”,
“address_line_1”: “Drakefield Road”
},

}

OPEN VANTAGE LIMITED (05600602) - /company/05600602/officers
{
“etag”: “9721722a8d87fca666eeb668c68c7c09121749d0”,
“address”: {
“premises”: “119b”,
“address_line_1”: “Drakefield Road”,
“locality”: “London”,
"postal_code": "SW17 8RS"
},

}

There are examples of the same thing in the disqualified officers search e.g. searching for “green” using curl:

curl -u{api-key}: "https://api.companieshouse.gov.uk/search/disqualified-officers?q=green"

{
“address”: {
“locality”: “Barnet”,
“region”: “Hertfordshire”,
“address_line_1”: “67 Woodville Road”,
"country": "EN5 5NG"
},
“address_snippet”: “67 Woodville Road, Barnet, Hertfordshire, EN5 5NG”,

“title”: “Steven GREEN (FORMERLY KNOWN AS TERRY BEAN)”,
“links”: {
“self”: “/disqualified-officers/natural/Cumnr1kH7yKq_cou5gwvJ_-G3dk”
},

}

Some have correct address snippet (including country which isn’t in address) but mislabled address fields:
{
“address”: {
“locality”: “Southport”,
“region”: “Merseyside”,
“address_line_1”: “Fleetwood Crescent”,
“premises”: “22”,
"country": "PR9 8HF"
},
“address_snippet”: “22 Fleetwood Crescent, Southport, Merseyside, United Kingdom, PR9 8HF”,
“links”: {
“self”: “/disqualified-officers/natural/P298JJHX0v38mhMGr8ioF6avnUs”
},
“title”: “Stephen John GREENALL”,

}

But again some are OK:
{
“address”: {
"postal_code": “MK17 9HS”,
“premises”: “Manor Lodge”,
“locality”: “Milton Keynes”,
“address_line_1”: “Milton Bryan”
},
“address_snippet”: “Manor Lodge, Milton Bryan, Milton Keynes, MK17 9HS”,
“title”: “Alistair GREEN”,
“links”: {
“self”: “/disqualified-officers/natural/0hQFPVEFxJ6CDEEPBX01A3tn_0E”
},

}

{
“address”: {
“premises”: “9”,
“locality”: “Craigavon”,
“region”: “County Antrim”,
“address_line_2”: “Aghalee”,
“address_line_1”: “Boghead Bridge Road”,
"postal_code": "BT67 0DL"
},
“links”: {
“self”: “/disqualified-officers/natural/WgxTMg4HGNodUBm11yitcLExOXQ”
},
“address_snippet”: “9 Boghead Bridge Road, Aghalee, Craigavon, County Antrim, BT67 0DL”,
“title”: “Cormac GREEN”,

}

{
“address”: {
"postal_code": “SS1 2QJ”,
“premises”: “67”,
“address_line_1”: “Chinchilla Road”,
“locality”: “Southend-On-Sea”,
“region”: “Essex”
},
“address_snippet”: “67 Chinchilla Road, Southend-On-Sea, Essex, SS1 2QJ”,
“title”: “Daniel Anthony GREEN”,
“links”: {
“self”: “/disqualified-officers/natural/dbqcJrAoQFKfJH6QeaaFnfFAwvc”
},

}

Hello, is there update for this ticket? I found following:
curl -u{api-key}: "https://api.companieshouse.gov.uk/search/officers?q=Richard%20Hoskins"

10 of 15 top results has postcode in ‘country’ field

@voracityemail Please let me know if there is any update on the issue.There are lot of entries with postal codes in country field.We are looking at “Search Officer” API method.

@deepti_penneru I’m just another user of the API - so you’d need to ask the Companies House team. Which you have by posting here (I am not certain they’ll see this but that’s another story.)

If there is a code issue behind this you may be lucky. If this correctly reflects what’s in the underlying data I would not expect that this will change soon due to:

  1. There being other priorities that CH seem to be working on.
  2. Legal requirements. I am not clear on those - CH have corrected some data issues in the past and there are clearly some rules around what constitutes accurate or legal responses. However the general principle seems to be “we are required to provide the data we received, as we received it - it’s up to you how you process it”. Search around this forum and you’ll find examples of CH stating something like this.
  3. The scale of the task. Not just the size of the data set, but essentially they accept open input from the public (see point above). Then the data set contains entries dating from 100 years ago during which time addresses have changed, countries have come and gone and even civil service forms have changed!

Personally I’d be delighted to see stringent rules and validation going forward. For our use case we expect to be dealing with recent data on simple entities and have humans in the process. So we perform fairly simple but conservative validation and relying on flagging uncertain cases for human attention.

Chris