Returns a list of matching postcodes and respective available data.
Arguments
- postcodes
Accepts a list of postcodes. Accepts up to 100 postcodes. For only one postcode use
postcode_lookup.
See also
postcode_lookup for documentation.
Examples
# \donttest{
pc_list <- list(
postcodes = c("PR3 0SG", "M45 6GN", "EX165BL")) # spaces are ignored
bulk_postcode_lookup(pc_list)
#> [[1]]
#> [[1]]$query
#> [1] "PR3%200SG"
#>
#> [[1]]$result
#> NULL
#>
#>
#> [[2]]
#> [[2]]$query
#> [1] "M45%206GN"
#>
#> [[2]]$result
#> NULL
#>
#>
#> [[3]]
#> [[3]]$query
#> [1] "EX165BL"
#>
#> [[3]]$result
#> [[3]]$result$postcode
#> [1] "EX16 5BL"
#>
#> [[3]]$result$quality
#> [1] 1
#>
#> [[3]]$result$eastings
#> [1] 294478
#>
#> [[3]]$result$northings
#> [1] 112252
#>
#> [[3]]$result$country
#> [1] "England"
#>
#> [[3]]$result$nhs_ha
#> [1] "South West"
#>
#> [[3]]$result$longitude
#> [1] -3.50197
#>
#> [[3]]$result$latitude
#> [1] 50.90006
#>
#> [[3]]$result$european_electoral_region
#> [1] "South West"
#>
#> [[3]]$result$primary_care_trust
#> [1] "Devon"
#>
#> [[3]]$result$region
#> [1] "South West"
#>
#> [[3]]$result$lsoa
#> [1] "Mid Devon 005C"
#>
#> [[3]]$result$msoa
#> [1] "Mid Devon 005"
#>
#> [[3]]$result$incode
#> [1] "5BL"
#>
#> [[3]]$result$outcode
#> [1] "EX16"
#>
#> [[3]]$result$parliamentary_constituency
#> [1] "Tiverton and Minehead"
#>
#> [[3]]$result$parliamentary_constituency_2024
#> [1] "Tiverton and Minehead"
#>
#> [[3]]$result$admin_district
#> [1] "Mid Devon"
#>
#> [[3]]$result$parish
#> [1] "Tiverton"
#>
#> [[3]]$result$admin_county
#> [1] "Devon"
#>
#> [[3]]$result$date_of_introduction
#> [1] "198001"
#>
#> [[3]]$result$admin_ward
#> [1] "Tiverton Westexe"
#>
#> [[3]]$result$ced
#> [1] "Tiverton West"
#>
#> [[3]]$result$ccg
#> [1] "NHS Devon"
#>
#> [[3]]$result$nuts
#> [1] "Mid Devon"
#>
#> [[3]]$result$pfa
#> [1] "Devon & Cornwall"
#>
#> [[3]]$result$nhs_region
#> [1] "South West"
#>
#> [[3]]$result$ttwa
#> [1] "Exeter"
#>
#> [[3]]$result$national_park
#> [1] "England (non-National Park)"
#>
#> [[3]]$result$bua
#> [1] "Tiverton (Mid Devon)"
#>
#> [[3]]$result$icb
#> [1] "NHS Devon Integrated Care Board"
#>
#> [[3]]$result$cancer_alliance
#> [1] "Peninsula"
#>
#> [[3]]$result$lsoa11
#> [1] "Mid Devon 005C"
#>
#> [[3]]$result$msoa11
#> [1] "Mid Devon 005"
#>
#> [[3]]$result$lsoa21
#> [1] "Mid Devon 005C"
#>
#> [[3]]$result$msoa21
#> [1] "Mid Devon 005"
#>
#> [[3]]$result$oa21
#> [1] "E00101678"
#>
#> [[3]]$result$ruc11
#> [1] "(England/Wales) Urban city and town"
#>
#> [[3]]$result$ruc21
#> [1] "Urban: Nearer to a major town or city"
#>
#> [[3]]$result$lep1
#> [1] "Heart of the South West"
#>
#> [[3]]$result$lep2
#> NULL
#>
#> [[3]]$result$codes
#> [[3]]$result$codes$admin_district
#> [1] "E07000042"
#>
#> [[3]]$result$codes$admin_county
#> [1] "E10000008"
#>
#> [[3]]$result$codes$admin_ward
#> [1] "E05014813"
#>
#> [[3]]$result$codes$parish
#> [1] "E04003055"
#>
#> [[3]]$result$codes$parliamentary_constituency
#> [1] "E14001548"
#>
#> [[3]]$result$codes$parliamentary_constituency_2024
#> [1] "E14001548"
#>
#> [[3]]$result$codes$ccg
#> [1] "E38000230"
#>
#> [[3]]$result$codes$ccg_id
#> [1] "15N"
#>
#> [[3]]$result$codes$ced
#> [1] "E58000304"
#>
#> [[3]]$result$codes$nuts
#> [1] "TLK43"
#>
#> [[3]]$result$codes$lsoa
#> [1] "E01020079"
#>
#> [[3]]$result$codes$msoa
#> [1] "E02004168"
#>
#> [[3]]$result$codes$lau2
#> [1] "E07000042"
#>
#> [[3]]$result$codes$pfa
#> [1] "E23000035"
#>
#> [[3]]$result$codes$nhs_region
#> [1] "E40000006"
#>
#> [[3]]$result$codes$ttwa
#> [1] "E30000206"
#>
#> [[3]]$result$codes$national_park
#> [1] "E65000001"
#>
#> [[3]]$result$codes$bua
#> [1] "E63013547"
#>
#> [[3]]$result$codes$icb
#> [1] "E54000037"
#>
#> [[3]]$result$codes$cancer_alliance
#> [1] "E56000014"
#>
#> [[3]]$result$codes$lsoa11
#> [1] "E01020079"
#>
#> [[3]]$result$codes$msoa11
#> [1] "E02004168"
#>
#> [[3]]$result$codes$lsoa21
#> [1] "E01020079"
#>
#> [[3]]$result$codes$msoa21
#> [1] "E02004168"
#>
#> [[3]]$result$codes$oa21
#> [1] "E00101678"
#>
#> [[3]]$result$codes$ruc11
#> [1] "C1"
#>
#> [[3]]$result$codes$ruc21
#> [1] "UN1"
#>
#> [[3]]$result$codes$lep1
#> [1] "E37000016"
#>
#> [[3]]$result$codes$lep2
#> NULL
#>
#>
#>
#>
# The function needs a list of length one. This won't work:
bulk_postcode_lookup(list("PR3 0SG", "M45 6GN", "EX165BL"))
#> Warning: Bad Request (HTTP 400).
# }
