GithubHelp home page GithubHelp logo

encinecarlos / covid-19-ao-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ravelinodecastro/covid-19-ao-api

0.0 1.0 0.0 4.51 MB

Covid-19 Ao Api is an Angolan API created to show in real time the information about the cases of the corona virus detected in the Angolan territory.

Home Page: https://covid19ao.com

PHP 76.01% HTML 4.63% Vue 19.36%

covid-19-ao-api's Introduction

Covid-19 Ao Api

Covid-19 Ao Api is an Angolan API created to show in real time the information about the cases of the corona virus detected in the Angolan territory.

Click here to see results in your browser

Covid-19 Ao (Plataform)

In the home directory, you can find the platform, which can provide the same results as the API, also accompanied by "prevention tips", an online test for self-diagnosis of covid-19 disease and a list of services in which they can be ordered from home (only in Angola).

Endpoitns

Endpoint Description Type
https://covid19ao.com/api/general It returns the lastest update from governmant reports. Object
https://covid19ao.com/api/report It returns the updates from each day, since the API was created. Array of objects
https://covid19ao.com/api/tips?lang=pt It returns prevention tips in portuguese. You can change the language (available in: en, pt, es, fr) Array of objects
https://covid19ao.com/api/services?lang=pt It returns a list of services in portuguese. You can change the language (available in: en, pt, es, fr) Array of objects
https://covid19ao.com/api/services/1?lang=pt Returns a list of all services that belong to the category with ID 1 in Portuguese. You can change the language (available in: en, pt, es, fr) Array of objects

Usage (Javascript)

fetch(`https://covid19ao.com/api/general/`, {
        method: 'get',
        headers: {
            'Content-Type': 'application/json'
        },

    }).then((response) => response.json())
        .then((res) => {
            console.log(res)
        }).catch((error) => {
            console.error(error)
    });

Usage (Php)

$url ='https://covid19ao.com/api/general/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
$response = trim(curl_exec($ch));
curl_close($ch);

echo $response;

Usage (Python)

response = requests.get('https://covid19ao.com/api/general/')
print(response)

Usage (Dart)

import 'package:http/http.dart' as http;

Future<http.Response> fetchPhone() {
  return http.get('https://covid19ao.com/api/general/');
}

Usage (Go)

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func Fetch() {
  url := fmt.Sprintf("https://covid19ao.com/api/general")

  client := &http.Client {}
  req, err := http.NewRequest("GET", url, nil)

  if err != nil {
    fmt.Println(err)
  }
  res, err := client.Do(req)
  defer res.Body.Close()
  body, err := ioutil.ReadAll(res.Body)

  fmt.Println(string(body))
}

Contributing

You can always contribute for the improvment of this project, send an email to join this project.

covid-19-ao-api's People

Contributors

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