Coder Social home page Coder Social logo

disease-sh / api Goto Github PK

View Code? Open in Web Editor NEW
2.5K 74.0 651.0 4.85 MB

API for Current cases and more stuff about COVID-19 and Influenza

Home Page: https://disease.sh/

License: GNU General Public License v3.0

JavaScript 91.08% Dockerfile 0.04% CSS 3.30% Shell 0.03% EJS 5.55%
corona covid19 api covid disease redis discord postman discord-server cdc

api's People

Contributors

1cm69 avatar akshatj27 avatar alitas avatar allcontributors[bot] avatar apollyon600 avatar benjamin-sommer avatar buster95 avatar collin-st avatar dependabot[bot] avatar diced avatar dnguye92 avatar ebwinters avatar egbakou avatar js-ms avatar lauridskern avatar maltejur avatar marveldc avatar matyrics avatar meirroth avatar mymindishazel avatar neo7337 avatar nibble-4bits avatar nibble0101 avatar phamleduy04 avatar pujux avatar rdpappn avatar reinhart1010 avatar renanbastos93 avatar ryanharlow avatar sadilet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api's Issues

CORS

Hey man, i want use your api for a personal project and learning, but i don't have success for CORS reasons.

Data update

The values in the worldometers.info webiste are already changing but the the json data its not

Countries

Countries results doesn't work.

Result: [ ]

Can you fix this?

Last update not working properly

try fixing the timestamp param in the global stats, you are using the server date time and thats wrong, just scrape the date from the source.

Server down

The api's are no more working, server seems down

image

Add Country Please

Isle of Man isn’t recognised as a Country sorry.

Is this something that can be implicated?

Insert data in query

Is it possible to ad date in query?
ex: https://corona.lmao.ninja/[date]/countries
ex: https://corona.lmao.ninja/20200001/countries

fix server.js

I run
npm install
node server.js

and when I attempt to load /all I get this

➜ API git:(master) node server.js
Your app is listening on port 80
(node:3391) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cases' of null
at /Users/itsnash0/Sites/API/server.js:149:10
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:3391) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3391) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

heroku support to deploy quickly

can't get the API to work on my machine, you are using CORS but not importing it, and npm install + node server.js does not work

Empty response

Actual result:
The API returns a blank array, no response

Expected result:
The API returns data.

Data source

What's is your data source ? Do you store data and could you share it ? Are you scraping some website to get it ?

CORS support

Access-Control-Allow-Origin header

would be nice, so that you can use the API via JS (client side) without using proxies.

thx & best regards,
tobias

do you plan on building a site too?

I am working on a site (using your data) right now that users could search by country by typing in the country name and results for that country would be returned. i'll keep you up to date.

(node:469) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'children' of null

Full error:
(node:469) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'children' of null at Timeout.setInterval [as _onTimeout] (/app/server.js:10:556) at process._tickCallback (internal/process/next_tick.js:68:7) (node:469) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 48)

Code:

var getcountries=setInterval(async()=>{let e;try{200!==(e=await axios.get("https://www.worldometers.info/coronavirus/")).status&&console.log("Error",e.status)}catch(e){return null}const t=[],r=cheerio.load(e.data)("table#main_table_countries").children("tbody").children("tr").children("td");for(let e=0;e<r.length-8;e+=1){const a=r[e];if(e%8==0){let e=a.children[0].data||a.children[0].children[0].data||a.children[0].children[0].children[0].data||a.children[0].children[0].children[0].children[0].data||"";0===(e=e.trim()).length&&(e=a.children[0].next.children[0].data||""),t.push({country:e.trim()||""})}if(e%8==1){let e=a.children[0].data||"";t[t.length-1].cases=parseInt(e.trim().replace(/,/g,"")||"0",10)}if(e%8==2){let e=a.children[0].data||"";t[t.length-1].todayCases=parseInt(e.trim().replace(/,/g,"")||"0",10)}if(e%8==3){let e=a.children[0].data||"";t[t.length-1].deaths=parseInt(e.trim().replace(/,/g,"")||"0",10)}if(e%8==4){let e=a.children[0].data||"";t[t.length-1].todayDeaths=parseInt(e.trim().replace(/,/g,"")||"0",10)}if(e%8==6){let e=a.children[0].data||0;t[t.length-1].recovered=parseInt(e.trim().replace(/,/g,"")||0,10)}if(e%8==7){let e=a.children[0].data||"";t[t.length-1].critical=parseInt(e.trim().replace(/,/g,"")||"0",10)}}db.set("countries",t),console.log("Updated The Countries",t)},6e4);

Disable the HTTP redirect to HTTPS

I'm trying to use this API on an ESP32 microcontroller which has very little memory and power, so getting HTTPS to work is quite a challenge. If i make a request using HTTP I get a 301 redirect. I'd love for the API to support HTTP, if possible.

API is down

Not sure if ya'll know or not but the API is down
Getting a cloudflare error
See image here

Open Source Helps!

Thanks for your work to help the people in need! Your site has been added! I currently maintain the Open-Source-COVID-19 page, which collects all open source projects related to COVID-19, including maps, data, news, api, analysis, medical and supply information, etc. Please share to anyone who might need the information in the list, or will possibly contribute to some of those projects. You are also welcome to recommend more projects.

https://weileizeng.github.io/Open-Source-COVID-19/

Cheers!

Adding more fields to /all endpoint

It would be great if you can add some more fields to /all endpoints so we show more information to the users. i.e. TotalNewCases, TotalNewDeaths.
image

Paging for countries

It would be great to implement paging for /countries route because sometimes app that is consuming the resource could use a lot of memory.

What is the best approach to return number of defined countries?
For example /countries?num=10

Incorrect data

In worldometers.info China has 80,894 total cases, API shows 80880

Great job, thanks!

I built a Twitter bot on top of it. This is a great service – open, structured data APIs are lacking for this pandemic. Being able to make gimmicky stuff like twitter bots is underrated. It's very simple but may well end up saving lives.

Thanks, again.

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.