Note Share via https://djay.github.io/covidthailand
Thailand COVID-19 case/test/vaccination data gathered and combined from various government sources for others to view or download.
- Updated daily 8-9am summary info, 1-3pm from full briefing. Testing data is updated every 1-3 weeks. .
Cases | Deaths | Vaccinations | Active Cases | Testing | Downloads | About
NEW Excess Deaths
Data offered here is offered as is with no guarantees. As much as possible government reports and data feeds have been used effort has gone into making this data collection accurate and timely. This sites only intention is to give an accurate representation of all the available Covid data for Thailand in one place.
Links to all data sources are including in Downloads
Got a question about covid in Thailand? Try asking it in Q&A discussion
From Oct 1st 2022 all covid data from the DDC has been released in weekly chunks. Data here will be displayed as daily averages and updates will be once per week (mondays?). In addition many of the data sources have stopped being published so many plots will no longer be change.
-
source: Outbreak.info, DMSc Variant Report
-
Sources: CCSA Daily Briefing, MOPH daily situation report, DMSC: Thailand Laboratory testing data
- source: Outbreak.info, DMSc Variant Report
- source: CCSA Daily Briefing
- Source: CCSA Daily Briefing
- The existance of Comorbidities still means the cause of death was Covid and doesn't imply that these conditions were likely to cause death in that individual in the near future.
- Source: MOPH Covid-19 Dashboard
No longer updated so model is inaccurate
- IHME: stopped updating predictions from 2022-12-16 so estimates become less reliable the further past that date.
- Note: no country tests everyone so modelling is needed to estimate the real number of infections in the community including asymtematic infections. Modelling includes many factors such as the estimated deaths, immunity and fatality rate of the variants for a given demographic.
- ATK+ from the DDC Dashboard is not clear if this is an estimate or some measure of reported infections to MOPH. Interpoloated from weekly figure.
- ATK (Probable Cases) has stopped being reported
- As of 1st June 2022, only severe cases are tested for PCR and report cases only includes PCR results so the trend of cases doesn't indicate infections as well as it did previously.
- For forecasts of total infections/deaths/hospitalisations see IHME Thailand | IHME Thailand Report | ICL Thailand | LSHTM Thailand | OWID Covid Models for Thailand | Google mobility data
- Source: IHME COVID estimates, MOPH Covid-19 Dashboard, CCSA Daily Briefing
Bangkok Region - Central - Eastern - Western - Northeast A-N - Northeast N-Y - Northern C-N - Northern P-U - Southern C-P - Southern R-Y
- Sources: CCSA Daily Briefing
- Provinces Trending Up Cases from Community | Work | Proactive
- Provinces Trending Down Cases from Unknown | Contact | Comunity | Work | Proactive
- Grouped from original data using this mapping from risk description to 10 classifcation.
- Cases by Risk: Full Year
- Source: API: Daily reports of COVID-19 infections
- see also Provinces with Most Walkin Cases | 2020-2021
- Contact tracing normally counts as a "Walk-in"
- Proactive tests are normally done at specific high risk locations or places of known cases, rather than random sampling (but it's possible random sampling may also be included).
- Sources: CCSA Daily Briefing, MOPH daily situation report
- see Ages of confirmed cases 2020-2021
- Source: API: Daily reports of COVID-19 infections
- see also Cases and people movement from April 2021
- Mobility (based on mobile phone data) estimates are from IHME dataset. The data is transformed and scaled to show relative social distancing (reduced mobility) compared to peak.
- The chart then shows how reduced mobility and number of new cases progresses in time.
- Source: IHME COVID estimates
- To show more recent trends last 90 days is used instead of total deaths / total cases which is normally used.
- CFR is not the IFR (Infection Fatality Rate) so doesn't tell the chance of dying if infected
- Detection rate of cases & deaths can change CFR a lot. Deaths shifted by med. time till to death in Thailand (17d) however this number is likely shorter before vaccinations and longer after vaccinations and newer treatments.
- IFR is estimated by IHME based on their modelling which factors in excess deaths, detection rate, immunity and other factors.
- Source: CCSA Daily Briefing
- Source: IHME COVID estimates
- Source: DDC Daily Vaccination Reports
-
Source: MOPH Covid-19 Dashboard, DDC Daily Vaccination Reports
-
see also Lowest Provinces by Vaccination 1st Jab | Vaccinations 1st given by Region | Map of Vaccinations: The Researcher Covid Tracker
- Break down of active case status only available from 2020-04-24 onwards.
- Other Active Cases + ICU + Ventilator + Field hospitals = Hospitalised, which is everyone who is confirmed (for 14days at least)
- see Thailand Active Cases 2020-2021
- Source: CCSA Daily Briefing
-
Positive rate < 5% for 2 weeks amd > 0.1%/w tested (10k/d tested)) means sufficient tests: WHO Assumes easy access to tests for everyone.
-
It's likely there is missing test data. Using confirmed cases migth be more accurate.
-
This positive rate is based on DMSC: Thailand Laboratory testing data. In the Daily MOPH Situation Reports is a number labelled
Total number of laboratory tests
.Total number of laboratory tests
is mislabelled and is exactly the same as the PUI number. -
see also Positive Rate: Full year, Tests per Case Graph (Positive rate inverted) could be easier to understand, Positive Rate - Top Provinces - Thailand, Positive Rate - Lowest Provinces - Thailand
-
Sources: DMSC: Thailand Laboratory testing data, Daily situation Reports, MOPH Covid-19 Dashboard
-
Confirmed cases excludes ATK Positives (unless they also had a positive PCR test). This is similar to most countries however some like Malaysia, India and UK count antigen tests in both tests and confirmed cases
-
There are more confirmed cases than positives in Thailand's testing data, this could be for various reasons but could make the positive rate lower.
-
Sources: Daily situation Reports, DMSC: Thailand Laboratory testing data
- Tests by health area: Full Year
- NOTE Excludes some proactive tests (non-PCR) so actual tests is higher
- Source: DMSC: Thailand Laboratory testing data
Shows Deaths from all causes in comparison to the min, max and mean of Deaths from the 5 years pre-pandemic.
- Note: there are many possible factors that alter deaths up or down other than uncounted Covid Deaths
- 2019 had an unusual increase in deaths compared to the previous 4 years but is unclear yet why. Excess deaths Plots excluding 2019 All | by region | by age show clearer baseline more similar to other countries.
- Compare Excess deaths across countries with OWID Excess Deaths or Economist Excess Death Tracker.
- Source Office of Registration Administration, Department of Provincial Administration
- Annoucements on free testing, free hospitalisation, free vaccines and rules changes
- English: Thailand PRD Twitter - Thailand PRD FB
- Thai: ThaiGov Covid-19 FB - MOPH Twitter
- Stats: DDC Dashboard - MOPH Hospital Capacity - TheResearcherTH (Maps) - IHME Forecasts - Reuters World Covid Tracker
- Call 1422 if you have Covid with mild symptoms
- With only a positive ATK you can register for free support during home isolation.
- If you can't isolate at home you can opt for free field hospital care once confirmed with a PCR test
- You can # for this early prevention clinical trial if you had symptoms less than 48 hours
- Call 1668 if you have Covid with severe symptoms
- Unsure of your risks with or without a vaccine? AU Risk Calc (updated for omicron) - UK Risk Calc (based on delta?)
- As the different sources of the data has increased so has the code needed fetch, extract and display this data. All the code is fairly simple python however. It is a fun way to learn scraping data and/or pandas and matplotlib.
- Find a github issue and have a go. Many are marked as suitable for beginners
- making new plots
- improve existing plots
- adding tests so it's faster to make future fixes
- improving scrapers that miss past data, e.g. vaccination reports
- Spotting breaking updates and submitting a pull request to revise the scraper
- If unsure if you are on the right track, submit a draft pull request and request a review
- Spotted a problem or got an idea how to improve? Submit an issue and then have a go making it happen.
- Got Questions? Start a discussion or comment on an issue
-
If you are using anaconda you will need to also run this
conda install -c conda-forge python-crfsuite
-
To install (requires python >=3.9)
python -m venv .venv .venv/bin/pip install -r requirements.txt
The plots are produced from csv files made in covid_data.py.
- Get the latest datasets release to speed up the process.
-
Manually: extract latest datasets into the top level of the project. It will put csv files into
api
andinputs/json
folders. -
CLI: linux(or WSL); change into the root directory of your clone of the repository and then:
wget https://github.com/djay/covidthailand/releases/download/1/datasets.tar.gz && \ tar xzf datasets.tar.gz && \ rm datasets.tar.gz
- You can run only the plot function using the USE_CACHE_DATA=True MAX_DAYS=0 env vars
- CLI (linux)
USE_CACHE_DATA=True MAX_DAYS=0 bin/python covid_plot.py
- IDE: setup a run profile in your IDE similar to this
{
"name": "covidthailand - plot",
"type": "python",
"request": "launch",
"program": "covid_plot.py",
"console": "integratedTerminal",
"env": {
"USE_CACHE_DATA":"True",
"MAX_DAYS":"0",
}
}
- You can comment out parts of covid_plot.py to skip some plots.
- In USE_CACHE_DATA only
*_3.svg
files are produced. 3 is for 3rd wave (since April 2021).
- In USE_CACHE_DATA only
- When debugging, to scrape just one part first, rearrange the lines in covid_data.py/scrape_and_combine so that the scraping function you want to debug gets called before the others do
- Extract the latest input files (~1.3G). This get the latest cache of documents to speed up scraping.
-
Manually: extract latest input files (~1.3G) into the top level of the project. It will put documents/json etc
inputs/*
folders. -
CLI: linux(or WSL); change into the root directory of your clone of the repository and then:
wget https://github.com/djay/covidthailand/releases/download/1/inputs.tar.gz && \
tar xzf inputs.tar.gz && \
rm inputs.tar.gz
- Manually
- To build the CSV files needed for plotting from the inputs downloaded above, from the root directory of the repo, run:
USE_CACHE_DATA=True python covid_data.py
-
If many days have passed since the last run then return to step 1. or slightly slow but smaller download is to download the latest datasets files which will speed up dashboard scrapping which is the slowest part.
-
If you really need to ensure all the files are scraped again then
-
To run the full scrape (warning this will take a long time as it downloads all the documents into a local cache)
bin/python covid_plot.py
-
To run the tests (will only get files needed for tests)
bin/pytest
-
To add a test
- Only add test data for dates where the format changed and so the scraper had to get updated. See commit history for dates where this happened or use code coverage.
- Logs from a full scrape can be used to also identify files/dates that are not scraped correctly
- if you are trying to add in past regression tests you can also use
git blame covid_data.py
on the scraping function to see the dates that lines were added or changed. in some cases comments indicated important dates where code had to change.
- if you are trying to add in past regression tests you can also use
- Add empty file in tests/scraper_type/dl_name.json
- for some tests can be use date of file instead or filename.date.json (the date is ignored but helps for readability)
- Run tests. This will download just the document needed for that test, scrape it and compare the results against the json.
- of course this will fail but you can look at the generated data and compare it to the original file or other sources to make sure it looks right
- If the results are correct there is commented out code in the test function to export the data to the test json file.
- if you are using vscode to run pytests you need to refresh the tests list at this point for some reason
- Note that not all scrapers have a test framework setup yet. But follow the existing code to add one or ask for help.
$ sudo gem update bundler
$ bundle config set --local path vendor/bundle
$ bundler install
$ bundle exec jekyll serve
- Dylan Jay
- Vincent Casagrande
- Peter Scully
- Jonathan Barratt sponsored by Intelligent-Bytes
- Reinhold Lauer
- join us?
Why do this? Originally to answer the question "Was Thailand doing enough testing?" for myself and because too many people were wrong on the internets.
!
This work is licensed under a Creative Commons Attribution 4.0 International License.
- Our World in Data: Thailand Profile - the best way to compare against other countries
- Pete Scully: COVID-19 Thailand Public Data for added visualisations and comparisons
- The Researcher Covid Tracker
- Stefano Starita - more excellent analysis and visualisations
- Richard Barrow - maybe the fastest way to get COVID-19 updates in English
- Thai Gov news feeds
- Thai Gov Covid Information: FB - has daily briefing infographics and broadcast (eng and thai) updated quickly
- Thai Gov Spokesman: FB,
- Thai Government PR: FB,
- Ministry of Health: Twitter,
- DMSC PR: FB
- MOPH ArcGIS - PUI + worldwide covid stats
- MOPH OPS Dashboard: ArcGIS - current usage of hospital resource but seems no longer updated (since mid last year?)
- Institute for Health Metrics and Evaluation - COVID estimates including mobility estimates from mobile phone data
- No longer updated. see commits instead
- 2021-08-16 - Move ATK to tests plot and remove from types plot
- 2021-08-16 - Plots of more age ranges for deaths, excess deaths and cases
- 2021-08-15 - Dashboard parsing for provinces and ages with downloads
- 2021-08-02 - Add ATK cases parsing from dashboard and put in case_types plot
- 2021-07-30 - Add plots for excess deaths
- 2021-07-18 - Add data on vaccines by manufacturer from vaccine slides
- 2021-07-17 - Add estimate of death ages
- 2021-07-13 - Remove import vaccines due to coldchain data being restricted
- 2021-07-10 - Switch province plots to per 100,000
- 2021-07-10 - Put actuals on main case plots
- 2021-06-29 - Use coldchain data to plot deliveries and province vac data
- 2021-06-22 - Add trending provinces for contact cases
- 2021-06-12 - Add vaccination daily and improve cumulative vaccinations
- 2021-06-05 - update vaccination reports to parse summary timeline data only (missing source)
- 2021-06-30 - death reasons and hospitalisation critical plots
- 2021-05-21 - Estimate of infections from deaths
- 2021-05-18 - Include prisons as separate province/health district (because briefings do)
- 2021-05-15 - improve highest positive rate plot to show top 5 only
- 2021-05-10 - parse unofficial RB tweet to get cases and deaths earlier
- 2021-05-07 - add trending up and down provinces for cases
- 2021-05-06 - add top 5 fully vaccinated provinces
- 2021-05-05 - added recovered to active cases
- 2021-05-04 - plots of deaths and vaccinations
- 2021-04-28 - rolling averages on area graphs to make them easier to read
- 2021-04-25 - Add graph of cases by risk and active cases (inc severe)
- 2021-04-25 - Scrape hospitalisation stats from briefing reports
- 2021-04-23 - Fixed mistake in testing data where private tests was added again
- 2021-04-22 - data for sym/asymptomatic and pui private vs pui public
- 2021-04-20 - Added case age plot
- 2021-04-18 - Added clearer positive rate by district plot and made overall positive rate clearer
- 2021-04-15 - Quicker province case type breakdowns from daily briefing reports
- 2021-04-13 - get quicker PUI count from https://ddc.moph.go.th/viralpneumonia/index.php
- 2021-04-12 - Put in "unknown area" for tests and cases by district so totals are correct
- 2021-04-05 - add tweets with province/type break down to get more up to date stats
<style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>