{"info":{"_postman_id":"2eabd7c8-10a0-4fbf-a8e3-dedb37ab0803","name":"Visualizer - Covid-19 by Country Statistics","description":"<html><head></head><body><p>A simple Visualization using the <a href=\"https://explore.postman.com/templates/6453/covid19-api\">COVID19</a> API</p>\n<p><img src=\"https://i.ibb.co/WpqfMKD/COVID-19.gif\" alt=\"Visualizer Demo\"></p>\n<p>There is a second request in the Collection with the view presented as a table.</p>\n<p><img src=\"https://i.ibb.co/f1Yx5xR/COVID-19-Table.gif\" alt=\"Table View\"></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"1794236","collectionId":"2eabd7c8-10a0-4fbf-a8e3-dedb37ab0803","publishedId":"SzYW2f4S","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-03-29T19:57:38.000Z"},"item":[{"name":"Country stats Card View","event":[{"listen":"test","script":{"id":"e7b613c0-5e65-47ed-b10e-6a17ea5edc9f","exec":["pm.test(\"Status code is 200\", () => {","    pm.response.to.have.status(200);","});","","template = `","<html>","<head>","    <script src=\"https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js\"></script>","    <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\" integrity=\"sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO\"","        crossorigin=\"anonymous\">","    <style type=\"text/css\">","        body { font-size: 12px; background: #eee; padding: 16px;}","        .card { border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,.15); -webkit-box-shadow: 0 4px 10px rgba(0,0,0,.15); -moz-box-shadow: 0 4px 10px rgba(0,0,0,.15); }","        .card-topper { border-top-right-radius: 8px; border-top-left-radius: 8px; padding: 8px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase;}","        .card-topper { background-color: #173F5F; color: #ffffff;}","        .flag { width: 270px; height: 200px; padding-bottom: 5px;}","    </style>","</head>","<body>","    <div class=\"container-fluid\">","        {{#with response.data}}","        <div class=\"row\">","            <div class=\"col-md-auto text-left\">","                <h4>Showing page <strong>{{paginationMeta.currentPage}}</strong> of <strong>{{paginationMeta.totalPages}}</strong></h4>","            </div>","            <div class=\"col-md-auto text-right\">","                <h4><strong>{{paginationMeta.currentPageSize}}</strong> of <strong>{{paginationMeta.totalRecords}}</strong> records displayed</h4>","            </div>","            <div class=\"col-md-auto text-right\">","                <h4>Data last updated <strong>{{last_update}}</strong></h4>","            </div>","        </div>","        {{/with}}","        <div class=\"row\">","            {{#with response.data}}","            {{#each rows}}","            <div class=\"col-sm-6 col-lg-4 col-xl-3 mb-5\">","                <div class=\"card\">","                    <div class=\"card-topper card-img-top\">{{country}}</div>","                    <div class=\"card-body\">","                        <img class=\"rounded mx-auto d-block flag\" src=\"{{flag}}\">","                        <div class=\"table-responsive\">","                        <table class=\"table table-bordered table-hover\">","                        <thead class=\"thead-light\">","                            <tr class=\"text-center\">","                                <th>Category</th>","                                <th>Number</th>","                            </tr>","                        </thead>","                        <tableclass=\"table table-hover\">","                            <tbody>","                                <tr>","                                    <td>Active Cases</td>","                                    <td class=\"text-center\">{{active_cases}}</td>","                                </tr>","                                <tr>","                                    <td>New Cases</td>","                                    <td class=\"text-center\">{{new_cases}}</td>","                                </tr>","                                <tr>","                                    <td>Total Cases</td>","                                    <td class=\"text-center\">{{total_cases}}</td>","                                </tr>","                                <tr>","                                    <td>Cases Per Million</td>","                                    <td class=\"text-center\">{{cases_per_mill_pop}}</td>","                                </tr>","                                <tr>","                                    <td>Total Recovered</td>","                                    <td class=\"text-center\">{{total_recovered}}</td>","                                </tr>","                                <tr>","                                    <td>Serious Critical</td>","                                    <td class=\"text-center\">{{serious_critical}}</td>","                                </tr>","                                <tr>","                                    <td>New Deaths</td>","                                    <td class=\"text-center\">{{new_deaths}}</td>","                                </tr>","                                <tr>","                                    <td>Total Deaths</td>","                                    <td class=\"text-center\">{{total_deaths}}</td>","                                </tr>","                        </table>","                        </div>","                    </div>","                </div>","            </div>","            {{/each}}","            {{/with}}","        </div>","    </div>","</body>","</html>","`;","","pm.visualizer.set(template, {","    response: pm.response.json()","});"],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"719a4123-91ba-444e-99b8-d94a137d3c52","exec":[""],"type":"text/javascript"}}],"id":"ddd60ad5-8aaf-44d4-9df7-fb29e8023703","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{}},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"https://corona-virus-stats.herokuapp.com/api/v1/cases/countries-search","description":"<p>Using the Country Stats endpoint from the <a href=\"https://explore.postman.com/templates/6453/covid19-api\">Covid19</a> API, I have created a basic visualized view of the response data.</p>\n<p>The API has a number of URL parameter filters that can be used to reduce and sort the data set returned, this will display a different visualization according to the new response.</p>\n<p>Other params that can be used in the same way are:</p>\n<ul>\n<li>search</li>\n<li>order</li>\n<li>limit</li>\n<li>page</li>\n</ul>\n","urlObject":{"protocol":"https","path":["api","v1","cases","countries-search"],"host":["corona-virus-stats","herokuapp","com"],"query":[{"disabled":true,"description":{"content":"<p>Search by Country</p>\n","type":"text/plain"},"key":"search","value":"UK"},{"disabled":true,"description":{"content":"<p>Total records returned. Max 200.</p>\n","type":"text/plain"},"key":"limit","value":"15"},{"disabled":true,"description":{"content":"<p>Page displayed</p>\n","type":"text/plain"},"key":"page","value":"4"},{"disabled":true,"key":"order","value":"active_cases"}],"variable":[]}},"response":[{"id":"3ff682f6-7706-4c30-8b78-14690df0c978","name":"Country stats","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"https://corona-virus-stats.herokuapp.com/api/v1/cases/countries-search","protocol":"https","host":["corona-virus-stats","herokuapp","com"],"path":["api","v1","cases","countries-search"],"query":[{"key":"search","value":"UK","type":"text","description":"Search by Country","disabled":true},{"key":"order","value":"active_cases","type":"text","description":"Order by Category","disabled":true},{"key":"limit","value":"50","description":"Total records returned. Max 200.","disabled":true},{"key":"page","value":"4","description":"Page displayed","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Fri, 27 Mar 2020 14:12:45 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"3315"},{"key":"Vary","value":"Cookie, Origin"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"paginationMeta\": {\n            \"currentPage\": 1,\n            \"currentPageSize\": 10,\n            \"totalPages\": 21,\n            \"totalRecords\": 203\n        },\n        \"rows\": [\n            {\n                \"country\": \"USA\",\n                \"country_abbreviation\": \"US\",\n                \"total_cases\": \"85,762\",\n                \"new_cases\": \"327\",\n                \"total_deaths\": \"1,306\",\n                \"new_deaths\": \"11\",\n                \"total_recovered\": \"1,868\",\n                \"active_cases\": \"82,588\",\n                \"serious_critical\": \"2,122\",\n                \"cases_per_mill_pop\": \"259.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/us-flag.gif\"\n            },\n            {\n                \"country\": \"China\",\n                \"country_abbreviation\": \"CN\",\n                \"total_cases\": \"81,340\",\n                \"new_cases\": \"55\",\n                \"total_deaths\": \"3,292\",\n                \"new_deaths\": \"5\",\n                \"total_recovered\": \"74,588\",\n                \"active_cases\": \"3,460\",\n                \"serious_critical\": \"1,034\",\n                \"cases_per_mill_pop\": \"57.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/ch-flag.gif\"\n            },\n            {\n                \"country\": \"Italy\",\n                \"country_abbreviation\": \"IT\",\n                \"total_cases\": \"80,589\",\n                \"new_cases\": \"0\",\n                \"total_deaths\": \"8,215\",\n                \"new_deaths\": \"0\",\n                \"total_recovered\": \"10,361\",\n                \"active_cases\": \"62,013\",\n                \"serious_critical\": \"3,612\",\n                \"cases_per_mill_pop\": \"1,333.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/it-flag.gif\"\n            },\n            {\n                \"country\": \"Spain\",\n                \"country_abbreviation\": \"ES\",\n                \"total_cases\": \"64,059\",\n                \"new_cases\": \"6,273\",\n                \"total_deaths\": \"4,858\",\n                \"new_deaths\": \"493\",\n                \"total_recovered\": \"9,357\",\n                \"active_cases\": \"49,844\",\n                \"serious_critical\": \"4,165\",\n                \"cases_per_mill_pop\": \"1,370.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/sp-flag.gif\"\n            },\n            {\n                \"country\": \"Germany\",\n                \"country_abbreviation\": \"DE\",\n                \"total_cases\": \"47,373\",\n                \"new_cases\": \"3,435\",\n                \"total_deaths\": \"285\",\n                \"new_deaths\": \"18\",\n                \"total_recovered\": \"5,673\",\n                \"active_cases\": \"41,415\",\n                \"serious_critical\": \"23\",\n                \"cases_per_mill_pop\": \"565.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/gm-flag.gif\"\n            },\n            {\n                \"country\": \"Iran\",\n                \"country_abbreviation\": \"IR\",\n                \"total_cases\": \"32,332\",\n                \"new_cases\": \"2,926\",\n                \"total_deaths\": \"2,378\",\n                \"new_deaths\": \"144\",\n                \"total_recovered\": \"11,133\",\n                \"active_cases\": \"18,821\",\n                \"serious_critical\": \"2,893\",\n                \"cases_per_mill_pop\": \"385.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/ir-flag.gif\"\n            },\n            {\n                \"country\": \"France\",\n                \"country_abbreviation\": \"FR\",\n                \"total_cases\": \"29,155\",\n                \"new_cases\": \"0\",\n                \"total_deaths\": \"1,696\",\n                \"new_deaths\": \"0\",\n                \"total_recovered\": \"4,948\",\n                \"active_cases\": \"22,511\",\n                \"serious_critical\": \"3,375\",\n                \"cases_per_mill_pop\": \"447.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/fr-flag.gif\"\n            },\n            {\n                \"country\": \"Switzerland\",\n                \"country_abbreviation\": \"CH\",\n                \"total_cases\": \"12,311\",\n                \"new_cases\": \"500\",\n                \"total_deaths\": \"207\",\n                \"new_deaths\": \"15\",\n                \"total_recovered\": \"897\",\n                \"active_cases\": \"11,207\",\n                \"serious_critical\": \"203\",\n                \"cases_per_mill_pop\": \"1,422.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/sz-flag.gif\"\n            },\n            {\n                \"country\": \"UK\",\n                \"country_abbreviation\": \"GB\",\n                \"total_cases\": \"11,658\",\n                \"new_cases\": \"0\",\n                \"total_deaths\": \"578\",\n                \"new_deaths\": \"0\",\n                \"total_recovered\": \"135\",\n                \"active_cases\": \"10,945\",\n                \"serious_critical\": \"163\",\n                \"cases_per_mill_pop\": \"172.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/uk-flag.gif\"\n            },\n            {\n                \"country\": \"S. Korea\",\n                \"country_abbreviation\": \"KR\",\n                \"total_cases\": \"9,332\",\n                \"new_cases\": \"91\",\n                \"total_deaths\": \"139\",\n                \"new_deaths\": \"8\",\n                \"total_recovered\": \"4,528\",\n                \"active_cases\": \"4,665\",\n                \"serious_critical\": \"59\",\n                \"cases_per_mill_pop\": \"182.0\",\n                \"flag\": \"https://www.worldometers.info/img/flags/ks-flag.gif\"\n            }\n        ]\n    },\n    \"status\": \"success\"\n}"}],"_postman_id":"ddd60ad5-8aaf-44d4-9df7-fb29e8023703"},{"name":"General Stats Table View","event":[{"listen":"prerequest","script":{"id":"919c4840-b175-4dca-bd14-2c1fef34457c","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"1df47071-4441-4a9e-bec2-3499f8ae1719","exec":["pm.test(\"Status code is 200\", () => {","    pm.response.to.have.status(200);","});","","template = `","<html>","<head>","    <script src=\"https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js\"></script>","    <script src=\"https://cdn.datatables.net/v/bs4/dt-1.10.18/datatables.min.js\"></script>","    <script src=\"https://cdn.datatables.net/1.10.20/js/dataTables.bootstrap4.min.js\"></script>","    <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\">","    <link rel=\"stylesheet\" href=\"https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css\">","    <style type=\"text/css\">","        img { width: 100px; height: 75px;}","        body { padding-top:50px; background: #f8f9fa;}","    </style>","</head>","<body>","    <div class=\"container\">","    {{#with response.data}}","    <div class=\"text-right\">","        <h6>Data last updated <strong>{{last_update}}</strong></h6>","    </div>","    {{/with}}","    <table id=\"myTable\" class=\"display table-hover\" style=\"width:100%\">","        <thead class=\"thead-dark\">","            <tr class=\"text-center\">","                <th>Flag</th>","                <th>Country</th>","                <th>Active Cases</th>","                <th>New Cases</th>","                <th>Total Cases</th>","                <th>Cases Per Million</th>","                <th>Total Recovered</th>","                <th>Serious Critical</th>","                <th>New Deaths</th>","                <th>Total Deaths</th>","            </tr>","        </thead>","        <tbody>","            {{#with response.data}}","            {{#each rows}}","            <tr>","                <td  class=\"text-center\"><img src=\"{{flag}}\"></td>","                <td  class=\"text-center\">{{country}}</td>","                <td  class=\"text-center\">{{active_cases}}</td>","                <td  class=\"text-center\">{{new_cases}}</td>","                <td  class=\"text-center\">{{total_cases}}</td>","                <td  class=\"text-center\">{{cases_per_mill_pop}}</td>","                <td  class=\"text-center\">{{total_recovered}}</td>","                <td  class=\"text-center\">{{serious_critical}}</td>","                <td  class=\"text-center\">{{new_deaths}}</td>","                <td  class=\"text-center\">{{total_deaths}}</td>","            </tr>","            {{/each}}","            {{/with}}","        </tbody>","    </table>","    </div>","</body>","</html>","<script>","$(document).ready( function () {","    $('#myTable').DataTable({","        pageLength: 15,","        dom: 'ipf',","        fixedColumns: true,","        columnDefs: [ {","            targets: [0,2,3,4,5,6,7,8,9],","            searchable: false","    } ]","    });","});","</script>","`;","","pm.visualizer.set(template, {","    response: pm.response.json()","});"],"type":"text/javascript"}}],"id":"88e45070-d8e2-490d-906b-c34fcf6659cf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://corona-virus-stats.herokuapp.com/api/v1/cases/countries-search?limit=200","description":"<p>Using the <code>dataTables</code> module to display the data in a table format. This module comes with searching and pagination of of the box.</p>\n","urlObject":{"protocol":"https","path":["api","v1","cases","countries-search"],"host":["corona-virus-stats","herokuapp","com"],"query":[{"key":"limit","value":"200"}],"variable":[]}},"response":[],"_postman_id":"88e45070-d8e2-490d-906b-c34fcf6659cf"}]}