Package detail

@ideal-postcodes/core-axios

ideal-postcodes20.9kMIT4.1.5

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

API, Node.js, Axios, UK

readme

Ideal Postcodes Axios

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

CI codecov Dependency Status npm version install size Release

@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.

High level client documentation can be found at core-interface.

In depth client documentation can be found at core-interface.ideal-postcodes.dev.

Links

Other JavaScript Clients

Documentation

Configuration & Usage

Install

npm install @ideal-postcodes/core-axios

Instantiate

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

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

Configuration options

Use

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

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

Catch Errors

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

npm test

Licence

MIT

changelog

4.1.5 (2025-03-24)

Bug Fixes

  • relase: Remove fetch-depth (b87690c)

4.1.4 (2025-03-24)

Bug Fixes

  • axios: Update axios to 1.8.4 (aed7972)
  • Release: Trigger new release (adf68be)
  • Release: Update release credentials (8f5ad25)

4.1.3 (2024-08-16)

Bug Fixes

  • axios: Bump axios lib to version 1.7.4 (278d8ef)

4.1.2 (2023-11-27)

Bug Fixes

  • core-interface: Update core interface (998096d)
  • core-interface: Update core interface (9be324a)

4.1.1 (2023-11-27)

Bug Fixes

4.1.0 (2022-08-05)

Features

  • Core-Interface: Update to 3.2.0 (42ceaa1)

4.0.1 (2022-04-04)

Bug Fixes

  • Core-Interface: Update to 3.1.0 (0edbc0c)

4.0.0 (2022-02-14)

Features

  • Core-Interface: Update to 3.0 (3cccbe2)

BREAKING CHANGES

  • Core-Interface: Updates core-interface to 3.0.0

4.0.0-beta.1 (2022-02-03)

Features

  • Core-Interface: Update to 3.0 (3cccbe2)

BREAKING CHANGES

  • Core-Interface: Updates core-interface to 3.0.0

3.0.7 (2022-01-06)

Bug Fixes

  • Axios: Pin to version 0.24.0 (4a6983e)

3.0.6 (2021-10-15)

Bug Fixes

3.0.5 (2021-10-04)

Bug Fixes

  • deps: bump axios from 0.21.3 to 0.22.0 (#430) (4295410)

3.0.4 (2021-09-07)

Bug Fixes

3.0.3 (2021-07-23)

Bug Fixes

3.0.2 (2021-07-23)

Bug Fixes

  • Core-Interface: Bump version (7b0c1ca)

3.0.1 (2021-07-19)

Bug Fixes

  • Deps: Bump core-interface (bb5fc87)

3.0.0 (2021-06-08)

Features

  • Core Interface: Update to Version 2 (a93bb13)

BREAKING CHANGES

  • Core Interface: - Package now exports a defaults object
  • Client.defaults has been removed
  • All client config is now stored in client.config
  • All resources have been removed from the client. Instead retrieve these from the library and inject the client. E.g. client.postcodes.retrieve becomes postcodes.retrieve(client, ...)
  • Helper methods (like lookupPostcode, ping) have been removed from the client. Instead retrieve these from the library and inject the client. E.g. client.lookupPostcode becomes lookupPostcode(client, ...)

2.2.4 (2021-01-15)

Bug Fixes

  • Deps: Bump core-interface to 1.9.0 (528c822)

2.2.3 (2020-11-27)

Bug Fixes

  • Core Interface: Bump core interface (21c9764)

2.2.2 (2020-11-27)

Bug Fixes

  • tsconfig: Bump tsconfig (962ccfa)

2.2.1 (2020-11-20)

Bug Fixes

2.2.0 (2020-10-26)

Features

2.1.0 (2020-08-07)

Features

  • Core Interface: Bump to 1.6.0 (0bda2ce)

2.0.0 (2020-06-25)

chore

  • Node: Drop explicit support for Node 8 (3a41f25)
  • Node: Drop node 8 support, add 14 (e7064ce)

BREAKING CHANGES

  • Node: Node 8 no longer supported
  • Node: Node 8 no longer forms part of CI testing

1.1.0 (2020-02-07)

Features

  • core-interface: Upgrade to 1.5.0 (aeffba7)

1.0.2 (2020-01-22)

Bug Fixes

  • Headers: Drop default user agent (6c7ddd6)

1.0.1 (2020-01-22)

Bug Fixes

1.0.0 (2020-01-22)

Features

  • Axios: Initial commit (784baf3)
  • Release: Add semantic release (25e1875)