GithubHelp home page GithubHelp logo

covid19-cz-api's Introduction

Czech Republic Covid 19 REST API wrapper

Node.js wrapper for official data provided by Ministry of Health. Documentation and data content are in czech language.

API is publicly accessible, you only need to get your personal token via registration. There is an hourly quota for calling the API, so be careful.

This package is lightweight wrapper around the REST api endpoints - what query parameters are available for given endpoint is stated in the documentation of the endpoint you want to call.

Endpoints are thematically grouped under classes. Usage is pretty much the same, so for example in case of getting overview data of vaccinations:

import {Vaccination} from "covid19-cz-api";

(async () => {
    const api = new Vaccination("yourApiToken");

    const [status, body] =  await api.getOverviewData({
        queryParams: { page: "1", itemsPerPage: "100" },
        options: { headers: { accept: "application/json" } },
      });

    if (status) {
        body.forEach((record) => {
            console.log(JSON.stringify(record, null, 2));
        })
    }
})();

status will be true if response has statusCode in interval <200, 300>. More precisely, if used package node-fetch call has response with status.ok.

Otherwise returns false and in the body object there is either error message by the api server, or if error was caught, the error message.

covid19-cz-api's People

Contributors

dependabot[bot] avatar radekbednarik avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.