marlon360 / rki-covid-api

🦠🇩🇪📈 An API for the spread of covid-19 in Germany. Data from Robert-Koch-Institut.
https://api.corona-zahlen.org/
Creative Commons Attribution 4.0 International
250 stars 50 forks source link

Error 403 for API Endpoint #65

Closed tdonhauser closed 3 years ago

tdonhauser commented 3 years ago

Hello, I tried to use your API but it fails with the following error when using this endpoint: https://api.corona-zahlen.org/germany

Error: Request failed with status code 403 at createError (/usr/src/app/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/src/app/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/src/app/node_modules/axios/lib/adapters/http.js:260:11) at IncomingMessage.emit (events.js:326:22) at IncomingMessage.EventEmitter.emit (domain.js:506:15) at endReadableNT (_stream_readable.js:1241:12) at processTicksAndRejections (internal/process/task_queues.js:84:21)

Does anyone know how to solve this? Thanks!

marlon360 commented 3 years ago

Hello @der1igedon

Unfortunately the official RKI API is temporarily not available.

https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_COVID19/FeatureServer/0/query?where=1%3D1&outFields=*&outSR=4326&f=json

This API relies on this data, we have to wait until they fixed their seevices.

tdonhauser commented 3 years ago

Thanks @marlon360 for the fast reply and the infos!

tdonhauser commented 3 years ago

Did this happen before?

marlon360 commented 3 years ago

I have never seen this error before.

Most of the applications that rely on this RKI API have problems right now: https://github.com/stritti/covid-ampel-widget/issues/27

tdonhauser commented 3 years ago

Understand. Hope the find a solution soon...

shinebar1001 commented 3 years ago

I think, they are already fixing the problem. Data is back here, so it might be a load balancer problem which sure will be fixed soon.

marlon360 commented 3 years ago

Unfortunately the server IP got blocked by the RKI API. I believe the server generated too much traffic.

I encourage everyone who wants to use this API to host it by themselves. You only need a server with Docker support.

I am trying to find a fix for this problem.

Akeel1994 commented 3 years ago

Unfortunately the server IP got blocked by the RKI API. I believe the server generated too much traffic.

I encourage everyone who wants to use this API to host it by themselves. You only need a server with Docker support.

I am trying to find a fix for this problem.

Hey, Have you tried to contact the RKI? Maybe they can whitelist the IP of your server.

Edit My friend told me some mins ago that the RKI API seems to have a problem. You can test the API on their website but the response looks strange. So maybe there is a general problem with the RKi API.

Rubber1Duck commented 3 years ago

......

I encourage everyone who wants to use this API to host it by themselves. You only need a server with Docker support.

Moin, are you able to give a short description what to do, to do so?

helmar74 commented 3 years ago

I only want to grab a few parameter (e.g. total number of infections, death...) Has some one examples, how I can grab this information directly from RKI API? (I would need curl examples for usage in linux shell)

Thanks in advance...

ChristophKrause commented 3 years ago

@helmar74 If you like I have some examples for grabbing some data from JHU and worldometer: JHU/Worldometer: Single countries overall data per day (historical, death and infected) JHU: Germanyy by "bundesländer" (historical, death and infected)

I would like to have some rki samples too, because I failed in getting documentation or examples how to grab equvalent data directly from there.

helmar74 commented 3 years ago

@ChristopKrause

@helmar74 If you like I have some examples for grabbing some data from JHU and worldometer: JHU/Worldometer: Single countries overall data per day (historical, death and infected) JHU: Germanyy by "bundesländer" (historical, death and infected)

I would like to have some rki samples too, because I failed in getting documentation or examples how to grab equvalent data directly from there.

All examples would be nice. I need values for germany and for bayern only...

Also the rki samples would be nice

Thank you

ChristophKrause commented 3 years ago

@helmar74 Not well documented, because it was ment for personal use (in exucse ;) See https://github.com/ChristophKrause/coronaDataHelper/blob/main/src/CoronaDataHelper/CoronaDataHelper/DataSource/DataSourceGermanyJHUCSSEGIT.cs idea: 1) manually checkout https://github.com/CSSEGISandData/COVID-19.git to c:\dev\COVID-19 (or another folder) 2) do a git update on each read 3) parse all csv in c:\dev\COVID-19\csse_covid_19_data\csse_covid_19_daily_reports\ startng at 14.5.2020 4) repack data to have all and day data

starting the oDataSourceGermanyJHUCSSEGIT.process() is returning a JSON with all data. alternatively you can regularly download https://github.com/ChristophKrause/coronaDataHelper/blob/main/src/CoronaDataHelper/CoronaDataHelper/res/JSON/JSONDataGermany.json where i update the data nearly every day before 12:00


I havent took a look how this project works, because I am only API user here, but I strongly suggest to download the data from RKI only few times a day, becuase I guess that the data does not change during a day.

flodt commented 3 years ago

I also simply wanted to grab the data for several Landkreise by AGS (essentially just name, 7-day-incidence and population count for normalizing other values) for a personal overview dashboard. Is there an easy way to get around the issue?

stingrayx commented 3 years ago

@marlon360 Do you think you will be able to resolve or workaround the current problem or should we start to look for alternatives? Which would be a pity. Thanks

shinebar1001 commented 3 years ago

@marlon360 can we help in any way? I can offer to setup a (caching) proxy with another IP for getting the data from ArcGIS.

