/sparapi

Primary LanguageTypeScript

SparAPI

Info
Uses the 2019.1 version of the Spar API. SPAR (Statens person­adress­register) is a service used to fetch information about all registered citizens and residents in Sweden.

Prerequisites
A working node.js installation, for example latest LTS (14.17.0 as of today)

Install Deps

$ npm i

Run Tests

$ npm run test

Add Credentials
Add valid tls key and cert, add credentials to .env file. To generate the certificates read up on SPARs homepage

Start Application

$ npm run start

Interact with the API
Test all the supported formats:

$ curl localhost:8000/personsok?sid=197911072390
$ curl localhost:8000/personsok?sid=7911072390
$ curl localhost:8000/personsok?sid=791107-2390