@hmcts/postcodeinfo-client
v1.1.0
Published
MoJ postcode lookup client
Downloads
16
Maintainers
Keywords
Readme
postcode-info-client-node
API Client wrapper for MoJ Postcode Info API which contains public sector information licensed under the Open Government License v2.0
Usage
Authentication
You will need an authentication token ('auth token'). If you're using MoJ DS's Postcode Info server, you can get one by emailing [email protected] with a brief summary of:
- who you are
- what project you're going to be using it on
- roughly how many lookups you expect to do per day
If you're running your own server, see https://github.com/ministryofjustice/postcodeinfo#auth_tokens for instructions on how to set a token up.
Quick start
$ yarn add @hmcts/postcodeinfo-client
Typescript:
import { PostcodeInfoClient } from '@hmcts/postcodeinfo-client'
new PostcodeInfoClient('<token here>').lookupPostcode('SN15NB')
- Javascript -
const PostcodeInfoClient = require('@hmcts/postcodeinfo-client').PostcodeInfoClient
new PostcodeInfoClient('<token here>').lookupPostcode('SN15NB')