# getCityByPostalCode

Source: https://pakdatakit.dev/api/typescript/postal/functions/getcitybypostalcode/

```ts
function getCityByPostalCode(postalCode): string | null;
```

Defined in: [postal.ts:48](https://github.com/chmuzamil/pakdatakit/blob/a6eeaa47381308c4e4fcda45b29642fe4fbfb1fc/src/postal.ts#L48)

Returns the city for a Pakistani postal code.

Only codes of post offices in a city on pakdatakit's city list return a
city (`54660` → `Lahore`). The code of a post office in a town or village
that is not on the list returns `null`; use `getPostOffice` for those.

## Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `postalCode` | `string` | Postal code to look up (whitespace is ignored) |

## Returns

`string` \| `null`

City name or `null` if not found
