### Get UK Address Suggestions with Single Summary Line Source: https://postcoder.com/docs/address-lookup/autocomplete-find This example demonstrates how to retrieve UK address suggestions for a given query ('1 birchwood') and receive the results in a single `summaryline` format. It utilizes the `autocomplete/find` endpoint with `singlesummary=true` and `format=json` parameters. ```http GET https://ws.postcoder.com/pcw_/autocomplete/find?query=1%20birchwood&country=uk&apikey=PCW45-12345-12345-1234X&singlesummary=true&format=json ``` -------------------------------- ### Get UK Address Suggestions with Summary and Location Summary Source: https://postcoder.com/docs/address-lookup/autocomplete-find This example shows how to fetch UK address suggestions for '1 birchwood' and get distinct `summaryline` and `locationsummary` fields in the JSON response. It uses the `autocomplete/find` endpoint without `singlesummary` but with `format=json`. ```http GET https://ws.postcoder.com/pcw_/autocomplete/find?query=1%20birchwood&country=uk&apikey=PCW45-12345-12345-1234X&format=json ``` -------------------------------- ### AddressBase UPRN API Request Example Source: https://postcoder.com/docs/address-lookup/addressbase-uprn This example demonstrates how to construct a request URL to the AddressBase UPRN API. It includes the API key, UPRN, and query parameters for specifying the response format and the number of address lines. ```HTTP https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X_/addressbase/uprn/200004353841?format=json&lines=3 ``` -------------------------------- ### AddressBase DPA API Request Example Source: https://postcoder.com/docs/address-lookup/addressbase-dpa This example demonstrates how to construct a request URL to the AddressBase DPA API. It specifies the API key, search term (postcode), and query parameters for response format, number of address lines, and additional tags to include. ```url https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X_/addressbase/dpa/nr1%204dh?format=json&lines=3&addtags=uprn_ ``` -------------------------------- ### Firewall Configuration Source: https://postcoder.com/docs/troubleshooting Information on configuring firewalls and security layers to allow Postcoder traffic. ```APIDOC ## Firewall Configuration ### Description Instructions for allowing Postcoder traffic through firewalls and security layers. ### Method N/A (Configuration) ### Endpoint N/A (Applies to all Postcoder API traffic) ### Parameters None ### Request Example None ### Response #### Success Response (200) - **Recommendation:** Allow-list the domain `ws.postcoder.com`. - **Note:** Do not allow-list by IP address as Postcoder uses load-balanced, frequently changing IPs. ``` -------------------------------- ### UDPRN API Request Example (URL) Source: https://postcoder.com/docs/address-lookup/udprn An example of a direct URL request to the Postcoder UDPRN API. This format is useful for understanding the endpoint structure and how to pass parameters like API key, UDPRN, desired format, and the number of address lines. ```url https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X_/udprn/56137114?format=json&lines=3_ ``` -------------------------------- ### Example Address Lines (JSON) Source: https://postcoder.com/docs/address-lookup/address Demonstrates the structure of address lines returned by the API for different international formats. The content varies based on country and configuration. ```json { "addressline1": "123 Rue Brizeux", "addressline2": "29860 Plouvien", "addressline3": null, "addressline4": null, "addressline5": null, "addressline6": null, "addressline7": null, "addressline8": null, "addressline9": null } ``` ```json { "addressline1": "2101 E COAST HWY STE 100", "addressline2": "CORONA DEL MAR CA 92625-1963", "addressline3": null, "addressline4": null, "addressline5": null, "addressline6": null, "addressline7": null, "addressline8": null, "addressline9": null } ``` ```json { "addressline1": "123 Foxglove Lane", "addressline2": "Biddenham", "addressline3": null, "addressline4": null, "addressline5": null, "addressline6": null, "addressline7": null, "addressline8": null, "addressline9": null } ``` -------------------------------- ### AddressBase API Request Example Source: https://postcoder.com/docs/address-lookup/addressbase This example demonstrates how to construct a request URL for the AddressBase API to retrieve property records with a Delivery Point Address (DPA) matching a specific postcode and including a specified number of address lines. It utilizes the `format` and `lines` query parameters. The response is a JSON array of address objects. ```url https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X_/addressbase/nr1%204dh?format=json&lines=3 ``` -------------------------------- ### Implement Email Validation in Python, PHP, C# Source: https://postcoder.com/docs/sample-code/email-validation These code examples demonstrate how to make requests to the Postcoder email endpoint for validating email addresses in Python, PHP, and C#. An API key is necessary for authentication. These snippets are useful for server-side validation. ```python # Python example for email validation # Requires Postcoder API key # Uses the email endpoint # Placeholder for actual Python code ``` ```php // PHP example for email validation // Requires Postcoder API key // Uses the email endpoint // Placeholder for actual PHP code ``` ```csharp // C# example for email validation // Requires Postcoder API key // Uses the email endpoint // Placeholder for actual C# code ``` -------------------------------- ### AddressBase API Response Example (JSON) Source: https://postcoder.com/docs/address-lookup/addressbase This is an example of a JSON response from the AddressBase API. It shows a single address object, including fields like address lines, summary line, organisation, street, postcode, coordinates, and unique identifiers. The structure and available fields depend on the `lines`, `include`, and `exclude` parameters in the request. ```json [ ... ... { "addressline1": "The Dean & Chapter of Norwich Cathedral", "addressline2": "Chapter Office", "addressline3": "65 The Close", "summaryline": "The Dean & Chapter of Norwich Cathedral, Chapter Office, 65 The Close, Norwich, NR1 4DH", "organisation": "The Dean & Chapter of Norwich Cathedral", "subbuildingname": "Chapter Office", "number": "65", "uniquedeliverypointreferencenumber": "17308537", "premise": "Chapter Office, 65", "street": "The Close", "posttown": "Norwich", "postcode": "NR1 4DH", "latitude": "52.6308744", "longitude": "1.3009883", "grideasting": "623485.0", "gridnorthing": "308793.0", "uprn": "200004353841", "usrn": "28920601" }, ... ... ] ``` -------------------------------- ### Configure Address Lines with Querystring Parameters Source: https://postcoder.com/docs/address-lookup/reversegeo Demonstrates how to set the number of address lines using the `lines` querystring parameter. Also shows how to include specific address components like posttown and postcode using `include`. ```HTTP ...&lines=3 ... ...&lines=3&include=posttown,postcode ``` ```JSON "addressline1": "123 Foxglove Lane", "addressline2": "Biddenham", ... "addressline1": "123 Foxglove Lane", "addressline2": "Biddenham", "addressline3": "Ashford, TN27 8BT", ... ``` -------------------------------- ### Integration Advice Source: https://postcoder.com/docs/address-lookup/pafaddressbase Provides guidance on integrating with the Postcoder API, including user experience, request formatting, and API key management. ```APIDOC ## Integration Advice * Always provide an option for users to enter their address manually if they cannot find it using your address lookup integration. * URL encode all special characters (including /) in your request parameters with %xx encoding. * Verify your request was successful by checking for an HTTP status code of 200. * When using your API key across multiple websites, apps or clients, set the `identifier` querystring parameter to a meaningful value such as "websiteA" or "client123"; you'll then be able to view these identifiers and the number of requests made by each one on the Identifier Usage page. * Treat all response fields as optional. * Use these fields on your UK address form: `addressline1`, `addressline2`, `addressline3`, `posttown`, `postcode` (county is no longer required in UK addresses). ``` -------------------------------- ### Get NGD Records by Postcode using Postcoder API Source: https://postcoder.com/docs/address-lookup/ngd This example demonstrates how to retrieve National Geographic Data (NGD) records that match a specific postcode. The request is made via a GET request to the Postcoder API endpoint, specifying the postcode and requesting a JSON output format. The response contains detailed address information. ```HTTP GET https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X_/ngd/nr1%204dh?format=json ``` -------------------------------- ### GET /websites/postcoder - Additional Response Fields Source: https://postcoder.com/docs/address-lookup/nyb This endpoint allows you to request additional fields in the API response by using the `addtags` query parameter. You can specify a comma-delimited list of fields to be included. For example, to add latitude, longitude, and UDPRN, you would append `?addtags=latitude,longitude,udprn` to your request URL. ```APIDOC ## GET /websites/postcoder ### Description Appends additional fields to the API response based on the `addtags` query parameter. ### Method GET ### Endpoint `https://ws.postcoder.com/pcw/...?format=json&lines=2_&addtags=` ### Parameters #### Query Parameters - **addtags** (string) - Required - A comma-delimited list of fields to include in the response. See the "Available Fields" section below for a list of valid tags. - **format** (string) - Optional - Specifies the response format (e.g., `json`). - **lines** (string) - Optional - Specifies the number of address lines to return. ### Available Fields (for `addtags` parameter) **Coordinate data** - `latitude` (number) - ETRS89 latitude. - `longitude` (number) - ETRS89 longitude. - `latitudeosgb` (number) - OSGB36 latitude. - `longitudeosgb` (number) - OSGB36 longitude. - `grideasting` (number) - Easting OS Grid Reference (1m precision in units of 1m). - `gridnorthing` (number) - Northing OS Grid Reference (1m precision in units of 1m). **Address fields** - `deliverypointsuffix` (string) - Delivery Point Suffix. - `uniquedeliverypointreferencenumber` (string) - Unique Delivery Point Reference Number (UDPRN). - `multipleoccupancycount` (number) - Count of the number of multiple occupancy addresses for the delivery point. - `administrativecounty` (string) - Administrative County (top tier local government). - `postalcounty` (string) - Former Postal County. - `traditionalcounty` (string) - Traditional County. - `usercategory` (string) - User Category ('R' for Residential, 'N' for Non-residential, 'L' for Large User). - `sortcode` (string) - Sortcode for Royal Mail Mailsort. - `countrycode` (string) - Country code within the United Kingdom. - `country` (string) - Country name within the United Kingdom. - `welsh_dependentstreet` (string) - Welsh language alternative for dependent street field. - `welsh_street` (string) - Welsh language alternative for street field. - `welsh_doubledependentlocality` (string) - Welsh language alternative for double dependent locality field. - `welsh_dependentlocality` (string) - Welsh language alternative for dependent locality field. - `welsh_posttown` (string) - Welsh language alternative for post town field. **Special PAF keys (Royal Mail PAF addresses only)** - `addresskey` (string) - The 8-digit PAF Address Key from Royal Mail (UK only). - `organisationkey` (string) - The 8-digit PAF Organisation Key from Royal Mail (UK only, '0' for Residential Small Users and Large Users). - `postcodetype` (string) - The PAF Postcode Type from Royal Mail (UK only, 'S' for Small Users, 'L' for Large Users). **Census data** - `oa11` (string) - 2011 Census Output Area. - `lsoa11` (string) - 2011 Census Lower Layer Super Output Area. - `msoa11` (string) - 2011 Census Middle Layer Super Output Area. **NHS data** - `commissioningregioncode_gss` (string) - NHS Commissioning Region Code (ONS GSS). - `commissioningregionname` (string) - NHS Commissioning Region Name. - `areateamcode_nhs` (string) - NHS Area Team Code (NHS). - `areateamcode_gss` (string) - NHS Area Team Code (ONS GSS). - `areateamname` (string) - NHS Area Team Name. - `clinicalcommissioninggroupcode_nhs` (string) - NHS Clinical Commissioning Group Code (NHS). - `clinicalcommissioninggroupcode_gss` (string) - NHS Clinical Commissioning Group Code (ONS GSS). - `clinicalcommissioninggroupname` (string) - NHS Clinical Commissioning Group Name. **Government data** - `localauthoritycode` (string) - Local Authority Code. - `localauthorityname` (string) - Local Authority Name. - `electoralwardcode` (string) - Electoral Ward Code. - `electoralwardname` (string) - Electoral Ward Name. - `electoralcountycode` (string) - Electoral County Code. - `electoralcountyname` (string) - Electoral County Name. - `parliamentaryconstituencycode` (string) - Westminster Parliamentary Constituency Code. - `parliamentaryconstituencyname` (string) - Westminster Parliamentary Constituency Name. - `europeanelectoralregioncode` (string) - European Electoral Region Code. - `europeanelectoralregionname` (string) - European Electoral Region Name. - `nationalparkcode` (string) - National Park Code. - `nationalparkname` (string) - National Park Name. ### Request Example ``` https://ws.postcoder.com/pcw/...?format=json&lines=2&addtags=latitude,longitude,udprn ``` ### Response #### Success Response (200) - **latitude** (number) - ETRS89 latitude. - **longitude** (number) - ETRS89 longitude. - **uniquedeliverypointreferencenumber** (string) - Unique Delivery Point Reference Number (UDPRN). #### Response Example ```json { "latitude": 52.6299163702, "longitude": 1.3018030246, "uniquedeliverypointreferencenumber": "50959190" } ``` ``` -------------------------------- ### Get NGD Record by UPRN with Royal Mail Addresses and Address Lines Source: https://postcoder.com/docs/address-lookup/ngd This example shows how to retrieve a specific National Geographic Data (NGD) record using its Unique Property Reference Number (UPRN). It also requests the inclusion of Royal Mail addresses and limits the output to a maximum of three address lines. The response includes detailed address components and Royal Mail specific data. ```HTTP GET https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X_/ngd?uprn=200004353841&addtags=royalmailaddresses&lines=3 ``` -------------------------------- ### Example Address Lines JSON Output Source: https://postcoder.com/docs/address-lookup/autocomplete-retrieve Demonstrates the typical JSON structure returned by the address lines API, showcasing address elements like 'addressline1' and 'addressline2'. This format is consistent across different country address types, with variations in content. ```json { "addressline1": "123 Rue Brizeux", "addressline2": "29860 Plouvien", "posttown": "Plouvien", "county": "Finistère", "postcode": "29860" } ``` ```json { "addressline1": "2101 E COAST HWY STE 100", "addressline2": "CORONA DEL MAR CA 92625-1963", "posttown": "CORONA DEL MAR", "county": "Orange", "postcode": "92625-1963" } ``` ```json { "addressline1": "123 Foxglove Lane", "addressline2": "Biddenham", "posttown": "Ashford", "county": "Kent", "postcode": "TN27 8BT" } ``` -------------------------------- ### Integration Advice Source: https://postcoder.com/docs/address-lookup/reversegeo Provides essential tips and best practices for integrating the Postcoder API into applications. ```APIDOC ## Integration Advice ### Description Best practices for integrating the Postcoder API, including user experience, URL encoding, status code verification, API key management, and handling response fields. ### Key Recommendations - **Manual Address Entry**: Always offer an option for users to enter their address manually if lookup fails. - **URL Encoding**: Ensure all special characters in request parameters are URL encoded (e.g., `/` becomes `%2F`). - **Status Code Verification**: Check for an HTTP status code of `200` to confirm successful requests. - **API Key Identifiers**: Use the `identifier` querystring parameter to tag requests from different sources (e.g., `websiteA`, `client123`) for usage tracking. - **Optional Response Fields**: Treat all response fields as optional, as they may not always be present. ``` -------------------------------- ### Mapping Address Lines to Form Fields (Other Countries Example - JSON) Source: https://postcoder.com/docs/address-lookup/address Provides an example of API response fields for non-UK/US countries when parameters like 'exclude=posttown,county,postcode,country' are applied. ```json { "addressline1":"123 Rue Brizeux", // Address line 1 "posttown": "Plouvien", // City/Town "county": "Finistère", // State/Region/County "postcode": "29860" // Postal/Zip code } ``` -------------------------------- ### Email Validation API Source: https://postcoder.com/docs/sample-code/email-validation This section details how to use the Postcoder email endpoint to validate email addresses. It includes examples for both client-side JavaScript implementation and server-side implementations in Python, PHP, and C#. ```APIDOC ## POST /email ### Description This endpoint checks if an email address is valid and capable of receiving email. ### Method POST ### Endpoint /email ### Parameters #### Query Parameters - **apiKey** (string) - Required - Your Postcoder API key. - **email** (string) - Required - The email address to validate. ### Request Example ```json { "email": "test@example.com" } ``` ### Response #### Success Response (200) - **valid** (boolean) - Indicates if the email address is valid. - **details** (object) - Contains detailed information about the email validation. - **deliverable** (boolean) - Indicates if the email address is capable of receiving email. - **domain_valid** (boolean) - Indicates if the domain of the email address is valid. - **local_part_valid** (boolean) - Indicates if the local part of the email address is valid. #### Response Example ```json { "valid": true, "details": { "deliverable": true, "domain_valid": true, "local_part_valid": true } } ``` ## JavaScript Email Validation ### Description This JavaScript example helps you integrate Postcoder email validation into your website. It provides a ready-to-use script to check email validity without custom coding. ### Method GET (for script inclusion) ### Endpoint (Refer to the downloaded JS example or CodePen) ### Parameters (Handled within the JavaScript script, requires API key) ### Request Example (See downloaded JS file or CodePen) ### Response (Handled within the JavaScript script, providing visual feedback or callbacks) ## Server-Side Email Validation Examples ### Description These examples demonstrate how to make requests to the Postcoder email endpoint from various server-side languages to validate email addresses. ### Method POST ### Endpoint /email ### Parameters #### Query Parameters - **apiKey** (string) - Required - Your Postcoder API key. #### Request Body - **email** (string) - Required - The email address to validate. ### Request Example (Python) ```python import requests api_key = "YOUR_API_KEY" email_to_validate = "test@example.com" url = f"https://api.postcoder.com/email?apiKey={api_key}" payload = { "email": email_to_validate } response = requests.post(url, json=payload) print(response.json()) ``` ### Request Example (PHP) ```php $emailToValidate]); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); print_r(json_decode($response, true)); ?> ``` ### Request Example (C#) ```csharp using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; public class EmailValidator { public static async Task ValidateEmailAsync() { string apiKey = "YOUR_API_KEY"; string emailToValidate = "test@example.com"; string url = $"https://api.postcoder.com/email?apiKey={apiKey}"; using (HttpClient client = new HttpClient()) { var jsonPayload = $"{{\"email\": \"{emailToValidate}\"}}"; var content = new StringContent(jsonPayload, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(url, content); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } } } ``` ### Response (for server-side examples) #### Success Response (200) - **valid** (boolean) - Indicates if the email address is valid. - **details** (object) - Contains detailed information about the email validation. - **deliverable** (boolean) - Indicates if the email address is capable of receiving email. - **domain_valid** (boolean) - Indicates if the domain of the email address is valid. - **local_part_valid** (boolean) - Indicates if the local part of the email address is valid. #### Response Example ```json { "valid": true, "details": { "deliverable": true, "domain_valid": true, "local_part_valid": true } } ``` ``` -------------------------------- ### Create Email Address Checker with JavaScript Source: https://postcoder.com/docs/sample-code/email-validation This JavaScript example integrates Postcoder email validation into your website. It utilizes the email endpoint to verify if an email address is valid and can receive emails. Ensure you have a Postcoder API key. ```javascript // JavaScript example for email validation // Requires Postcoder API key // Uses the email endpoint to check email validity // Placeholder for actual JavaScript code ``` -------------------------------- ### Integration Advice Source: https://postcoder.com/docs/address-lookup/nyb Provides essential advice for integrating with the Postcoder API, including handling user input, URL encoding, verifying success, managing API keys, and recommended address fields for UK forms. ```APIDOC ## Integration Advice * Always provide an option for users to enter their address manually if they cannot find it using your address lookup integration. * URL encode all special characters (including /) in your request parameters with `%xx` encoding. * Verify your request was successful by checking for an HTTP status code of 200; see all HTTP status codes with descriptions. * When using your API key across multiple websites, apps or clients, set the `identifier` querystring parameter to a meaningful value such as "websiteA" or "client123"; you'll then be able to view these identifiers and the number of requests made by each one on the Identifier Usage page. * Treat all response fields as optional. * Use these fields on your UK address form: addressline1, addressline2, addressline3, posttown, postcode (county is no longer required in UK addresses). ``` -------------------------------- ### JavaScript for Postcoder Address Autocomplete Initialization Source: https://postcoder.com/docs/integrations Initializes the Postcoder Address Autocomplete library on a webpage. It requires an API key and maps form input fields to the library's configuration for country selection, search input, and output fields. The script ensures the DOM is fully loaded before initialization. ```javascript ``` -------------------------------- ### Integration Advice Source: https://postcoder.com/docs/address-lookup/addressbase-uprn Provides guidance on integrating the Postcoder API, including best practices for user experience, request formatting, and response handling. ```APIDOC ## Integration Advice ### User Experience * Always provide an option for users to enter their address manually if they cannot find it using the address lookup integration. ### Request Formatting * URL encode all special characters (including /) in your request parameters with %xx encoding. ### Response Handling * Verify your request was successful by checking for an HTTP status code of 200. * Treat all response fields as optional. ### API Key Usage * When using your API key across multiple websites, apps or clients, set the `identifier` querystring parameter to a meaningful value such as "websiteA" or "client123". This allows you to view usage statistics per identifier. ### Address Form Fields * Use these fields on your UK address form: `addressline1`, `addressline2`, `addressline3`, `posttown`, `postcode`. (County is no longer required in UK addresses). ``` -------------------------------- ### NGD Autocomplete API Request Example Source: https://postcoder.com/docs/address-lookup/ngd-find This example demonstrates how to query the NGD autocomplete API for address suggestions, specifically filtering for Royal Mail addresses. The API returns a list of suggestions, each with a unique ID and a summary line. The minimum query length is three characters. ```bash https://ws.postcoder.com/pcw_/ngd/find?query=10%20foxg&featuretype=royalmailaddress&apikey=PCW45-12345-12345-1234X&format=json ``` -------------------------------- ### GET /status/creditsabovethreshold Source: https://postcoder.com/docs/health-status Checks if the number of available credits is above a specified threshold. ```APIDOC ## GET /status/creditsabovethreshold ### Description Returns a `true` or `false` to indicate whether the number of credits available is above a threshold number. ### Method GET ### Endpoint /status/creditsabovethreshold ### Parameters #### Query Parameters - **apiKey** (string) - Required - The API key to authenticate requests. - **threshold** (integer) - Optional - The credit threshold to compare against. Defaults to a system-defined value if not provided. ### Request Example ``` GET /status/creditsabovethreshold?apiKey=YOUR_API_KEY&threshold=500 ``` ### Response #### Success Response (200) - **creditsAboveThreshold** (boolean) - `true` if credits are above the threshold, `false` otherwise. #### Response Example ```json { "creditsAboveThreshold": true } ``` ``` -------------------------------- ### GET /status Source: https://postcoder.com/docs/health-status Retrieves service information and settings associated with your API key. ```APIDOC ## GET /status ### Description Returns service information and the settings associated with a given API key. ### Method GET ### Endpoint /status ### Parameters #### Query Parameters - **apiKey** (string) - Required - The API key to authenticate requests. ### Request Example ``` GET /status?apiKey=YOUR_API_KEY ``` ### Response #### Success Response (200) - **serviceName** (string) - The name of the service. - **version** (string) - The version of the service. - **settings** (object) - An object containing various settings. - **setting1** (string) - Description of setting 1. - **setting2** (number) - Description of setting 2. #### Response Example ```json { "serviceName": "Postcoder", "version": "1.0.0", "settings": { "rateLimit": 1000, "timeout": 5000 } } ``` ``` -------------------------------- ### Mapping API Output to International Address Form Fields Source: https://postcoder.com/docs/address-lookup/autocomplete-retrieve Shows how the API response can be mapped to specific fields in an international address form. It provides examples for UK/Ireland and other countries, demonstrating how to use query parameters to retrieve the necessary data. ```url ...&lines=3 (for UK, GG, JE, IM, IE) ``` ```url ...&lines=3&exclude=posttown,county,postcode,country (for other countries) ``` -------------------------------- ### Configuring Address Lines with Query Parameters Source: https://postcoder.com/docs/address-lookup/autocomplete-retrieve Illustrates how to use query parameters to customize the address lines returned by the API. 'lines' controls the number of lines, while 'include' and 'exclude' specify which address elements to add or remove from the output. ```url ...&lines=3 ``` ```url ...&lines=3&include=posttown,postcode ``` ```url ...&lines=3&exclude=postcode ``` -------------------------------- ### Validate UK Bank Account Details (Example Request and Response) Source: https://postcoder.com/docs/bank-validation/bank This example shows a complete request to the Postcoder Bank API for validating a specific sort code and account number, including the API key and format parameters. It also provides the corresponding JSON response, detailing the validation results and bank information. ```json https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X _/bank?format=json_ { "sortcode": "100000", "accountnumber": "31510604" } ``` ```json { "valid": true, "stateid": 0, "sortcode": "100000", "accountnumber": "31510604", "directdebits": true, "fasterpayments": true, "chaps": true, "bacs": true, "bankbic": "BKENGB33", "branchbic": "XXX", "bankname": "BANK OF ENGLAND", "branchname": "HEAD OFFICE", "addressline1": "Threadneedle Street", "addressline2": "", "addressline3": "", "addressline4": "", "posttown": "London", "postcode": "EC2R 8AH", "phone1": "020 34614717", "phone2": "" } ```