ParseForge Scrapers

Swiss BAG Infectious Diseases Scraper

parseforge/swiss-bag-infectious-diseases-scraper

Developer toolsOther

Scrapes infectious disease surveillance records from the Swiss Federal Office of Public Health (BAG). Returns case counts, incidence rates, and disease names filtered by topic, pathogen, and year range.

Run this scraper See the API call
Total users
2
Monthly active
1
Total runs
69
Bookmarked
0
Rating
Not rated yet
Last modified
9 days ago

Overview

ParseForge

Swiss BAG Infectious Diseases Scraper

Scrape Swiss infectious disease surveillance data from the Federal Office of Public Health (BAG), up to a million records per run. Every record comes with the disease name, case counts, incidence rate, and reporting year. No login or API key. Export to CSV, JSON, Excel, or XML.

The Swiss BAG publishes mandatory infectious disease surveillance data online, but manual downloads and PDF reports make trend analysis slow and error-prone. This actor reads the public data feeds directly, filtered by disease topic, specific pathogen, and year range, and returns each match in one fixed schema.

Who uses it What they scrape Swiss Federal Office of Public Health (BAG) for
Epidemiologists Monitor the weekly incidence of notifiable diseases across Swiss cantons.
Public health analysts Build long-term datasets to evaluate the impact of vaccination or prevention campaigns.
Data journalists Fact-check and source official case numbers for reporting on disease outbreaks.
Academic researchers Gather raw surveillance data for modeling the spread of respiratory or tick-borne pathogens.

What it does

This Actor collects Swiss infectious disease case records by topic, disease key, and year range, and returns each one as a flat row.

  • ๐Ÿซ Topic groups: filter by respiratory pathogens, sexually transmitted infections, foodborne diseases, or tick-borne diseases.
  • ๐Ÿ”ฌ Disease key filter: target a specific pathogen like covid19, gonorrhea, or campylobacteriosis with a substring match.
  • ๐Ÿ“… Year range: pull data from any window between 2013 and the present, one year or a decade at a time.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with Swiss Federal Office of Public Health (BAG) data

๐Ÿ“ˆ Track respiratory disease trends.

An epidemiologist pulls weekly COVID-19 and influenza case counts from 2020 to 2025 to compare seasonal peaks and prepare hospital capacity forecasts.

๐Ÿฆ  Monitor tick-borne disease spread.

A public health analyst collects Lyme disease and TBE incidence data by year to identify emerging high-risk regions for targeted awareness campaigns.

๐Ÿฝ๏ธ Investigate foodborne outbreaks.

A food safety researcher scrapes campylobacteriosis and salmonellosis records to correlate case spikes with reported contamination events.

๐Ÿ“Š Build a surveillance dashboard.

A data engineer schedules daily runs to feed a live dashboard with the latest STI case numbers for health policy advisors.

Why choose this scraper

What you get
Official source Data comes directly from the Swiss Federal Office of Public Health (BAG) surveillance systems.
Structured output Every record is a flat row with a consistent schema, ready for analysis in any tool.
No manual work Skip the PDF reports and interactive dashboards; get the raw numbers in one run.

How it compares

No other Store actor targets Swiss Federal Office of Public Health (BAG) the same way, so the honest comparison is with the alternatives teams actually weigh.

Swiss BAG Infectious Diseases Scraper Build it in-house By hand
Setup Run it now, zero config Days of engineering None, but hours per pull
When Swiss Federal Office of Public Health (BAG) changes Maintained for you You fix it You re-learn the page
Proxies, retries, anti-bot Built in Your problem Browser only
Output Fixed JSON schema, CSV/Excel export Whatever you build Copy-paste
Cost Pay per result Engineering time Analyst hours

Configure the run

Drive the Actor from a disease topic group, a specific disease key substring, and a year range, alone or together, and filters run as each record is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

{
  "yearFrom": 2020,
  "yearTo": 2025,
  "maxItems": 10
}

A larger pull:

{
  "yearFrom": 2020,
  "yearTo": 2025,
  "maxItems": 200
}

Pricing

Pay-per-result: $0.005 per result collected. You pay only for the results written to your dataset.

Results collected Approximate cost
100 results $0.50
1,000 results $5.00
10,000 results $50.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the Swiss BAG Infectious Diseases Scraper.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to Swiss Federal Office of Public Health (BAG) through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/swiss-bag-infectious-diseases-scraper"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting no results?

Check that your disease key substring matches an actual pathogen name in the BAG dataset. Also verify that your year range falls between 2013 and the current year.

The actor returns fewer records than I expected.

The BAG may not publish data for every disease in every year. Try broadening your topic filter or removing the disease key filter to see all available records.

I see an error about the year range.

Ensure yearFrom is not greater than yearTo, and that both values are between 2013 and 2100. The actor validates this before starting.

The run timed out.

If you are requesting a very large number of records, try increasing the run timeout in your Apify actor settings, or reduce the maxItems value.

Some disease names look different than I expected.

The actor returns disease keys and names exactly as labeled by the BAG. Use the disease key filter with the exact substring used in the source data.

FAQ

Question Answer
What data source does this actor use? It reads from the public infectious disease surveillance data published by the Swiss Federal Office of Public Health (BAG).
How far back does the data go? The dataset starts in 2013. You can set the yearFrom input to any year from 2013 onward.
Can I filter for a single disease? Yes. Use the disease key filter with a substring like 'covid19', 'gonorrhea', or 'campylobacteriosis' to isolate one pathogen.
What do I get in each output row? Each row contains the disease name, case count, incidence rate, reporting year, and other surveillance metadata in a flat structure.
Is an API key or login required? No. The actor reads publicly available data feeds, so no registration or authentication is needed.
Can I get data for all diseases at once? Yes. Leave the topic set to 'All topics' and the disease key empty to collect records across all available pathogens.
How many records can I collect in one run? You can set the maximum records up to 1,000,000 per run. The actual number depends on the filters you apply.
What export formats are supported? You can export your dataset to CSV, JSON, Excel, or XML from the Apify platform.
Does this cover cantonal-level data? The actor returns the data as published by the BAG. Granularity depends on what the official feed provides for each disease.
Can I schedule this actor to run weekly? Yes. Use Apify's scheduler to run the actor automatically and keep your dataset up to date with the latest surveillance numbers.

Related actors

  • google-trends-scraper: Use this to compare Swiss disease surveillance data with public search interest in health topics.

Browse the full ParseForge collection for more scrapers.

๐Ÿ†˜ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

โš ๏ธ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Swiss Federal Office of Public Health (BAG). It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

Input

FieldTypeWhat it doesDefault
topic string (5 options) Disease topic group not set
disease string Filter by disease key substring, e.g. covid19, gonorrhea, campylobacteriosis not set
yearFrom integer Earliest year to include (data starts 2013). 2020
yearTo integer Latest year to include. 2025
maxItems integer How many disease records to collect per run. 10

Pricing

from $4.52 per 1,000 results

Charged forWhat it isPrice each
result Single result in the default dataset. $0.00452 to $0.005

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

API

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST ยท run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~swiss-bag-infectious-diseases-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "helloWorld": 123
  }'

Examples

Input that runs as-is.

input.json
{
  "helloWorld": 123
}

Reviews

No reviews yet. Be the first.

Issues

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

Related scrapers

Run Swiss BAG Infectious Diseases Scraper on Apify All scrapers