Find Address
GET/autocomplete/addresses
The Address Autocomplete API delivers address suggestions in order of relevance based on a provided query. It aids real-time address autofill implementations.
Consider using our Address Autocomplete JavaScript libraries to add address lookup to a form in moments rather than interacting with this API directly.
API Usage
Implementing our Address Autocomplete API involves:
- Fetch address suggestions with
/autocomplete/addresses
- Acquire the complete address using the ID from the suggestion
Step 2 will decrement your lookup balance.
Note that step 1 is not a free standalone resource. Integrations that consistently make autocomplete requests without a paid Step 2 request will be rate limited and then suspended.
Query Filters
Refine results by appending filters to your querystring, e.g., postcode=sw1a2aa
for postcode SW1A 2AA
. Invalid filters return an empty set without affecting your lookup count.
To apply multiple filter terms, use a comma-separated list, e.g., postcode_outward=e1,e2,e3
combines result sets for E1, E2, and E3. Unless otherwise specified, all filters support multiple terms.
Combine filters by AND
logic, for instance, su_organisation_indicator=Y&postcode_area=n
. The maximum allowed filter terms is 10.
Address Bias
Preface bias searches with bias_
to boost certain address results. Unlike filters, biasing allows unmatched addresses to appear with lower priority.
For example, use bias_postcode_area=SW,SE
to favor addresses in the SW
and SE
postcode areas. Invalid bias terms have no effect.
Multiple bias terms are allowed unless stated otherwise, with a combined maximum of 5.
Suggestion Format
The suggestion format is subject to change. We recommend using the suggestion as-is to prevent potential integration issues.
Rate Limiting and Cost
The rate limit for the Autocomplete API is 3000 requests per 5 minutes. HTTP Headers inform about the current rate limit.
Autocomplete API usage does not impact your balance, but resolving a suggestion to a full address requires a paid request. Autocomplete requests without subsequent paid requests may result in rate limitation or suspension.
Request
Query Parameters
API Key
Your unique identifier that allows access to our APIs.
Begins ak_
. Available from your dashboard
Possible values: <= 150 characters
Address Query
The partial address string entered by the user to autocomplete.
Context
Limits search results, typically within g country.
Possible values: >= 1
and <= 100
Default value: 10
Limit
Specifies the maximum number of records to retrieve.
By default the limit is 10. Requesting a larger result set will result in more latency
Bias by Geolocation
Bias search to a geospatial circle determined by an origin and radius in meters. Max radius is 50000
.
Uses the format bias_lonlat=[longitude],[latitude],[radius in metres]
Only one geospatial bias may be provided
Possible values: [true
]
Bias by Geolocation of IP
Biases search based on approximate geolocation of IP address.
Set bias_ip=true
to enable.
Filter by Bounding Box
Restrict search to a geospatial box determined by the "top-left" and "bottom-right" gelocations.
Only one geospatial box can be provided.
Filter by Outward Code
Restrict result set to addresses with a matching outward code.
The outward code is the first half of a postcode. E.g. the outward code for SW1A 2AA
is SW1A
.
Filter by postcode Restrict result set to matching postcodes only. Can be combined with query to perform a postcode and building number or name search.
Filter by Postcode Area
Postcode area represents the first one or two non-numeric characters of a postcode. E.g. the postcode area of SW1A 2AA
is SW
.
Can be combined with query to perform a postcode and building search.
Filter by Postcode Sector
Postcode sector is the outward code plus first numeric of the inward code. E.g. postcode sector of SW1A 2AA
is SW1A 2
Filter by Town or City
Restrict addresses to matching town, city or other locality identifier.
Filter by UPRN
Does not accept comma separated terms. Only a single term is permitted
Filter by country
Filters by country name.
In the context of GBR, country values are not United Kingdom. Instead they are England, Scotland, Wales, Northern Ireland, Jersey, Guernsey and Isle of Man.
Filter by Postcode Type
Filter by Postcode Type. Useful for separating organisational and residential addresses
Filter by Organisation Indicator
Useful for separating organisational and residential addresses
Bias by Outward Code
Boosts addresses with a matching outward code.
Outward code is the first have of a postcode. For instance, the outward code of SW1A 2AA
is SW1A
Bias by postcode Boost addresses which match postcode. Can be combined with query to perform a postcode and building number or name search.
Bias by Postcode Area
Boosts if the first one or two non-numeric characters of a postcode match
The postcode area of SW1A 2AA and N1 6RT are SW and N respectively
Bias by Postcode Sector
Boost postcode sector matches. The postcode sector comprises the outward code plus first numeric of the inward code.
Bias by Town or City
Biases results to matching town, city or other locality name.
Bias by Street
Bias by street or thoroughfare name.
Bias by Country
Possible values are England, Scotland, Wales, Northern Ireland, Jersey, Guernsey and Isle of Man.
Responses
- 200
- 400
Success
Response Headers
X-RateLimit-Limit number
The maximum number of requests that can be made in 5 minutes
X-RateLimit-Remaining number
The remaining requests within the current rate limit window
X-RateLimit-Reset number
The time when the rate limit window resets in Unix Time (seconds) or UTC Epoch seconds.
- application/json
- Schema
- Example (from schema)
- GBR
- USA
Schema
- Array [
- Address Suggestion
- UK Address Suggestion
- ]
result objectrequired
hits object[]required
Global unique internally generated identifier for an address
Address Suggestion to be displayed to the user
Global unique internally generated identifier for an address
Address suggestion for a given query.
UDPRN stands for ‘Unique Delivery Point Reference Number’. Royal Mail assigns a unique UDPRN code for each premise on PAF. Simple, unique reference number for each Delivery Point. Unlikely to be reused when an address expires.
Up to 8-digit numeric code.
A new UDPRN is automatically assigned to each new Delivery Point added to PAF.
Optionally returned field, representing the UMPRN of a Multiple Residence household
urls objectrequired
URL to retrieve the entire details for a given address suggestion by the UDPRN
Optionally returned field, to retrieve the entire details for a suggested Multiple Residence household
Possible values: [2000
]
Possible values: [Success
]
{
"result": [
{
"id": "paf_23747771",
"suggestion": "Prime Minister & First Lord Of The Treasury, 10 Downing Street, London, SW1A",
"udprn": 23747771,
"urls": {
"udprn": "/v1/udprn/23747771"
}
},
{
"id": "paf_26245117",
"suggestion": "Flat 10, Downing Court, Grenville Street, London, WC1N",
"udprn": 26245117,
"urls": {
"udprn": "/v1/udprn/26245117"
}
}
],
"code": 2000,
"message": "Success"
}
Example response for GBR context
{
"result": {
"hits": [
{
"id": "paf_23747771",
"suggestion": "Prime Minister & First Lord Of The Treasury, 10 Downing Street, London, SW1A",
"udprn": 23747771,
"urls": {
"udprn": "/v1/udprn/23747771"
}
},
{
"id": "paf_26245117",
"suggestion": "Flat 10, Downing Court, Grenville Street, London, WC1N",
"udprn": 26245117,
"urls": {
"udprn": "/v1/udprn/26245117"
}
}
]
},
"code": 2000,
"message": "Success"
}
Example response for USA context
{
"result": {
"hits": [
{
"suggestion": "10 Downing St, Montpelier, VT, 05602",
"urls": {},
"id": "usps_V210079628|10||3797"
},
{
"suggestion": "10 Ten Downing St, Fountain Inn, SC, 29644",
"urls": {},
"id": "usps_X219061579|10||5031"
},
{
"suggestion": "10 Downing St Apt 1, Montpelier, VT, 05602",
"urls": {},
"id": "usps_V210079629|10|1|3798"
},
{
"suggestion": "2100 N Downing St Unit 10, Denver, CO, 80205",
"urls": {},
"id": "usps_Z125260298|2100|10|5272"
},
{
"suggestion": "10 S Downing St, Denver, CO, 80209",
"urls": {},
"id": "usps_Z105732754|10||2411"
},
{
"suggestion": "10 Downing St, Hollister, MO, 65672",
"urls": {},
"id": "usps_W112200302|10||5568"
},
{
"suggestion": "10 Downing St, Greensboro, NC, 27410",
"urls": {},
"id": "usps_Y127860601|10||2448"
},
{
"suggestion": "1 S Downing St Apt 10, Denver, CO, 80209",
"urls": {},
"id": "usps_Z105731302|1|10|2440"
},
{
"suggestion": "1560 N Downing St Apt 10, Denver, CO, 80218",
"urls": {},
"id": "usps_Z122881416|1560|10|1538"
},
{
"suggestion": "2202 N Downing St Apt 10, Denver, CO, 80205",
"urls": {},
"id": "usps_Z122964113|2202|10|5264"
}
]
},
"code": 2000,
"message": "Success"
}
Bad Request
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
API Response Code. Non 2xxx
code indicates a failure. This code will provide a more specific reason when a failure occurs and facilitates debugging.
Human readable error message supplied with every error response.
errors object[]
Indicates location of error in request query or URL parameter
Indicates location of error in request query or URL parameter
{
"code": 0,
"message": "string",
"errors": [
{
"message": "should have required property 'type'",
"path": ".query.type",
"errorCode": "required.openapi.validation"
}
]
}