API

Die Daten von dieser Website können immer aktuell per API (Application Programming Interface) abgerufen werden. Dafür steht eine HTTP/HTTPS basierte Schnittstelle bereit. Die Ausgabe erfolgt im JSON Format (Siehe dazu https://de.wikipedia.org/wiki/JavaScript_Object_Notation)

Städte   /cities

Endpoint:

https://api.corona-karlsruhe.info/v1/cities

Beschreibung:

Gibt eine Liste mit allen Gemeinden und Städten im Land-, bzw. Stadtkreis Karlsruhe zurück. Die zurückgegbene cityId kann verwendet werden für bei der Funktion /city_infections die gewünschte Stadt zu selektieren. Die Einwohnerzahl kann zur z.B. zurBerechnung der Inzidenzhal verwendet werden.

Parameter:

Name Beschreibung Typ Optional?
Keine Parameter vefügbar.

Beispiel Request:

curl https://api.corona-karlsruhe.info/v1/cities

Beispiel Ausgabe:

{
  "cities":[
    {
      "cityId": 1,
      "cityName": "Bad Sch\u00f6nborn",
      "population": 12913
    },
    {
      "cityId": 2,
      "cityName": "Bretten",
      "population": 29566
    },
    {
      "cityId": 3,
      "cityName": "Bruchsal",
      "population": 44776
    },
    {
      "cityId": 4,
      "cityName": "Dettenheim",
      "population": 6596
    },
    {
      "cityId": 5,
      "cityName": "Eggenstein-Leopoldshafen",
      "population": 16430
    },
    {
      "cityId": 6,
      "cityName": "Ettlingen",
      "population": 39373
    },
    {
      "cityId": 7,
      "cityName": "Forst",
      "population": 8092
    },
    {
      "cityId": 8,
      "cityName": "Gondelsheim",
      "population": 4023
    },
    {
      "cityId": 9,
      "cityName": "Graben-Neudorf",
      "population": 12158
    },
    {
      "cityId": 10,
      "cityName": "Hambr\u00fccken",
      "population": 5578
    },
    {
      "cityId": 11,
      "cityName": "Karlsbad",
      "population": 15810
    },
    {
      "cityId": 12,
      "cityName": "Karlsdorf-Neuthard",
      "population": 10627
    },
    {
      "cityId": 13,
      "cityName": "Karlsruhe",
      "population": 312060
    },
    {
      "cityId": 14,
      "cityName": "Kraichtal",
      "population": 14681
    },
    {
      "cityId": 15,
      "cityName": "Kronau",
      "population": 5880
    },
    {
      "cityId": 16,
      "cityName": "K\u00fcrnbach",
      "population": 2390
    },
    {
      "cityId": 17,
      "cityName": "Linkenheim-Hochstetten",
      "population": 11897
    },
    {
      "cityId": 18,
      "cityName": "Malsch",
      "population": 14656
    },
    {
      "cityId": 19,
      "cityName": "Marxzell",
      "population": 4964
    },
    {
      "cityId": 20,
      "cityName": "Oberderdingen",
      "population": 11119
    },
    {
      "cityId": 21,
      "cityName": "Oberhausen-Rheinhausen",
      "population": 9549
    },
    {
      "cityId": 22,
      "cityName": "\u00d6stringen",
      "population": 12917
    },
    {
      "cityId": 23,
      "cityName": "Pfinztal",
      "population": 18451
    },
    {
      "cityId": 24,
      "cityName": "Philippsburg",
      "population": 13627
    },
    {
      "cityId": 25,
      "cityName": "Rheinstetten",
      "population": 20206
    },
    {
      "cityId": 26,
      "cityName": "Stutensee",
      "population": 24788
    },
    {
      "cityId": 27,
      "cityName": "Sulzfeld",
      "population": 4814
    },
    {
      "cityId": 28,
      "cityName": "Ubstadt-Weiher",
      "population": 13131
    },
    {
      "cityId": 29,
      "cityName": "Wagh\u00e4usel",
      "population": 20950
    },
    {
      "cityId": 30,
      "cityName": "Waldbronn",
      "population": 13080
    },
    {
      "cityId": 31,
      "cityName": "Walzbachtal",
      "population": 9834
    },
    {
      "cityId": 32,
      "cityName": "Weingarten",
      "population": 10422
    },
    {
      "cityId": 33,
      "cityName": "Zaisenhausen",
      "population": 1776
    }
  ]
}

Neusten Infektionen   /latest_infections

Endpoint:

https://api.corona-karlsruhe.info/v1/latest_infections

Beschreibung:

Gibt eine Liste mit den aktuellsten Infektionszahlen aller Städte und Gemeinden zurück

Parameter:

Name Beschreibung Typ Optional?
Keine Parameter vefügbar.

Beispiel Request:

curl https://api.corona-karlsruhe.info/v1/latest_infections

Beispiel Ausgabe:

{
  "date": "2021-01-01",
  "latestInfections":[
    {
      "cityId": 1,
      "cityName": "Bad Sch\u00f6nborn",
      "totalCases": 429,
      "activeCases": 46
    },
    {
      "cityId": 2,
      "cityName": "Bretten",
      "totalCases": 1049,
      "activeCases": 80
    },
    {
      "cityId": 3,
      "cityName": "Bruchsal",
      "totalCases": 834,
      "activeCases": 109
    },
    {
      "cityId": 4,
      "cityName": "Dettenheim",
      "totalCases": 87,
      "activeCases": 13
    },
    {
      "cityId": 5,
      "cityName": "Eggenstein-Leopoldshafen",
      "totalCases": 287,
      "activeCases": 18
    },
    {
      "cityId": 6,
      "cityName": "Ettlingen",
      "totalCases": 776,
      "activeCases": 41
    },
    {
      "cityId": 7,
      "cityName": "Forst",
      "totalCases": 118,
      "activeCases": 17
    },
    {
      "cityId": 8,
      "cityName": "Gondelsheim",
      "totalCases": 113,
      "activeCases": 24
    },
    {
      "cityId": 9,
      "cityName": "Graben-Neudorf",
      "totalCases": 187,
      "activeCases": 21
    },
    {
      "cityId": 10,
      "cityName": "Hambr\u00fccken",
      "totalCases": 98,
      "activeCases": 9
    },
    {
      "cityId": 11,
      "cityName": "Karlsbad",
      "totalCases": 311,
      "activeCases": 50
    },
    {
      "cityId": 12,
      "cityName": "Karlsdorf-Neuthard",
      "totalCases": 210,
      "activeCases": 14
    },
    {
      "cityId": 13,
      "cityName": "Karlsruhe",
      "totalCases": 5049,
      "activeCases": 461
    },
    {
      "cityId": 14,
      "cityName": "Kraichtal",
      "totalCases": 267,
      "activeCases": 26
    },
    {
      "cityId": 15,
      "cityName": "Kronau",
      "totalCases": 123,
      "activeCases": 19
    },
    {
      "cityId": 16,
      "cityName": "K\u00fcrnbach",
      "totalCases": 61,
      "activeCases": 9
    },
    {
      "cityId": 17,
      "cityName": "Linkenheim-Hochstetten",
      "totalCases": 139,
      "activeCases": 13
    },
    {
      "cityId": 18,
      "cityName": "Malsch",
      "totalCases": 195,
      "activeCases": 21
    },
    {
      "cityId": 19,
      "cityName": "Marxzell",
      "totalCases": 111,
      "activeCases": 10
    },
    {
      "cityId": 20,
      "cityName": "Oberderdingen",
      "totalCases": 250,
      "activeCases": 30
    },
    {
      "cityId": 21,
      "cityName": "Oberhausen-Rheinhausen",
      "totalCases": 145,
      "activeCases": 30
    },
    {
      "cityId": 22,
      "cityName": "\u00d6stringen",
      "totalCases": 264,
      "activeCases": 31
    },
    {
      "cityId": 23,
      "cityName": "Pfinztal",
      "totalCases": 255,
      "activeCases": 24
    },
    {
      "cityId": 24,
      "cityName": "Philippsburg",
      "totalCases": 256,
      "activeCases": 23
    },
    {
      "cityId": 25,
      "cityName": "Rheinstetten",
      "totalCases": 401,
      "activeCases": 56
    },
    {
      "cityId": 26,
      "cityName": "Stutensee",
      "totalCases": 406,
      "activeCases": 32
    },
    {
      "cityId": 27,
      "cityName": "Sulzfeld",
      "totalCases": 130,
      "activeCases": 3
    },
    {
      "cityId": 28,
      "cityName": "Ubstadt-Weiher",
      "totalCases": 210,
      "activeCases": 24
    },
    {
      "cityId": 29,
      "cityName": "Wagh\u00e4usel",
      "totalCases": 444,
      "activeCases": 57
    },
    {
      "cityId": 30,
      "cityName": "Waldbronn",
      "totalCases": 233,
      "activeCases": 17
    },
    {
      "cityId": 31,
      "cityName": "Walzbachtal",
      "totalCases": 199,
      "activeCases": 17
    },
    {
      "cityId": 32,
      "cityName": "Weingarten",
      "totalCases": 244,
      "activeCases": 23
    },
    {
      "cityId": 33,
      "cityName": "Zaisenhausen",
      "totalCases": 34,
      "activeCases": 7
    }
  ]
}

Infektionsverlauf in Städten   /city_infections

Endpoint:

https://api.corona-karlsruhe.info/v1/city_infections

Beschreibung:

Gibt die Gesamtzahl an Infizierten Personen und die Anzahl der an dem Tag infizierten Personen zurück. Mittels Parameter kann der Zeitraum eingeschränkt werden.

Parameter:

Name Beschreibung Typ Optional?
cityId Selektion der Stadt oder Gemeinde integer Nein
from Zeige lediglich Daten an, die jünger oder gleich alt als das angegebende Datum sind. date (YYYY-MM-DD) Ja
until Zeige lediglich Daten an, die alte oder gleich alt siind als das angegebende Datum sind. date (YYYY-MM-DD) Ja

Beispiel Request:

curl https://api.corona-karlsruhe.info/v1/city_infections?cityId=13&from=2020-12-28&until=2020-12-31

Beispiel Ausgabe:

{
  "cityName": "Karlsruhe",
  "cityInfections":[
    {
      "date": "2020-12-28",
      "totalCases": 4801,
      "activeCases": 369
    },
    {
      "date": "2020-12-29",
      "totalCases": 4835,
      "activeCases": 328
    },
    {
      "date": "2020-12-30",
      "totalCases": 4917,
      "activeCases": 370
    },
    {
      "date": "2020-12-31",
      "totalCases": 4982,
      "activeCases": 394
    }
  ]
}