Coder Social home page Coder Social logo

covid-19-api's Introduction

Covid UK Data API

If you are wanting to have a Covid 19 data page, thise API will certainly help. Too start off you need to add this PHP code

<?php
$contents = file_get_contents("https://api.tylermwise.com/covidstats");
$data = json_decode($contents);
?>

Now to get the chosen bit of data you can use any of these bits of code:

<?php echo $data->daily_tested; ?>
<?php echo $data->tested; ?>
<?php echo $data->daily_confirmed; ?>
<?php echo $data->infected; ?>
<?php echo $data->deceased; ?>
<?php echo $data->deceased; ?>

Each one echos a different piece of the JSON code. If you want to read what ones there are you can find the JSON names and whats in them here api.tylermwise.com/covidstat

Covid World Data API

If you are wanting to get the Covid 19 data from around the world, you can do it the same as the UK Data just with other tags:

<?php
$contents = file_get_contents("https://api.tylermwise.com/covidstats");
$data = json_decode($contents);
?>

This is how you get the world data:

<?php echo $data->world_confirmed; ?>
<?php echo $data->world_deaths; ?>
<?php echo $data->world_recovered; ?>

Covid information API

Instead of the scary numbers, you can get the advice on how to stay safe:

<?php
$contents = file_get_contents("https://api.tylermwise.com/covidstats");
$data = json_decode($contents);
?>

This is the Information data code:

<?php echo $data->about; ?>
<?php echo $data->symptoms; ?>
<?php echo $data->self_isolation; ?>
<?php echo $data->treatments_overview; ?>
<?php echo $data->self_care; ?>
<?php echo $data->other_treatments; ?>
<?php echo $data->prevention; ?>

API Credit

This is optional, but we want to give this API to everyone, so we would really like it if you used this bit of code, as it tells users where the data came from:

<?php echo $data->credit;

covid-19-api's People

Contributors

tylermwise avatar

Stargazers

Kornelius Yabes avatar Manu G avatar Soundarahari Parthiban avatar  avatar TeamTBM 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.