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$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"
#>
#>
#>
#>
# 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).
# }