disease-sh / api Goto Github PK
View Code? Open in Web Editor NEWAPI for Current cases and more stuff about COVID-19 and Influenza
Home Page: https://disease.sh/
License: GNU General Public License v3.0
API for Current cases and more stuff about COVID-19 and Influenza
Home Page: https://disease.sh/
License: GNU General Public License v3.0
It would be great to be able to drill down into state data or even further by county or city data. Currently you can only see the overall status of the country of USA, when I see the source website you're getting data from has state information available to scrape.
Example, on the worldometers site when you select USA, I see state information: https://www.worldometers.info/coronavirus/country/us/
Hey man, i want use your api for a personal project and learning, but i don't have success for CORS reasons.
The values in the worldometers.info webiste are already changing but the the json data its not
Countries results doesn't work.
Result: [ ]
Can you fix this?
Cycle through case death and recovered by tapping
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.
Please add ISO code
A query to the endpoint such as: https://corona.lmao.ninja/countries/usa returns plaintext Country not found
Isle of Man isn’t recognised as a Country sorry.
Is this something that can be implicated?
Is it possible to ad date in query?
ex: https://corona.lmao.ninja/[date]/countries
ex: https://corona.lmao.ninja/20200001/countries
The countries api show an empty json
First of all nice job.
I was trying to calculate more data for example Death Percentage and Recovered percentage but it seems that something updated in the website and is not parsing properly anymore.
BTW if someone is interested for more data: https://github.com/CSSEGISandData/COVID-19
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.
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
Any chance to get the endpoint more stable?
Might be too much incoming traffic.
Maybe add some basic caching.
Actual result:
The API returns a blank array, no response
Expected result:
The API returns data.
What's is your data source ? Do you store data and could you share it ? Are you scraping some website to get it ?
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
Tried putting in USA but after respiring states country not found
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.
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);
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.
Understand this is a realtime data, but incase of any delay we can just validate it by looking at the timestamp field
In white backgrounds cant read the numbers
Not sure if ya'll know or not but the API is down
Getting a cloudflare error
See image here
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!
How could we get data city wise ?
https://corona.lmao.ninja/countries is returning an empty array
Will be great to see a list of services using this api. Maybe after source title.
Mine is using: Spanish stats panel: https://covid19esp.herokuapp.com/
https://corona.lmao.ninja/countries/ seems to be returning nothing ( [ ] ). Issue arose at some point within the last 24 hours.
Good job man!
Values for Nepal gives {"country":"Nepal","cases":1,"todayCases":0,"deaths":0,"todayDeaths":0,"recovered":1,"critical":0}
while https://www.worldometers.info/coronavirus/ gives other values
the titles explains it all.
i tried ' https://corona.lmao.ninja/countries?sort=todayDeaths '
but the result is not sorted by the parameter provided.
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
https://corona.lmao.ninja/countries returns []
In worldometers.info China has 80,894 total cases, API shows 80880
It would be great if we have an endpoint or data from yesterday's table, We can use it to visualize more to the Users.
https://corona.lmao.ninja/countries/ this returns empty results set
There ir no other source?
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.
When i go to https://corona.lmao.ninja/countries/Belgium
i get following response:
Country not found
while that country is in the countries list
Could be made global to track different statistics from
https://www.worldometers.info/
https://corona.lmao.ninja/countries is returning an empty array and https://corona.lmao.ninja/all is just returning
{ "updated": 1584576028335 }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.