Code Monkey home page Code Monkey logo

sir-api's Introduction

Screenshot of Site - 1

SIR Model API | Simulate the epidemic model SIR

SIR Model API is a free API that simulates the epidemic model SIR.

Link to project: https://sir-epimodel-api.herokuapp.com.

Postman documentation: https://documenter.getpostman.com/view/20506585/Uz5NjDZg.

Table of Contents

Features

  • Free to use
  • Responds on JSON format

Returns the SIR simulation result given the initial number of susceptible individuals (s), the initial number of infected (i), the initial number of recovered (r), the beta (b), the gamma (g), and the time length (t). All query parameters must be numbers.

Response is an object with four keys: t - index of time (index starts at 0), s - susceptible individuals at time t, i - infected individuals at time t, and r - recovered individuals at time t.

Prerequisites

None. No authentication needed.

Installation

To run it locally, install dependencies:

npm install

Run the server:

npm run dev

Listen to port 9000. You can use the sample get request.

Usage

Sample call:

Endpoint: https://sir-epimodel-api.herokuapp.com/api/sir?s=79000&i=10&r=0&b=0.5&g=0.33&t=10

This asks for the SIR simulation result with 79,000 initial susceptible individuals, 10 initial infected, and 0 initial recovered. The transmission rate is beta = 0.5 while the removal rate is gamma = 0.33. Simulation result is up to t = 10 time points (starts at index 0).

Response
{
	"t": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
	"s": [
		79000, 78995, 78989.15, 78982.31, 78974.31, 78964.95, 78954, 78941.19,
		78926.21, 78908.7
	],
	"i": [10, 11.7, 13.69, 16.01, 18.73, 21.91, 25.63, 29.98, 35.06, 41],
	"r": [0, 3.3, 7.16, 11.68, 16.96, 23.14, 30.37, 38.83, 48.72, 60.29]
}

Example applications

Documentation

Postman documentation

Tech Used

Other sources:

License

MIT LICENSE

Contact

I'm open for contribution. Issue pull request to main.

My other projects

Check out my other projects:

sir-api's People

Contributors

ijborda 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.