Coder Social home page Coder Social logo

oc-covid-data's Introduction

OC CoViD Data

An API to present Orange County, California's CoViD-19 data in a computer readable format.

API

API requests can be made to any endpoint in the following format:

https://oc-covid-data.herokuapp.com/(all|cases|hospitalizations|tests).(csv|json)

The first parameter specifies whether you would like to request all available data, or just data on cases, hospitalizations, or tests. The second parameter specifies whether the data should be returned in CSV or JSON format.

GET (all|cases|hospitalizations|tests).json

JSON endpoints return a map of every day's data in the following format. If only data on cases, hospitalizations, or tests are requested, then other data will not be included in the response, nor will days without the requested kind of data.

{
    [Date]: {                           // the date on which the data were reported
        cases: {
            today: Number,              // the number of cases reported on this date
            cumulative: Number          // the total number of cases reported by this date
        } | undefined,
        hospitalizations: {
            today: Number,              // the number of people hospitalized on this date
            icu: Number,                // the number of people in the ICU on this date
            hospitalsReporting: Number, // the number of hospitals reporting data
        } | undefined,
        tests: {
            today: Number,              // the number of tests reported on this date
            cumulative: Number,         // the total number of tests reported by this date
        } | undefined
    }
}

If a request to a JSON endpoint results in an error, the endpoint returns an error message in the following format:

{
    error: String   // a message explaining the error
}

GET /(all|cases|hospitalizations|tests).csv

CSV endpoints return data in the following format. If only data on cases, hospitalizations, or tests are requested, then the columns for other data will not be included in the response, and days without the requested kind of data will be excluded.

"date","casesCumulative","casesToday","hospitalizationsICU","hospitalizationsReporting","hospitalizationsToday","testsCumulative","testsToday"

If a request to a CSV endpoint results in an error, the endpoint returns an error message in the following format:

"error"

Setup

Prerequisites

To install run this project yourself, you must already have the latest version of Node.js installed.

Installation

To install this web application, perform the following steps:

  1. Clone this repository via the command git clone https://github.com/avielmenter/oc-covid-data.git
  2. Navigate to the oc-covid-data folder.
  3. Run the command npm install.

Run

To run an oc-covid-data server, navigate to the oc-covid-data folder, and start the application using the command npm start.

You can also compile and run this project in developer mode by using the npm run start:dev command. This command will recompile the project whenever a code file in the /src folder is changed.

License

This repository is licensed under the MIT License.

oc-covid-data's People

Contributors

avielmenter avatar

Watchers

James Cloos avatar  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.