{"id":1684,"date":"2026-07-15T06:16:20","date_gmt":"2026-07-14T23:16:20","guid":{"rendered":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/15\/how-to-build-a-real-time-pandemic-tracker-app-using-public-apis\/"},"modified":"2026-07-15T06:16:20","modified_gmt":"2026-07-14T23:16:20","slug":"how-to-build-a-real-time-pandemic-tracker-app-using-public-apis","status":"publish","type":"post","link":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/15\/how-to-build-a-real-time-pandemic-tracker-app-using-public-apis\/","title":{"rendered":"How to Build a Real-Time Pandemic Tracker App Using Public APIs"},"content":{"rendered":"<h1>How to Build a Real-Time Pandemic Tracker App Using Public APIs<\/h1>\n<p>Tracking pandemic data in real time is easier than ever thanks to public APIs. By combining a simple frontend with a reliable data source like the Disease.sh API, you can create a live dashboard that shows confirmed cases, recoveries, and deaths for any country. This tutorial walks you through the core steps.<\/p>\n<p>First, choose an API that provides pandemic statistics. Disease.sh (https:\/\/disease.sh) is free, requires no API key, and returns JSON responses with country-level data. You can fetch global totals, country-specific info, or historical trends using endpoints like <code>https:\/\/disease.sh\/v3\/covid-19\/countries<\/code>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/via.placeholder.com\/800x600\/4a90d9\/ffffff?text=how%20to%20create%20a%20pandemic%20tracker%20app%20with%20APIs\" alt=\"Article illustration\" style=\"display:block;margin:20px auto;max-width:100%;height:auto;border-radius:8px;\" \/><\/p>\n<h2>1. Set Up Your Project Skeleton<\/h2>\n<p>Create a single HTML file with embedded CSS and JavaScript. No frameworks are required. Structure your page with a country selector input, a &#8220;Track&#8221; button, and a results area to display stats. Keep the layout minimal \u2014 a clean card design works well.<\/p>\n<pre><code>&lt;input type=\"text\" id=\"country\" placeholder=\"Enter country name\"&gt;\n&lt;button id=\"trackBtn\"&gt;Track&lt;\/button&gt;\n&lt;div id=\"results\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<h2>2. Fetch Data from the API<\/h2>\n<p>Use the <code>fetch()<\/code> function in JavaScript to call the Disease.sh endpoint. When the user clicks the button, build the URL with the entered country name. Handle the response by converting it to JSON and extracting fields like <code>cases<\/code>, <code>deaths<\/code>, <code>recovered<\/code>, and <code>active<\/code>.<\/p>\n<pre><code>document.getElementById('trackBtn').addEventListener('click', async () =&gt; {\n  const country = document.getElementById('country').value;\n  const url = `https:\/\/disease.sh\/v3\/covid-19\/countries\/${country}`;\n  const res = await fetch(url);\n  const data = await res.json();\n  \/\/ Update UI with data.cases, data.deaths, etc.\n});<\/code><\/pre>\n<h2>3. Display and Refresh Dynamically<\/h2>\n<p>Create a function that updates the HTML elements inside <code>#results<\/code> with the fetched numbers. Use template literals to build a simple layout. Add error handling for invalid country names. Optionally, use <code>setInterval()<\/code> to refresh data every 60 seconds, making the tracker truly real-time.<\/p>\n<h2>4. Enhance with Visual Feedback<\/h2>\n<p>Improve the app by adding a loading spinner during fetches and color\u2011coding numbers (e.g., red for cases, green for recovered). You can also integrate Chart.js to plot historical trends, but keep the core app functional first.<\/p>\n<p>Building a pandemic tracker app is a great way to learn API integration and asynchronous JavaScript. Start with the basics, then extend with country comparisons or map overlays. The Disease.sh API gives you all the data you need \u2014 go ahead and build your real-time dashboard today.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Build a Real-Time Pandemic Tracker App Using Public APIs Tracking pandemic data in real time is easier than ever thanks to public APIs. By combining a simple frontend with a reliable data source like the Disease.sh API, you can create a live dashboard that shows confirmed cases, recoveries, and deaths for any country. &hellip; <\/p>\n","protected":false},"author":2716,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-1684","post","type-post","status-publish","format-standard","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/users\/2716"}],"replies":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/comments?post=1684"}],"version-history":[{"count":0,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1684\/revisions"}],"wp:attachment":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}