← Back to API Ninjas
Get postal code information
Returns details for a Canadian postal code, given as A1A1A1 or A1A 1A1, or searches by `city` and `province`.
API Ninjas·$0.001 per call
Example code
// Using @orth/sdk - The simplest way to call APIs
// Install: npm install @orth/sdk
import Orthogonal from "@orth/sdk";
const orthogonal = new Orthogonal({
apiKey: process.env.ORTHOGONAL_API_KEY,
});
const output = await orthogonal.run({
api: "api-ninjas",
path: "/v1/postalcode"
});
console.log(output);Query parameters
postal_code
string
The postal code to look up. Accepts Canadian postal codes in 6 characters (A1A1A1) or 7 characters with a space (A1A 1A1). The space will be automatically normalized if not provided.
city
string
Full name of the city to search (case-sensitive).
province
string
2-letter abbreviation of the province (e.g., ON, BC, QC).