BTW IMHO there are still problems with the API itself, eg. the RKI Covid19 Dashboards misses "Fälle Altersgruppe" and "Todesfälle Altersgruppe". (yesterday there even has been a popup that they have problems) So I suppose, ArcGIS probably throttles some requests, but there is no documentation.

If I understand the code correctly, there is a 10 Minute caching? Probably changing this value to something bigger could help for a short time?

marlon360 commented 3 years ago

@marlon360 can we help in any way? I can offer to setup a (caching) proxy with another IP for getting the data from ArcGIS.

@shinebar1001 A proxy server would be great! I already ordered a new small server, because it was not possible to change the IP address, but it can take up to 2 business days until I have access to it. So a proxy would be great.

If I understand the code correctly, there is a 10 Minute caching? Probably changing this value to something bigger could help for a short time?

I also improved the caching system and increased the expiration duration to 30 minutes.

marlon360 commented 3 years ago

I also simply wanted to grab the data for several Landkreise by AGS (essentially just name, 7-day-incidence and population count for normalizing other values) for a personal overview dashboard. Is there an easy way to get around the issue?

@flodt Have a look at this URL: https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=RS,AGS,GEN,EWZ,death_rate,cases,deaths,cases_per_100k,cases_per_population,BL,county,last_update,cases7_per_100k,recovered,cases7_bl,death7_bl,cases7_lk,death7_lk,cases7_per_100k_txt&returnGeometry=false&outSR=4326&f=json

marlon360 commented 3 years ago

......

I encourage everyone who wants to use this API to host it by themselves. You only need a server with Docker support.

Moin, are you able to give a short description what to do, to do so?

@Rubber1Duck Here is a short description on how to host it yourself: https://github.com/marlon360/rki-covid-api#host-it-yourself

flodt commented 3 years ago

@marlon360 Thank you very much! That was exactly what I needed! You are doing good work. Greetings from the Allgäu

shinebar1001 commented 3 years ago

So a proxy would be great.

I just sent you an email (just in case, some spamfilter catches it)

Danny

Rubber1Duck commented 3 years ago

......

I encourage everyone who wants to use this API to host it by themselves. You only need a server with Docker support.

Moin, are you able to give a short description what to do, to do so?

@Rubber1Duck Here is a short description on how to host it yourself: https://github.com/marlon360/rki-covid-api#host-it-yourself

unfortunately i get this Error: docker-compose up Pulling rki-api (docker.pkg.github.com/marlon360/rki-covid-api/rki-server:v2)... ERROR: unauthorized: Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.

and i have no idea how to fix this ........... :-(

marlon360 commented 3 years ago

......

I encourage everyone who wants to use this API to host it by themselves. You only need a server with Docker support.

Moin, are you able to give a short description what to do, to do so?

@Rubber1Duck Here is a short description on how to host it yourself: https://github.com/marlon360/rki-covid-api#host-it-yourself

unfortunately i get this Error: docker-compose up Pulling rki-api (docker.pkg.github.com/marlon360/rki-covid-api/rki-server:v2)... ERROR: unauthorized: Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.

and i have no idea how to fix this ........... :-(

@Rubber1Duck I am sorry! I did not know that even public GitHub packages need authentication. I pushed the image to docker hub. It is called marlon360/rki-covid-server:v2.

I also updated the manual: https://github.com/marlon360/rki-covid-api#host-it-yourself

Rubber1Duck commented 3 years ago

@Rubber1Duck I am sorry! I did not know that even public GitHub packages need authentication. I pushed the image to docker hub. It is called marlon360/rki-covid-server:v2.

I also updated the manual: https://github.com/marlon360/rki-covid-api#host-it-yourself

Thanks a lot Marlon, that works great!

filserm commented 3 years ago

thanks for the docker image - works like a charm :+1:

marlon360 commented 3 years ago

🎉🎉🎉 We are back online 🎉🎉🎉

A big thanks to @shinebar1001 (https://www.shinewelt.de)! He created a reverse proxy to hide the banned IP from the RKI server!

I hope we do not have to reopen this issue soon! 🤞

helmar74 commented 3 years ago

I collected DAta from your API this night, but there were the dates for 14.01. for germany and 15.01 for states. Is there still an issue? I grab the data from this URL: https://rki.marlon-lueckert.de/api/general

marlon360 commented 3 years ago

@helmar74 There was a problem, but unrelated to this issue. It is fixed now.

I recommend you to use https://api.corona-zahlen.org/germany The version you are using is not as stable as the new version and will not receive any feature updates.

helmar74 commented 3 years ago

Ah, thanks. is there also a URL for german states (bavaria)?

marlon360 commented 3 years ago

Ah, thanks. is there also a URL for german states (bavaria)?

Yes there is. If you only need Bavaria you can use this: https://api.corona-zahlen.org/states/BY

There are many more feature like R value and vaccination. Have a look at the docs here: https://api.corona-zahlen.org/docs/

helmar74 commented 3 years ago

Many thanks! It works now again: image

Thank you for your great work!

helmar74 commented 3 years ago

API is down again: curl -k https://api.corona-zahlen.org/germany

503 Service Temporarily Unavailable

503 Service Temporarily Unavailable


nginx/1.19.3
helmar74 commented 3 years ago

... and also there seems to be an issue with the certificate