### Location Example: With Sheffield Location Source: https://getaddress.io/documentation Example request and response when searching for 'Homestead Road' with a location set to Sheffield. ```json { "location": { "latitude":53.42416763305664, "longitude":-1.45220148563385 } } ``` ```json { "suggestions": [ { "address": "2 Homestead Road, Sheffield, South Yorkshire", "url": "/get/YzUyZDZlOWIyZTUyODdkIDczMTQzMjggNzMyODU3YTM5ZDc4OTE5", "id": "YzUyZDZlOWIyZTUyODdkIDczMTQzMjggNzMyODU3YTM5ZDc4OTE5" }, { "address": "4 Homestead Road, Sheffield, South Yorkshire", "url": "/get/YzRmNDMxMjEwZTMzZmQ5IDczMTQzMjUgNzMyODU3YTM5ZDc4OTE5", "id": "YzRmNDMxMjEwZTMzZmQ5IDczMTQzMjUgNzMyODU3YTM5ZDc4OTE5" } ] } ``` -------------------------------- ### Location Example: Without Location Source: https://getaddress.io/documentation Example response when searching for 'Homestead Road' without a location preference. ```json { "suggestions": [ { "address": "1a Homestead Road, London", "url": "/get/NDg5YmQ5NzY5Zjk0YmI5IDUxMTQ3MTI1", "id": "NDg5YmQ5NzY5Zjk0YmI5IDUxMTQ3MTI1" }, { "address": "1b Homestead Road, London", "url": "/get/MDZlNWYxYTUyMDA0NDUyIDUxMDY1ODM0", "id": "MDZlNWYxYTUyMDA0NDUyIDUxMDY1ODM0" } ] } ``` -------------------------------- ### Filter Example: Town or City Source: https://getaddress.io/documentation Example of filtering results to only include addresses in London. ```json { "filter": { "town_or_city":"London" } } ``` -------------------------------- ### GET /autocomplete/{term} Source: https://getaddress.io/documentation Suggests partial address results for a given search term. The response contains a list of suggestions, each with an address, a URL, and an ID that can be used with the Get API. ```APIDOC ## [GET] /autocomplete/{term} ### Description Suggests partial address results for a given search term. The response contains a list of suggestions, each with an address, a URL, and an ID that can be used with the Get API. ### Method GET ### Endpoint https://api.getAddress.io/autocomplete/{term}?api-key={api-key} ### Parameters #### Path Parameters - **term** (string) - Required - The search term to find address suggestions for. #### Query Parameters - **api-key** (string) - Required - The API key for authentication. - **top** (number) - Optional - Sets the number of suggestions to retrieve (max 6). Default is 6. - **all** (boolean) - Optional - Returns all suggestions when search term contains a postcode. Default is true. - **template** (string) - Optional - Suggestion Text template. Available fields: {formatted_address}, {line_1}, {line_2}, {line_3}, {line_4}, {town_or_city}, {locality}, {county}, {country}, {outcode}, {postcode}. Default is {formatted_address}{postcode,, }{postcode}. - **show-postcode** (boolean) - Optional - When true, the postcode is always shown in the suggestions. Default is false. #### Request Body - **filter** (object) - Optional - A filter to limit results to specific criteria. Fields: county (string), country (string), locality (string), district (string), town_or_city (string), postcode (string), residential (boolean), radius (object with km, longitude, latitude). - **location** (object) - Optional - Instructs the service to prefer suggestions closer to the location. Fields: latitude (number), longitude (number). ### Request Example GET https://api.getAddress.io/autocomplete/Westminster?api-key={api-key} ### Response #### Success Response (200) - **suggestions** (array) - A list of address suggestions. - **address** (string) - The formatted address suggestion. - **url** (string) - The URL to retrieve the full address. - **id** (string) - The ID to pass to the Get API. #### Response Example { "suggestions": [ { "address": "Westminster Gallery, Westminster Central Hall, Westminster, London", "url": "/get/NDg5YmQ5NzY5Zjk0YmI5IDUxMTQ3MTI1", "id": "NDg5YmQ5NzY5Zjk0YmI5IDUxMTQ3MTI1" } ] } ``` -------------------------------- ### Fetch address using Domain Token Source: https://getaddress.io/documentation Uses a Domain Token instead of an API key to avoid exposing it in browser code. The Domain Token is passed as the api-key parameter in the GET request URL. ```html ``` -------------------------------- ### Get Full Address Request and Response Source: https://getaddress.io/documentation Step 2 of the address lookup process. Uses the ID from an autocomplete suggestion to retrieve the full address details. ```http GET https://api.getAddress.io/get/{id}?api-key={api-key} __ ``` ```json { "postcode": "NN1 3ER", "latitude": 52.24593734741211, "longitude": -0.891636312007904, "formatted_address": [ "10 Watkin Terrace", "", "", "Northampton", "Northamptonshire" ], "thoroughfare": "Watkin Terrace", "building_name": "", "sub_building_name": "", "sub_building_number": "", "building_number": "10", "line_1": "10 Watkin Terrace", "line_2": "", "line_3": "", "line_4": "", "locality": "", "town_or_city": "Northampton", "county": "Northamptonshire", "district": "Northampton", "country": "England" "residential": true } ``` -------------------------------- ### GET /get/{id} Source: https://getaddress.io/documentation Returns the full address details for a given ID obtained from the Autocomplete API. The response includes the postcode, coordinates, and various address components. ```APIDOC ## [GET] /get/{id} ### Description Returns the full address details for a given ID obtained from the Autocomplete API. The response includes the postcode, coordinates, and various address components. ### Method GET ### Endpoint https://api.getAddress.io/get/{id}?api-key={api-key} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the address to retrieve, obtained from the Autocomplete API. #### Query Parameters - **api-key** (string) - Required - The API key for authentication. ### Request Example GET https://api.getAddress.io/get/NDg5YmQ5NzY5Zjk0YmI5IDUxMTQ3MTI1?api-key={api-key} ### Response #### Success Response (200) - **postcode** (string) - The postcode of the address. - **latitude** (number) - The latitude coordinate. - **longitude** (number) - The longitude coordinate. - **formatted_address** (array) - The formatted address lines. - **thoroughfare** (string) - The thoroughfare name. - **building_name** (string) - The building name. - **sub_building_name** (string) - The sub-building name. - **sub_building_number** (string) - The sub-building number. - **building_number** (string) - The building number. - **line_1** (string) - Address line 1. - **line_2** (string) - Address line 2. - **line_3** (string) - Address line 3. - **line_4** (string) - Address line 4. - **locality** (string) - The locality. - **town_or_city** (string) - The town or city. - **county** (string) - The county. - **district** (string) - The district. - **country** (string) - The country. - **residential** (boolean) - Indicates if the address is residential. #### Response Example { "postcode": "NN1 3ER", "latitude": 52.24593734741211, "longitude": -0.891636312007904, "formatted_address": [ "10 Watkin Terrace", "", "", "Northampton", "Northamptonshire" ], "thoroughfare": "Watkin Terrace", "building_name": "", "sub_building_name": "", "sub_building_number": "", "building_number": "10", "line_1": "10 Watkin Terrace", "line_2": "", "line_3": "", "line_4": "", "locality": "", "town_or_city": "Northampton", "county": "Northamptonshire", "district": "Northampton", "country": "England", "residential": true } ``` -------------------------------- ### Autocomplete Request and Response Source: https://getaddress.io/documentation Step 1 of the address lookup process. Retrieves a list of address suggestions for a given term. ```http GET POST https://api.getAddress.io/autocomplete/{term}?api-key={api-key} __ ``` ```json { "suggestions": [ { "address": "Westminster Gallery, Westminster Central Hall, Westminster, London", "url": "/get/NDg5YmQ5NzY5Zjk0YmI5IDUxMTQ3MTI1", "id": "NDg5YmQ5NzY5Zjk0YmI5IDUxMTQ3MTI1" }, { "address": "Westminster School Lawrence Hall, Greycoat Street, Westminster, London", "url": "/get/MDZlNWYxYTUyMDA0NDUyIDUxMDY1ODM0", "id": "MDZlNWYxYTUyMDA0NDUyIDUxMDY1ODM0" }, { "address": "Knight Frank Victoria & Westminster, 51 Victoria Street, Westminster, London", "url": "/get/ZDNhNGJhMmY5YjU0ZWRlIDUxMTQ2ODU2", "id": "ZDNhNGJhMmY5YjU0ZWRlIDUxMTQ2ODU2" }, { "address": "Easy R M S, 8 Westminster City Hall, Westminster, London", "url": "/get/NWRmYWUxMWY2N2E0NGQyIDUxMDM5NDcx", "id": "NWRmYWUxMWY2N2E0NGQyIDUxMDM5NDcx" }, { "address": "Howick Place Westminster, 7 Howick Place, Westminster, London", "url": "/get/ZGQyYTFjMGI0YTkzZjRjIDUxMTE5NDg3", "id": "ZGQyYTFjMGI0YTkzZjRjIDUxMTE5NDg3" } ] } ``` -------------------------------- ### Location Parameter Structure Source: https://getaddress.io/documentation Defines the structure for providing latitude and longitude to prioritize nearby suggestions. ```json { "location": { "latitude":{latitude}, "longitude":{longitude} } } ``` -------------------------------- ### Filter Configuration Source: https://getaddress.io/documentation Defines the structure for filtering address results by criteria such as county, country, or radius. ```json { "filter": { "county":"{county name}", "country":"{country name}", "locality":"{locality}", "district":"{district name}", "town_or_city":"{town or city name}", "postcode":"{postcode}", "residential":{true or false} "radius":{ "km":"{max distance from lat/long in kilometres}", "longitude":{longitude}, "latitude":{latitude} } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.