Skip to content
Peachtree Data

← All API documentation

API Documentation

Canadian Address Cleanse.

Validate and standardize a Canadian address in real time. The response tells you whether the address is deliverable, which fields were corrected, and parses the address into individual fields — including the FSA and LDU portions of the postal code.

Endpoint
https://rapid.peachtreedata.com/api/v1/canadianaddresscleanse
Methods
GET for a single address · POST for a batch
Formats
JSON by default; append .xml for XML

Authentication

Every request carries your API key in the query string. The API is HTTPS-only, so the key is encrypted in transit. Query parameters can appear in any order, and responses are JSON by default — append .xml to the endpoint for XML.

https://rapid.peachtreedata.com/api/v1/canadianaddresscleanse?apikey={apikey}&…

Don't have a key? Sign up under plans & pricing below — keys work immediately.

Request

Pass the address in one of two shapes — never both in the same request. Use the standard format when your data is already split into fields; use the multiline format when addresses arrive free-form.

Standard Canadian format

ParameterRequiredDescription
apikeyYesYour unique API key.
address1Street address portion. Example: 111 Main St.
address2Secondary address, usually the suite or apartment number. Example: Suite 200.
cityCity name. Don't combine with lastline. Example: Port Hope.
provinceThe province. Don't combine with lastline. Example: ON.
postalcodeThe postal code. Don't combine with lastline. Example: L1A 3G3.
lastlineUse when city, province, and postal code arrive as one line. Example: Port Hope, ON L1A 3G3.

Multiline format

ParameterRequiredDescription
apikeyYesYour unique API key.
line1 … line8The address exactly as you have it, one field per line, up to eight lines. The cleanse works out which line is which.

Multiline requests need at least two address lines.

Examples

Single address (GET)
curl "https://rapid.peachtreedata.com/api/v1/canadianaddresscleanse?apikey={apikey}\
&address1=111+Main+St\
&city=Port+Hope&province=ON&postalcode=L1A+3G3"
Batch (POST) — one JSON array, same fields per address
POST https://rapid.peachtreedata.com/api/v1/canadianaddresscleanse?apikey={apikey}
Content-Type: application/json

[
  {
    "address1": "111 Main St",
    "city": "Port Hope",
    "province": "ON",
    "postalCode": "L1A 3G3"
  },
  { "...": "up to your plan's max addresses per request" }
]
Multiline (GET)
curl "https://rapid.peachtreedata.com/api/v1/canadianaddresscleanse?apikey={apikey}\
&line1=111+Main+St\
&line2=Port+Hope%2C+ON+L1A+3G3"
Response shape (GET) — POST wraps these in a totals envelope, like the US cleanse
{
  "status": "",
  "statusMessage": "",
  "rawDetailCode": "",
  "requestId": "",
  "fullAddress": "",
  "primaryAddress": "",
  "secondaryAddress": "",
  "lastLine": "",
  "components": { "…": "see the components table" },
  "metadata": { "…": "see the metadata table" }
}

Response reference

Root fields

FieldTypeDescription
statusString(36)Result of the cleanse: Valid or Invalid.
statusMessageStringWhen status is Invalid, the descriptive message.
rawDetailCodeString(6)Positional processing code, same idea as the US cleanse — see quality codes below for the friendlier signal.
requestIdString(50)Echo of the requestId you sent, unchanged.
fullAddressString(256)Single-line address containing the primary and secondary address.
primaryAddressString(256)Primary address line — street address or post office box, without secondary information.
secondaryAddressString(64)Building name, floor, and room number in one field.
lastLineString(176)City, province, and postal code.
componentsParsed address pieces — see the components table.
metadataDelivery details — see the metadata table.

components

FieldTypeDescription
cityString(128)City preferred by the postal authority.
city13String(13)Abbreviated city preferred by the postal authority.
postalCodeString(20)Full postal code, containing the FSA and LDU.
postalCodeFsaString(10)The FSA (forward sortation area) portion of the postal code — the first three characters.
postalCodeLduString(5)The LDU (local delivery unit) portion of the postal code — the last three characters.
primaryNumberString(64)The premise number.
primaryPrefixString(40)Abbreviated directional (N, S, NW, SE…) before the street name.
primaryNameString(128)Street name.
primaryTypeString(40)Abbreviated street type — St, Ave, Pl.
primaryPostfixString(40)Abbreviated directional (N, S, NW, SE…) after the street name.
provinceString(128)Province abbreviation.
secondaryUnitDescriptionString(20)Unit description — #, Apartment, Flat.
secondaryUnitNumberString(12)Unit number — the 100 in “APT 100”.
remainderFullString(256)All remainder information in one field.
extraLine1String(128)Non-address data found above or below the address. Multiline input only.
extraLine2String(128)Non-address data found above or below the address. Multiline input only.

metadata

FieldTypeDescription
addressTypeString(25)Type of address.
  • Street standard street address
  • HighRise multi-unit building
  • BuildingName identified by building name
  • Firm business with its own record
  • Postal postal box
  • Rural rural address
  • StreetServedByRoute street address served by a route
  • GeneralDelivery general delivery
  • Military military address
  • Unknown couldn't be classified
deliveryInstallationNameString(30)The delivery installation city name — usually the same as the city and omitted from the address line. When it differs from the locality name, it's output to the secondary address fields.
deliveryInstallationTypeString(30)The delivery installation type.
  • PostOffice post office
  • RetailPostOutlet retail post outlet
  • Station station
  • LetterCarrierDepot letter carrier depot
  • CommunityMailCenter community mail center
  • CommercialDealershipOutlet commercial dealership outlet
qualityCodeString(2)Two-character code describing the quality of the address — see the quality codes section below.

Quality codes

The qualityCode field grades how confidently the address validated.

CodeDescription
Q1Perfect address on input. Every component validated without corrections.
Q2Corrected address. Every component validated after corrections were made.
Q3Not fully validated — insufficient information to make a final correction, but a high likelihood the address is deliverable.
Q4Not fully validated — a fair likelihood the address is deliverable.
Q5Not fully validated — a small likelihood the address is deliverable.
Q6Not fully validated — highly unlikely the address is deliverable.

HTTP response codes

CodeDescription
200Processed successfully.
400Bad request — the API key format is invalid, the key is missing, or the input wasn't properly passed.
401Unauthorized — the API key is inactive or invalid.
403Forbidden — the request exceeds the max items allowed per call, or the account isn't set up for this service.
408Request timeout — processing exceeded the max processing time.
500Internal server error during processing.

Plans & pricing

Canadian Address Cleanse is included in the Address Validation subscription — one plan covers this service, US Address Cleanse, and ZIP Code Information, all sharing the same API key and monthly pool of lookups.

Free

250 lookups per month

Hard limit of 250 lookups per month — perfect for evaluating.

Sign up

$30/mo

1,000 lookups per month

$0.03 per lookup above 1,000 in a month.

Sign up

$100/mo

10,000 lookups per month

$0.01 per lookup above 10,000 in a month.

Sign up

$400/mo

50,000 lookups per month

$0.008 per lookup above 50,000 in a month.

Sign up

$600/mo

100,000 lookups per month

$0.006 per lookup above 100,000 in a month.

Sign up

$1,250/mo

250,000 lookups per month

$0.005 per lookup above 250,000 in a month.

Sign up

Above 250,000 lookups a month, or if you'd rather be invoiced, talk to us — we'll set up a plan that fits.

Validating Canadian addresses?

Tell us what you're building and we'll get you moving — usually the same day.