covid4j

Java API for fetching Covid-19 Stats for Countries/Cities/States

License

License

Categories

Categories

Ninja User Interface Web Frameworks
GroupId

GroupId

io.javaninja.ajeet
ArtifactId

ArtifactId

covid4j
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

covid4j
Java API for fetching Covid-19 Stats for Countries/Cities/States
Project URL

Project URL

https://javaninja.io
Source Code Management

Source Code Management

https://github.com/javaninjacloud/covid4j

Download covid4j

How to add to project

<!-- https://jarcasting.com/artifacts/io.javaninja.ajeet/covid4j/ -->
<dependency>
    <groupId>io.javaninja.ajeet</groupId>
    <artifactId>covid4j</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/io.javaninja.ajeet/covid4j/
implementation 'io.javaninja.ajeet:covid4j:1.0.3'
// https://jarcasting.com/artifacts/io.javaninja.ajeet/covid4j/
implementation ("io.javaninja.ajeet:covid4j:1.0.3")
'io.javaninja.ajeet:covid4j:jar:1.0.3'
<dependency org="io.javaninja.ajeet" name="covid4j" rev="1.0.3">
  <artifact name="covid4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.javaninja.ajeet', module='covid4j', version='1.0.3')
)
libraryDependencies += "io.javaninja.ajeet" % "covid4j" % "1.0.3"
[io.javaninja.ajeet/covid4j "1.0.3"]

Dependencies

compile (1)

Group / Artifact Type Version
org.jsoup : jsoup jar 1.13.1

Project Modules

There are no modules declared in this project.

covid4j - Java API for pulling Covid-19 Stats

Spring Boot REST Api for fetching Covid-19 Stats for country/state/city

Data is sourced from WHO and is regularly updated. More details available here:- https://javaninja.io/spring-boot-rest-api-for-pulling-covid-19-stats/

Include the following maven dependency:-

<dependency>
    <groupId>io.javaninja.ajeet</groupId>
    <artifactId>covid4j</artifactId>
    <version>1.0.3</version>
</dependency>

API's exposed:-

Get data by country:-

@GetMapping("/getCovidDataByCountry/{country}")
    public CovidStats getCovidDataByCountry(@PathVariable String country) throws IOException {

        return CovidApi.getAllCovidStatsForCountry(country);
    }

Get data by state or city:-

@GetMapping("/getCovidDataByCityOrState/{cityOrState}")
    public CovidStats getCovidDataByCityOrState(@PathVariable String cityOrState) throws IOException {

        return CovidApi.getAllCovidStatsForCityOrState(cityOrState);
    }

Params 'country' and 'cityOrState' are not case-sensitive.

Sample response for country 'India'

{
    "name": "india",
    "type": "country",
    "confirmed": "321K",
    "recovered": "162K",
    "deaths": "9,195",
    "confirmedNewCases": "+11,929",
    "confirmedNewDeaths": "+311",
    "lastUpdated": "Updated less than 20 mins ago"
}
io.javaninja.ajeet

Java Ninja

An Organization which believes in all things open source.

Versions

Version
1.0.3
1.0.2
1.0.1
1.0.0