# @ideal-postcodes/core-axios

> Axios based client for api.ideal-postcodes.co.uk

Latest version **4.1.10** (published 2026-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ideal-postcodes/core-axios
pnpm add @ideal-postcodes/core-axios
yarn add @ideal-postcodes/core-axios
bun add @ideal-postcodes/core-axios
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.1.10 |
| Published | 2026-10-12 |
| First published | 2020-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10.0 |
| Dependencies | 2 |
| Unpacked size | 19.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | Ideal Postcodes |
| Maintainers | cablanchard, piotrideal |
| Keywords | API, Node.js, Axios, UK, Address, Postcode, Search, Ideal Postcodes |

## Links

- npm: https://www.npmjs.com/package/@ideal-postcodes/core-axios
- Repository: https://github.com/ideal-postcodes/core-axios
- Issues: https://github.com/ideal-postcodes/core-axios/issues
- npm.io page: https://npm.io/package/@ideal-postcodes/core-axios

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ~1.20.0
- [@ideal-postcodes/core-interface](https://npm.io/package/@ideal-postcodes/core-interface.md) ~3.2.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 4.1.10 (latest) — 2026-10-12
- 4.0.0-beta.1 (beta) — 2022-02-03
- 4.1.9 — 2026-07-27
- 4.1.8 — 2026-05-11
- 4.1.7 — 2026-03-09
- 4.1.6 — 2025-09-15
- 4.1.5 — 2025-03-24
- 4.1.3 — 2024-08-16
- 4.1.2 — 2023-11-27
- 4.1.1 — 2023-11-27
- 4.1.0 — 2022-08-05
- 4.0.1 — 2022-04-04
- 4.0.0 — 2022-02-14
- 3.0.7 — 2022-01-06
- 3.0.6 — 2021-10-15
- … 17 more at https://npm.io/package/@ideal-postcodes/core-axios/versions

## README

<h1 align="center">
  <img src="https://img.ideal-postcodes.co.uk/Ideal%20Postcodes%20Axios%20Logo@3x.png" alt="Ideal Postcodes Axios">
</h1>

> Axios backed JavaScript client for api.ideal-postcodes.co.uk

![CI](https://github.com/ideal-postcodes/core-axios/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/ideal-postcodes/core-axios/branch/master/graph/badge.svg)](https://codecov.io/gh/ideal-postcodes/core-axios)
[![Dependency Status](https://david-dm.org/ideal-postcodes/core-axios.svg)](https://david-dm.org/ideal-postcodes/core-axios)
[![npm version](https://badge.fury.io/js/%40ideal-postcodes%2Fcore-axios.svg)](https://www.npmjs.com/package/@ideal-postcodes/core-axios)
[![install size](https://packagephobia.now.sh/badge?p=@ideal-postcodes/core-axios)](https://packagephobia.now.sh/result?p=@ideal-postcodes/core-axios)
[![Release](https://github.com/ideal-postcodes/core-axios/workflows/Release/badge.svg)](https://github.com/ideal-postcodes/core-axios/actions)

`@ideal-postcodes/core-axios` is the Axios backed client for api.ideal-postcodes.co.uk. Axios is a promise based HTTP client for the browser and node.js and so is ideal for:

- Frameworks that utilise server side rendering (Angular, Next.js, React, etc)
- Isomorphic code (runs on browser and server)

Our JavaScript client implements a common interface defined at [@ideal-postcodes/core-interface](https://github.com/ideal-postcodes/core-interface).

High level client documentation can be found at [core-interface](https://github.com/ideal-postcodes/core-interface/blob/master/README.md).

In depth client documentation can be found in the [core-interface README](https://github.com/ideal-postcodes/core-interface#documentation).

## Links

- [Configuration & Usage](#configuration--usage)
- [Quickstart](#quickstart)
- [Client Documentation](https://github.com/ideal-postcodes/core-interface/blob/master/README.md)
- [In Depth Client Documentation](https://github.com/ideal-postcodes/core-interface#documentation)
- [npm Module](https://www.npmjs.com/package/@ideal-postcodes/core-axios)
- [GitHub Repository](https://github.com/ideal-postcodes/core-axios)

## Other JavaScript Clients

- [Node.js Client Repository](https://github.com/ideal-postcodes/core-node)
- [Browser Client Repository](https://github.com/ideal-postcodes/core-browser)
- [Bundled Browser Client Repository](https://github.com/ideal-postcodes/core-browser-bundled)

## Documentation

### Configuration & Usage

- [Install](#install)
- [Instantiate](#instantiate) and [Use](#use) client
- [Catch Errors](#catch-errors)

#### Install

```bash
npm install @ideal-postcodes/core-axios
```

#### Instantiate

```javascript
import { Client } from "@ideal-postcodes/core-axios"

const client = new Client({ api_key: "iddqd" });
```

[Configuration options](https://github.com/ideal-postcodes/core-interface/blob/master/lib/client.ts)


#### Use

```javascript
import { lookupPostcode } from "@ideal-postcodes/core-axios"

const addresses = await lookupPostcode({ client, postcode: "SW1A2AA" });
```

#### Catch Errors

```javascript
import { errors, lookupAddress } from "@ideal-postcodes/core-axios"

try {
  await lookupAddress({ client, query: "10 downing street" });
} catch (error) {
  if (error instanceof errors.IdpcRequestFailedError) {
    // IdpcRequestFailedError indicates a 402 response code
    // Possibly the key balance has been depleted
  }
}
```

## Test

```bash
npm test
```

## Licence

MIT

---
_Source: https://npm.io/package/@ideal-postcodes/core-axios · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
