@ideal-postcodes/openapi
Version:
Ideal Postcodes OpenAPI v3 specifications
952 lines (951 loc) • 432 kB
TypeScript
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export interface paths {
"/postcodes/{postcode}": {
/**
* Returns the complete list of addresses for a postcode. Postcode searches are space and case insensitive.
*
* The Postcode Lookup API provides a JSON interface to search UK addresses from a postcode. It can be used to power Postcode Lookup driven address searches, like [Postcode Lookup](/postcode-lookup).
*
* ## Postcode Not Found
*
* Lookup balance is unaffected by invalid postcodes. The API returns a `404` response with response body:
*
* ```json
* {
* "code": 4040,
* "message": "Postcode not found",
* "suggestions": ["SW1A 0AA"]
* }
* ```
*
* ### Suggestions
*
* If a postcode cannot be found, the API will provide up to 5 closest matching postcodes. Common errors will be corrected first (e.g. mixing up `O` and `0` or `I` and `1`).
*
* If the suggestion list is small (fewer than 3), there is a high probability the correct postcode is there. You may notify the user or immediately trigger new searches.
*
* The suggestion list will be empty if the postcode has deviated too far from a valid postcode format.
*
* ## Multiple Residence
*
* A small number of postcodes will return more than 100 premises. These may require pagination. Use `page` to paginate the result set.
*/
get: operations["Postcodes"];
};
"/udprn/{udprn}": {
/**
* Returns an address as identified by its Unique Delivery Point Reference Number (UDPRN).
*
* You may find it useful to store UDPRN information as it can be used to retrieve the most recent information for an address. It can also be used to test for a deleted address.
*
* UDPRNs are an eight digit unique numeric code (e.g. `25962203`) for any premise on the Postcode Address File. It's essentially a unique identifier for every address in the UK that Royal Mail has in its database.
*
* ## Testing
*
* To test your implementation of our API we have a range of test UDPRNs that yield both successful and unsuccessful responses to your request.
*
* They are the following:
*
* - `0` Returns a successful UDPRN lookup response
* `2000`
* - `-1` Returns "UDPRN not found", error `4044`
* - `-2` Returns "no lookups remaining", error `4020`
* - `-3` Returns "daily (or individual) lookup limit breached",
* error `4021`
*
* Test request undergo the usual authentication and restriction rules. This is to help surface any issues that occur during implementation and does not cost you a lookup.
*/
get: operations["UDPRN"];
};
"/umprn/{umprn}": {
/**
* Returns a multiple occupancy address identified via its UMPRN (Multiple Residence Unique ID).
*
* UMPRNs are a unique numeric code for any Multiple Residence household on the optional Multiple Residence dataset.
*
* ## Testing
*
* To test your implementation of our API we have a range of test UMPRNs that yield both successful and unsuccessful responses to your request. They are the following
*
* - `0` Returns a successful UMPRN lookup response `2000`
* - `-1` Returns "UMPRN not found", error `4044`
* - `-2` Returns "no lookups remaining", error `4020`
* - `-3` Returns "daily (or individual) lookup limit breached", error `4021`
*
* Test request undergo the usual authentication and restriction rules. This is to help surface any issues that occur during implementation and does not cost you a lookup.
*
* ### Pricing
*
* Per lookup charges apply. Empty responses are not charged.
*/
get: operations["UMPRN"];
};
"/keys/{key}": {
/**
* Returns public information on your API Key.
*
* This endpoint can be used for the following:
* - Determine if the key is currently usable via the `available` property
* - Determine available contexts for an API Key
* - Identify the currently likely context of a user given their location
*
* You may pass both API Keys (beginning `ak_`) and Sub-licensed Keys (beginning `sl_`).
*/
get: operations["KeyAvailability"];
};
"/keys/{key}/details": {
/** Returns private data on the key including remaining lookups, available datasets and usage limits. */
get: operations["KeyDetails"];
/** Update API Key Details */
put: operations["UpdateKeyDetails"];
};
"/keys/{key}/usage": {
/**
* Reports the number of lookups consumed on a key for a range of days.
*
* A maximum interval of 90 days can be provided for analysis. If no start or end date is provided, the last 21 days will be used as the default interval.
*
* If no `start` time is provided, the start time will be set to 21 days prior to the current time.
*
* If no `end` time is provided, the current time will be used.
*
* Append `tags` to scope the number of lookups to those with matching tag values. E.g. `tags=foo,bar` will only count transactions that match `foo` and `bar`.
*/
get: operations["KeyUsage"];
};
"/keys/{key}/lookups": {
/**
* Reports lookup information on a key for paid lookups.
*
* This method requires a `user_token`, which can be found on your [accounts page](https://ideal-postcodes.co.uk/account).
*
* A maximum interval of 90 days can be provided for analysis. If no start or end date is provided, the last 21 days will be used as the default interval.
*
* ## Download Usage History (CSV)
*
* `GET /keys/:key/lookups`
*
* Returns a CSV download of lookups performed and associated information.
*
* Note that the Content-Type returned will be CSV (text/csv). For a non 200 response, the `Content-Type` will revert to JSON with the error code and message embedded.
*
* ## Data Redaction
*
* Personally Identifiable Data (PII) caught in this your usage log (including IP, search term and URL data) will be redacted on a weekly basis.
*
* By default, PII will be redacted if it is older than 21 days. This timeframe can be configured from your dashboard.
*
* You may prevent PII collection altogether by setting the interval to `0` days.
*/
get: operations["KeyLogs"];
};
"/cleanse/addresses": {
/**
* The address cleanse API attempts to return the closest matching address for any given address inputs. We also return a number of Match Level indicators that describe the degree to which the suggested address matches the input address. The more impaired the input address, the harder it is to cleanse.
*
* ## Confidence Score
*
* The confidence score is a number ranging between 0 and 1. Where 1 implies a full match and 0 implies no major elements completely match. Each incorrect, missing or misspelled element will subtract from the overall confidence score.
*
* ### Deciding on an Acceptable Confidence Score Threshold
*
* Different address cleanse projects can have radically different inputs. However, within each project, the inputs tend to repeat the same errors. For instance, some input datasets may be exclusively inputted manually and be prone to typos. Others may have a persistently missing datapoint such as organisation name or postcode. For this reason, it is important to understand that there is no absolute Confidence Score threshold. Instead, the acceptable confidence score must be determined on a project by project basis based on systematic errors present in the data and business goals.
*
* When determining an acceptable Confidence Score threshold you should load a subset of the dataset into a spreadsheet application like Excel and sort on the score. Scrolling from top-to-bottom you will be able to observe matches from best to worst. As you start to hit the lower quality searches, you will be able to roughly determine:
* - Which confidence scores indicate ambiguous matches (i.e. up to building level only)
* - Which confidence scores indicate a poor or no match (i.e. the nearest matching address is too far from the input address)
*
* Depending on your business goals, you can also use the Match Levels to determine an acceptable match. For instance, do you need to match up to the thoroughfare or building name only? Are accurate organisation names an important feature?
*/
post: operations["AddressCleanse"];
};
"/verify/addresses": {
/**
* The address verify API validates, corrects, and standardizes individual addresses based on USPS's Coding Accuracy Support System (CASS).
*
* The address verify API accepts the 3 combination of inputs:
*
* - Free-form address submitted as a single string in `query`
* - Example: "123 Main St, Springfield, CO 81073-1119"
* - Only free-form and zip code address components submitted as separate parameters:
* - `query` for the first address line
* - `zip_code` for the ZIP code
* - Example:
* - `query`: "123 Main St, Springfield CO"
* - `zip_code`: "81073-1119"
* - Only free-form, city and state address components submitted as separate parameters:
* - `query` for the first address line
* - `city` for the city
* - `state` for the state
* - Example:
* - `query`: "123 Main St"
* - `city`: "Springfield"
* - `state`: "CO"
*/
post: operations["AddressVerify"];
};
"/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:
*
* 1. Fetch address suggestions with `/autocomplete/addresses`
* 2. 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.
*/
get: operations["FindAddress"];
};
"/autocomplete/addresses/{address}/gbr": {
/**
* Resolves an address autocompletion by its address ID.
*
* Resolved addresses (including global addresses) are returned in a UK format (up to 3 address lines) using UK nomenclature (like postcode and county).
*/
get: operations["ResolveAddress"];
};
"/autocomplete/addresses/{address}/usa": {
/**
* Resolves an address autocompletion by its address ID.
*
* Resolved addresses (including global addresses) are returned in a US format (up to 2 address lines) using US nomenclature (like zipcode, state and city).
*/
get: operations["RetrieveAddress"];
};
"/addresses": {
/**
* Extract a list of complete addresses that match the query ordered by relevance score. This query accepts an optional limit and page query (defaults to 10 and 0 respectively).
*
* If a valid postcode is passed as the query string, the entire address list for that postcode is passed as a result. Note, in these cases, limit and page parameters are ignored.
*
* This API is designed as a multi-purpose tool for generating address lists, cleansing and wholesale data extraction according to specific parameters.
*
* For address autocomplete, see our address finder API - which is designed for speed and address completion.
*
* ## Reverse Geocoding
*
* Return a list of addresses around a point using the lon= and lat= querystring arguments. Addresses will be sorted in order of distance to the point. The search radius is 100m.
*
* ## Filters
*
* You can strictly narrow your result by adding filters to your query string which correspond with an address attribute.
*
* For instance, you can restrict to postcode `SW1A 2AA` by appending `postcode=sw1a2aa`.
*
* If a filter term is invalid, e.g. `postcode=SW1A2AAA`, then an empty result set is returned and no lookup is incurred.
*
* You can also scope using multiple terms for the same filter with a comma separated list of terms. E.g. Restrict results to E1, E2 and E3 outward codes: `postcode_outward=e1,e2,e3`. Multiple terms are `OR`'ed, i.e. the matching result sets are combined.
*
* All filters can accept multiple terms unless stated otherwise below.
*
* Multiple filters can also be combined. E.g. Restrict results to small user organisations in the N postcode area: `su_organisation_indicator=Y&postcode_area=n`. Multiple filters are `AND`'ed, i.e. each additional filter narrows the result set.
*
* A combined maximum of 5 terms are allowed across all filters.
*
* ## Biases
*
* You can boost certain addresses results that correspond with a certain address attribute. All bias searches are prefixed with `bias_`.
*
* Biased searches, unlike filtered searches, also allow unmatched addresses to appear . These will rank lower.
*
* For instance, you can boost addresses with postcode areas `SW` and `SE` by appending `bias_postcode_area=SW,SE`.
*
* If a bias term is invalid, e.g. `bias_postcode=SW1A2AAA` no bias effect is applied.
*
* You may scope using multiple terms for the same bias with a comma separated list of terms. E.g. Restrict results to `E1`, `E2` and `E3` outward codes: `bias_postcode_outward=e1,e2,e3`.
*
* All biases can accept multiple terms unless stated otherwise below.
*
* A combined maximum of 5 terms are allowed across all biases.
*
* ## Search by Postcode and Building Name or Number
*
* Search by postcode and building attribute with the postcode filter and query argument. E.g. For "SW1A 2AA Prime Minister" `/v1/addresses?postcode=sw1a2aa&q=prime minister`.
*
* The advantage of using filters is a postcode mismatch does not result in a lookup as no results are returned.
*
* #### Search By UPRN
*
* Search by UPRN using the `uprn` filter and excluding the query argument. E.g. `/v1/addresses?uprn=100`.
*
* ## Testing
*
* - **ID1 1QD** Returns a successful query response `2000`
* - **ID1 KFA** Returns an empty query response `2000`
* - **ID1 CLIP** Returns "no lookups remaining" error `4020`
* - **ID1 CHOP** Returns "daily (or individual) lookup limit breached" error `4021`
*
* Test request undergo the usual authentication and restriction rules. This is to help surface any issues that occur during implementation and does not cost you a lookup.
*/
get: operations["Addresses"];
};
"/places": {
/**
* Query for geographical places across countries. Each query will return a list of place suggestions, which consists of a place name, descriptive name and id.
*
* This API returns geographical information such as countries, capitals, administrative areas and more. It is ideal for correctly identifying a place along with any other details like geolocation.
*
* ## Implementing Place Autocomplete
*
* Extracting the full information of a place is a 2 step process:
*
* 1. Retrieve place suggestions via /places
* 2. Retrieve the entire place with the ID provided in the suggestion
*
* ## Suggestion Format
*
* Each place suggestion contains a descriptive name which you can provide to users to uniquely identify a place.
*
* ## 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.
*/
get: operations["FindPlace"];
};
"/places/{place}": {
/** Resolves a place autocompletion by its place ID. */
get: operations["ResolvePlace"];
};
"/keys/{key}/licensees": {
/** Returns a list of licensees for a key. */
get: operations["ListLicensees"];
/** Create a licensee for the specified API Key. */
post: operations["CreateLicensee"];
};
"/keys/{key}/licensees/{licensee}": {
/** Returns licensee information as identified by the licensee key. */
get: operations["RetrieveLicensee"];
/** Update Licensee */
put: operations["UpdateLicensee"];
/** Cancels a licensee key. This renders a licensee unusable. This action can be reversed if you get in contact with us. */
delete: operations["DeleteLicensee"];
};
"/keys/{key}/configs": {
/** Lists configurations associated with a key */
get: operations["ListConfigs"];
/** Create a configuration */
post: operations["CreateConfig"];
};
"/keys/{key}/configs/{config}": {
/** Retrieve configuration object by name */
get: operations["RetrieveConfig"];
/** Updates configuration object */
post: operations["UpdateConfig"];
/** Permanently deletes a configuration object. */
delete: operations["DeleteConfig"];
};
"/emails": {
/** Query for and validate email addresses. */
get: operations["EmailValidation"];
};
"/phone_numbers": {
/** Query for and validate phone numbers. */
get: operations["PhoneNumberValidation"];
};
}
export interface components {
schemas: {
ecaf: components["schemas"]["EcafAddress"];
ecad: components["schemas"]["EcadAddress"];
geonames: components["schemas"]["GeonamesPlace"];
here: components["schemas"]["HereAddress"];
/**
* ID
* @description Global unique internally generated identifier for an address
* @example paf_8387729
*/
ID: string;
/**
* Dataset
* @description Indicates the provenance of an address
*/
paf_dataset: string;
/**
* ISO Country Code (3)
* @description 3 letter country code (ISO 3166-1)
*/
paf_country_iso: string;
/**
* ISO Country Code (2)
* @description 2 letter country code (ISO 3166-1)
*/
paf_country_iso_2: string;
/**
* Country
* @description Full country names (ISO 3166)
*
* @example England
*/
paf_country: string;
/**
* Language
* @description Language represented by 2 letter ISO Code (639-1)
*/
paf_language: string;
/**
* Line 1
* @description First Address Line. Often contains premise and thoroughfare information. In the case of a commercial premise, the first line is always the full name of the registered organisation. Never empty.
* @example Prime Minister & First Lord of Treasury
*/
paf_line1: string;
/**
* Line 2
* @description Second Address Line. Often contains thoroughfare and locality information. May be empty
* @example 10 Downing Street
*/
paf_line2: string;
/**
* Line 3
* @description Third address line. May be empty.
* @example
*/
paf_line3: string;
/**
* @description **Filter by Town or City"
* A Post Town is mandatory for delivery of mail to a Delivery Point. This is not necessarily the nearest town geographically, but a routing instruction to the Royal Mail delivery office sorting mail for that Delivery Point. A Post Town will always be present in every address, and for some Localities the Post Town will be the only locality element present.
*
* @example London
*/
paf_post_town: string;
/**
* Postcode
* @description Correctly formatted postcode. Capitalised and spaced.
* @example SW1A 2AA
*/
paf_postcode: string;
/**
* County
* @description Since postal, administrative or traditional counties may not apply to some addresses, the county field is designed to return whatever county data is available. Normally, the postal county is returned. If this is not present, the county field will fall back to the administrative county. If the administrative county is also not present, the county field will fall back to the traditional county. May be empty in cases where no administrative, postal or traditional county present.
* @example London
*/
paf_county: string;
/**
* Unique Property Reference Number
* @description UPRN stands for Unique Property Reference Number and is maintained by the Ordnance Survey (OS). Local governments in the UK have allocated a unique number for each land or property.
*
* Up to 12 digits in length.
*
* Multiple Residence premises currently share the same UPRN as the parent premise.
*
* May not be available for a small number of Great Britain addresses due to longer update cycles for Ordnance Survey's AddressBase datasets. Returns empty string "" in these instances.
*
* Although UPRN takes an integer format, we encode and transmit this data as strings. As a 12 digit number, the UPRN can exceed the maximum safe integer `Number.MAX_SAFE_INTEGER` in most browsers causing this datapoint to be corrupted.
*
* Take special care when storing UPRN. As a 12 digit identifier, you will need 64 bits to encode every possible UPRN value. This means applications like Excel will corrupt cells containing UPRN values.
*/
paf_uprn: string;
/**
* Unique Delivery Point Reference Number (UDPRN)
* Format: int32
* @description 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.
* @example 23747771
*/
paf_udprn: number;
/**
* UMPRN
* @description A small minority of individual premises (as identified by a UDPRN) may have multiple occupants behind the same letterbox. These are known as Multiple Residence occupants and can be queried via the Multiple Residence dataset. Simple, unique reference number for each Multiple Residence occupant.
*
* Note: this will be an empty string `""` when not used.
*/
paf_umprn: string | number;
/**
* Postcode Outward
* @description The first part of a postcode is known as the outward code. e.g. The outward code of ID1 1QD is ID1. Enables mail to be sorted to the correct local area for delivery. This part of the code contains the area and the district to which the mail is to be delivered, e.g. ‘PO1’, ‘SW1A’ or ‘B23’.
* @example SW1A
*/
paf_postcode_outward: string;
/**
* Postcode Inward
* @description The second part of a postcode is known as the inward code. e.g. The inward code of ID1 1QD is 1QD.
*
* The number identifies the sector in the postal district. The number is followed by 2 letters. The letters then define one or more properties in that sector.
* @example 2AA
*/
paf_postcode_inward: string;
/**
* Dependant Locality
* @description When the same thoroughfare name reoccurs in a Post town, it may not be possible to make it dependant on a dependant thoroughfare. In this case the thoroughfare is dependant on a locality. For example if we want to find 1 Back Lane in Huddersfield we see that there are three.
* @example
*/
paf_dependant_locality: string;
/**
* Double Dependant Locality
* @description Used to supplement Dependant Locality. A Double Dependant Locality supplied along with a Dependant Locality if the Dependant Locality exists twice in the same locality.
* @example
*/
paf_double_dependant_locality: string;
/**
* Thoroughfare
* @description Also known as the street or road name. In general each Thoroughfare Name will have a separate Postcode. Longer Thoroughfares with high number ranges often have multiple Postcodes covering the entire length of the road, with breaks at suitable points e.g. junctions or natural breaks in the road.
* @example Downing Street
*/
paf_thoroughfare: string;
/**
* Dependant Thoroughfare
* @description Used to supplement thoroughfare. When a thoroughfare name is used twice in the same Post Town, the dependant thoroughfare is added to uniquely indentify a delivery point.
* @example
*/
paf_dependant_thoroughfare: string;
/**
* Building Number
* @description Number to identify premise on a thoroughfare or dependant thoroughfare.
* @example 10
*/
paf_building_number: string;
/**
* Building Name
* @description Name of residential or commercial premise.
*
* Examples:
* - The Manor
* - 1-2
* - A
* - 12A
* - K
* - Victoria House
* @example
*/
paf_building_name: string;
/**
* Sub-Building Name
* @description When a premise is split into individual units such as flats, apartments or business units. Cannot be present without either building_name or building_number. E.g. Flat 1, A, 10B
* @example Flat 1
*/
paf_sub_building_name: string;
/**
* PO Box
* @description When the PO Box Number field is populated it will contain PO BOX nnnnnn where n represents the PO Box number. Note that the PO Box details can occasionally consist of a combination of numbers and letters. PO Box Numbers are only allocated to Large Users.
* @example 100
*/
paf_pobox: string;
/**
* Department Name
* @description Used to supplment Organisation Name to identify a deparment within the organisation.
* @example
*/
paf_department_name: string;
/**
* Organisation Name
* @description Used to supplment Organisation Name to identify a deparment within the organisation
* @example Prime Minister & First Lord Of The Treasury
*/
paf_organisation_name: string;
/**
* Postcode Type
* @description This indicates the type of user. It can only take the values 'S' or 'L' indicating small or large respectively. Large User Postcodes. These are assigned to one single address either due to the large volume of mail received at that address, or because a PO Box or Selectapost service has been set up. Small User Postcodes. These identify a group of Delivery Points.
*
* On average there are 19 Delivery Points per Postcode. However this can vary between 1 and, in some cases, 100. There will never be more than 100 Delivery Points on a Postcode.
* @enum {undefined}
*/
paf_postcode_type: "S" | "L" | "";
/**
* Small User Organisation Indicator
* @description Small User Organisation Indicator can have the values 'Y' or space. A value of 'Y' indicates that a Small User Organisation is present at this address.
* @example Y
*/
paf_su_organisation_indicator: string;
/**
* Delivery Point Suffix
* @description A unique Royal Mail 2-character code (the first numeric & the second alphabetical), which, when added to the Postcode, enables each live Delivery Point to be uniquely identified. Once the Delivery Point is deleted from PAF the DPS may be reused (although they aren’t reused until all remaining Delivery Points in the range have been allocated). The DPS for a Large User is always '1A' as each Large User has its own Postcode.
* @example 1A
*/
paf_delivery_point_suffix: string;
/**
* Premise
* @description A pre-computed string which sensibly combines building_number, building_name and sub_building_name. building_number, building_name and sub_building_name represent raw data from Royal Mail's and can be difficult to parse if you are unaware of how the Postcode Address File premise fields work together. For this reason, we also provide a pre-computed premise field which intelligently gathers these points into a single, simple premise string. This field is ideal if you want to pull premise information and thoroughfare information separately instead of using our address lines data.
* @example 10
*/
paf_premise: string;
/**
* Administrative County
* @description The current administrative county to which the postcode has been assigned.
*
* A Unitary Authority name, where one is present. If there is no Unitary Authority, the County name is used. This information is not static, because County boundaries may change due to administrative changes. Data
*
* source: ONS
* @example
*/
paf_administrative_county: string;
/**
* Postal County
* @description Postal counties were used for the distribution of mail before the Postcode system was introduced in the 1970s. The Former Postal County was the Administrative County at the time. This data rarely changes. May be empty.
* @example London
*/
paf_postal_county: string;
/**
* Traditional County
* @description Traditional counties are provided by the Association of British Counties. It is historical data, and can date from the 1800s. May be empty.
* @example Greater London
*/
paf_traditional_county: string;
/**
* District
* @description The current district/unitary authority to which the postcode has been assigned.
* @example Westminster
*/
paf_district: string;
/**
* Ward
* @description The current administrative/electoral area to which the postcode has been assigned. May be empty for a small number of addresses.
* @example St. James'
*/
paf_ward: string;
/**
* Longitude
* @description The longitude of the postcode (WGS84/ETRS89).
*
* Can be a positive or negative decimal. E.g. -0.1283983
*
* Returns an empty string if no location data is available.
*/
Longitude: string | number;
/**
* Longitude
* @description The latitude of the postcode (WGS84/ETRS89).
*
* Can be a positive or negative decimal. E.g. `51.5083983`.
*
* Returns an empty string if no location data is available.
*/
Latitude: string | number;
/**
* Eastings
* @description Eastings reference using the [Ordnance Survey National Grid reference system](https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid).
*
* Northern Ireland Eastings uses the [Irish Grid Reference System](https://en.wikipedia.org/wiki/Irish_grid_reference_system).
*
* Metres from origin. E.g. `550458`
*
* Returns an empty string if no location data is available. Otherwise a number is returned.
*/
Eastings: string | number;
/**
* Northings
* @description Northings reference using the [Ordnance Survey National Grid reference system](https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid)
*
* Northern Ireland Northings uses the [Irish Grid Reference System](https://en.wikipedia.org/wiki/Irish_grid_reference_system)
*
* Metres from origin. E.g. `180458`
*
* Returns an empty string if no location data is available. Otherwise a number is returned
*/
Northings: string | number;
PafBase: {
id: components["schemas"]["ID"];
dataset: components["schemas"]["paf_dataset"];
country_iso: components["schemas"]["paf_country_iso"];
country_iso_2: components["schemas"]["paf_country_iso_2"];
country: components["schemas"]["paf_country"];
language: components["schemas"]["paf_language"];
line_1: components["schemas"]["paf_line1"];
line_2: components["schemas"]["paf_line2"];
line_3: components["schemas"]["paf_line3"];
post_town: components["schemas"]["paf_post_town"];
postcode: components["schemas"]["paf_postcode"];
county: components["schemas"]["paf_county"];
/**
* County Code
* @description Short code representing the county or province. May be empty (`""`)
* @example
*/
county_code: string;
uprn: components["schemas"]["paf_uprn"];
udprn: components["schemas"]["paf_udprn"];
umprn: components["schemas"]["paf_umprn"];
postcode_outward: components["schemas"]["paf_postcode_outward"];
postcode_inward: components["schemas"]["paf_postcode_inward"];
dependant_locality: components["schemas"]["paf_dependant_locality"];
double_dependant_locality: components["schemas"]["paf_double_dependant_locality"];
thoroughfare: components["schemas"]["paf_thoroughfare"];
dependant_thoroughfare: components["schemas"]["paf_dependant_thoroughfare"];
building_number: components["schemas"]["paf_building_number"];
building_name: components["schemas"]["paf_building_name"];
sub_building_name: components["schemas"]["paf_sub_building_name"];
po_box: components["schemas"]["paf_pobox"];
department_name: components["schemas"]["paf_department_name"];
organisation_name: components["schemas"]["paf_organisation_name"];
postcode_type: components["schemas"]["paf_postcode_type"];
su_organisation_indicator: components["schemas"]["paf_su_organisation_indicator"];
delivery_point_suffix: components["schemas"]["paf_delivery_point_suffix"];
premise: components["schemas"]["paf_premise"];
administrative_county: components["schemas"]["paf_administrative_county"];
postal_county: components["schemas"]["paf_postal_county"];
traditional_county: components["schemas"]["paf_traditional_county"];
district: components["schemas"]["paf_district"];
ward: components["schemas"]["paf_ward"];
longitude: components["schemas"]["Longitude"];
latitude: components["schemas"]["Latitude"];
eastings: components["schemas"]["Eastings"];
northings: components["schemas"]["Northings"];
};
/**
* Postcode Address File Address
* @description Standard UK Address. Also known as a Postcode Address File (PAF) address is defined by Royal Mail and updated on a daily cadence.
*
* A PAF Address represents a deliverable endpoint.
*/
PafAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
country_iso?: "GBR" | "IMN" | "JEY" | "GGY";
/** @enum {string} */
dataset?: "paf";
/** @enum {undefined} */
country_iso_2?: "GB" | "IM" | "JE" | "GG";
/** @enum {undefined} */
language?: "en";
/** @enum {undefined} */
country?: "England" | "Scotland" | "Wales" | "Northern Ireland" | "Jersey" | "Guernsey" | "Isle of Man";
};
/**
* Multiple Residence Address
* @description Subdivision of a Postcode Address File address. Also known as a Multiple Residence or Multiple Occupancy address.
*
* A Multiple Residence address does not have its own deliverable endpoint. Instead it relies on the deliverable endpoint of a parent address, where the parent address can be found on the main Postcode Address File.
*/
MrAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
dataset?: "mr";
/** @enum {undefined} */
country_iso?: "GBR" | "IMN" | "JEY" | "GGY";
/** @enum {undefined} */
country_iso_2?: "GB" | "IM" | "JE" | "GG";
/** @enum {undefined} */
language?: "en";
/** @enum {undefined} */
country?: "England" | "Scotland" | "Wales" | "Northern Ireland" | "Jersey" | "Guernsey" | "Isle of Man";
};
/**
* Not Yet Built Address
* @description A UK premise under construction and currently not occupied.
*
* This dataset is updated by Royal Mail on a monthly cadence.
*/
NybAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
dataset?: "nyb";
/** @enum {undefined} */
country_iso?: "GBR" | "IMN" | "JEY" | "GGY";
/** @enum {undefined} */
country_iso_2?: "GB" | "IM" | "JE" | "GG";
/** @enum {undefined} */
language?: "en";
/** @enum {undefined} */
country?: "England" | "Scotland" | "Wales" | "Northern Ireland" | "Jersey" | "Guernsey" | "Isle of Man";
};
/**
* PAF Alias Address
* @description PAF Aliases addresses are alternate ways to present an address already found on PAF.
*
* Alias data is information the public chooses to use when addressing mail, but which isn’t actually required for delivery purposes. The Alias data contains records of alternative address details that are included in the address but not necessarily needed for delivery purposes.
*/
PafAliasAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
dataset?: "pafa";
/** @enum {undefined} */
country_iso?: "GBR" | "IMN" | "JEY" | "GGY";
/** @enum {undefined} */
country_iso_2?: "GB" | "IM" | "JE" | "GG";
/** @enum {undefined} */
language?: "en";
/** @enum {undefined} */
country?: "England" | "Scotland" | "Wales" | "Northern Ireland" | "Jersey" | "Guernsey" | "Isle of Man";
};
/**
* Welsh PAF Address
* @description Welsh language alternative for a PAF Address
*/
WelshPafAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
dataset?: "pafw";
/** @enum {undefined} */
country_iso?: "GBR";
/** @enum {undefined} */
country_iso_2?: "GB";
/** @enum {undefined} */
language?: "cy";
/** @enum {undefined} */
country?: "Wales";
};
/**
* Language
* @description Language represented by 2 letter ISO Code (639-1)
*
* @enum {string}
*/
Language: "en" | "ar" | "as" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cs" | "cy" | "da" | "de" | "el" | "es" | "et" | "eu" | "fi" | "fo" | "fr" | "ga" | "gl" | "gn" | "he" | "hi" | "hr" | "hu" | "hy" | "id" | "is" | "it" | "ja" | "ka" | "kk" | "km" | "kn" | "ko" | "lt" | "lv" | "mk" | "mn" | "ms" | "mt" | "my" | "nl" | "no" | "pl" | "pt" | "ro" | "ru" | "sk" | "sl" | "sq" | "sr" | "sv" | "ta" | "th" | "tr" | "uk" | "uz" | "vi" | "wa" | "zh";
/**
* AddressBase Core
* @description Represents a GB address in Ordnance Survey's AddressBase Core dataset
*/
AddressBaseCore: {
id: components["schemas"]["ID"];
/**
* Dataset
* @description Indicates the provenance of an address
* @enum {string}
*/
dataset: "ab";
language: components["schemas"]["Language"];
line_1: components["schemas"]["paf_line1"];
line_2: components["schemas"]["paf_line2"];
line_3: components["schemas"]["paf_line3"];
premise: components["schemas"]["paf_premise"];
/**
* UPRN
* @description Unique Property Reference Number (UPRN) assigned by the LLPG Custodian or Ordnance Survey.
*/
uprn: string;
/**
* UDPRN
* @description Royal Mail's Unique Delivery Point Reference Number (UDPRN).
*/
udprn: number;
/**
* PARENT_UPRN
* @description UPRN of the parent Record if a parent-child relationship exists.
*/
parent_uprn: string;
/**
* USRN
* @description Unique Street Reference Number assigned by the Street Name and Numbering Custodian OR
*
* Ordnance Survey depending on the address record.
*/
usrn: number;
/**
* TOID
* @description The Topographic Identifier taken from OS MasterMap Topography Layer. This TOID is assigned to the UPRN by performing a spatial intersection between the two identifiers. It consists of the letters 'osgb' and is followed by up to sixteen digits.
*/
toid: string;
/**
* Classification Code
* @description A code that describes the classification of the address record to a maximum of a secondary level.
*/
classification_code: string;
/**
* Easting
* @description A value in metres defining the x location in accordance with the British National Grid.
*/
eastings: number;
/**
* Northing
* @description A value in metres defining the y location in accordance with the British National Grid.
*/
northings: number;
/**
* Latitude
* @description A value in metres defining the y location in accordance with the British National Grid.
*/
latitude: number;
/**
* Longitude
* @description A value defining the Longitude location in accordance with the ETRS89 coordinate reference system.
*/
longitude: number;
/**
* Single Line Address
* @description A single attribute containing text concatenation of the address elements separated by a comma.
*/
single_address_line: string;
/**
* Single Line Address
* @description Street / Road name for the address record.
*/
street_name: string;
/**
* Locality
* @description A locality defines an area or geographical identifier within a town, village or hamlet. Locality represents the lower level geographical area. The locality field should be used in conjunction with the town name and street description fields to uniquely identify geographic area where there may be more than one within an administrative area.
*/
locality: string;
/**
* Town Name
* @description Geographical town name assigned by the Local Authority. Please note this can be different from the Post Town value assigned by Royal Mail.
*/
town_name: string;
/**
* Delivery Point Suffix
* @description A two-character code uniquely identifying an individual delivery point within a postcode, assigned by Royal Mail.
*/
delivery_point_suffix: string;
/**
* Town Name
* @description The town or city in which the Royal Mail sorting office is located which services this address record.
*
* Condition:
* POST_TOWN is not populated if this is the same as TOWN_NAME.
*/
post_town: string;
/**
* Governmental Statistical Service
* @description The Office for National Statistics Governmental Statistical Service (GSS) code representing the contributing Local Authority.
*/
gss_code: string;
/**
* Representative Point Code
* @description Representative Point Code describes the accuracy of the coordinate that has been allocated to the UPRN as indicated by the Local Authority and enhanced using large scale OS data.
*/
rpc: number;
/**
* Last Update Date
* Format: date
* @description The latest date on which any of the attributes on this record were last changed.
*/
last_update_date: string;
/**
* Island
* @description Third level of geographic area name to record island names where appropriate.
*/
island: string;
/**
* Change Code
* @description This enumeration is used in association with the attribute “CHANGE_CODE”. This enumeration identifies the type of change that has been made to a feature. The change type must be set when a feature is inserted, updated or deleted. Please see section 3 for more information. Example I = Insert, U = Update, D = Delete
* @enum {string}
*/
change_code: "I" | "U" | "D";
/**
* Building Name
* @description The building name is a description applied to a single address or a group of addresses.
*/
building_name: string;