# civic-api

> Integration with Västra Götalands Vaccine API using Javascript that will work in the browser and node.

Latest version **0.1.12** (published 2021-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install civic-api
pnpm add civic-api
yarn add civic-api
bun add civic-api
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.12 |
| Published | 2021-06-08 |
| First published | 2021-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 218.9 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | Viktor Sarström |
| Maintainers | viktorsarstrom |

## Links

- npm: https://www.npmjs.com/package/civic-api
- npm.io page: https://npm.io/package/civic-api

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.21.1

## Recent versions

- 0.1.12 (latest) — 2021-06-08
- 0.1.11 — 2021-06-08
- 0.1.10 — 2021-06-08
- 0.1.8 — 2021-06-08
- 0.1.7 — 2021-06-08
- 0.1.6 — 2021-06-08
- 0.1.3 — 2021-05-28
- 0.1.2 — 2021-05-28
- 0.1.1 — 2021-05-28
- 0.1.0 — 2021-05-28

## README

# VGR Vaccine Time Slots

Integration with Västra Götalands Vaccine API using Javascript that will work in the browser and node.

## setCredentials

This is required to run before you to fetch the test centers.

You can find more information on how to obtain your own api key here:

https://vgrblogg.se/utveckling/2021/05/27/hjalp-vgr-testa-vart-api-med-oppna-vaccintider/#egna-nycklar
 
```javascript
setCredentials('your client id', 'your client secret');
```
## getTestCenters

Fetches the test centers which provides Covid 19 vaccinations in Västra Götaland.

```javascript
import { getTestCenters, setCredentials } from 'civic-api';

setCredentials('your client id', 'your client secret');

const testCenters = getTestCenters();
const testCenters4weeks = getTestCenters(4, 'production');

```

```js
  {
    testcenters: [
          {
            title: 'Närhälsan Ågårdsskogen',
            hsaid: 'SE2321000131-E000000000458',
            municipality: '1494',
            urlBooking: 'https://e-tjanster.1177.se/mvk/scheduling/tbMakeValidation.xhtml?hsaid=SE2321000131-E000000000458&dynamicid=bb0225fc-7c37-47c1-8558-ddb991501c2c',
            urlContactCard: 'https://e-tjanster.1177.se/mvk/facilityContactCard.xhtml?hsaId=SE2321000131-E000000000458',
            urlContactCardText: '1',
            testtype: '1',
            timeslots: 0,
            updated: '2021-05-28 11:38:35'
          },
    ],
    numberOfWeeks: 2 
  }
```

## getTestCenterInformation

Fetches more information regarding the specific test centers

```javascript
import { getTestCenterInformation } from 'civic-api';

const testCenters = getTestCenterInformation({ hsaid: 'SE2321000131-E000000007687' });

```

```js
  {
    resultCount: 1,
    offset: 0,
    limit: 100,
    queryTime: 5029997,
    results: [
      {
        postnummer: '54630',
        foretag: 'Närhälsan',
        ykoord: '471781',
        namn: 'Närhälsan Karlsborg vårdcentral',
        id: '103',
        xkoord: '6487874',
        adress: 'Kärleksstigen 4B',
        hsaid: 'SE2321000131-E000000002615',
        postort: 'Karlsborg'
      }
    ]
  }
```

---
_Source: https://npm.io/package/civic-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
