# Portugal SNS Emergency Wait Times Tracker (`trovevault/portugal-emergency-wait-times-tracker`) Actor

Track SNS hospital emergency wait times in Portugal by district. Export normalized service waits, load levels, and patient-access guidance for dashboards or alerts.

- **URL**: https://apify.com/trovevault/portugal-emergency-wait-times-tracker.md
- **Developed by:** [Trove Vault](https://apify.com/trovevault) (community)
- **Categories:** Automation, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 1,000 hospital emergency services

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Portugal SNS Emergency Wait Times Tracker: Monitor Hospital Waits by District

Portugal SNS Emergency Wait Times Tracker collects structured emergency wait-time rows for SNS hospitals in Portugal. Select one or more districts and get hospital-level service waits, normalized service categories, wait minutes, load levels, and patient-access guidance. No API key required.

This actor is built for access monitoring, dashboards, civic reporting, care-navigation tools, and recurring alerts. It is not medical advice. In a life-threatening emergency in Portugal, call 112.

---

### Why use Portugal SNS Emergency Wait Times Tracker?

- Monitor visible SNS emergency waits by district without manually checking hospital pages.
- Compare nearby SNS emergency services in one structured dataset.
- Build alerts for moderate, high, or severe emergency-load conditions.
- Feed public-health dashboards, civic reports, assistance tools, and internal monitoring workflows.
- Schedule recurring snapshots and append them to a long-term Apify dataset.

---

### What data does Portugal SNS Emergency Wait Times Tracker extract?

| Field | Description |
|---|---|
| `hospitalName` | SNS hospital or local health unit name |
| `district` | Portuguese district or autonomous-region label |
| `serviceType` | Emergency service label such as Urgência Geral, Urgência Pediátrica, or Urgência Obstétrica |
| `serviceCategory` | Normalized category such as GENERAL, PEDIATRIC, OBSTETRIC, PSYCHIATRIC, ADULT, or OTHER |
| `waitMinutes` | Visible wait time in minutes for the service or triage row |
| `serviceWaitMinutes` | Overall service wait when it differs from the triage row wait |
| `triageColor`, `triageLabel` | Manchester triage color and label when the source exposes triage rows |
| `patientsWaiting` | People waiting for a triage bucket when available |
| `overloadLevel` | Derived load level: LOW, MODERATE, HIGH, SEVERE, or UNKNOWN |
| `patientAction` | Non-medical guidance for interpreting visible load |
| `scrapedAt` | ISO timestamp for the snapshot |
| `runId` | Optional pipeline ID copied from input when supplied |

---

### Use cases

#### Track emergency access by district
Run the actor for Lisbon, Porto, Faro, or multiple districts and send the resulting rows into a dashboard or spreadsheet.

#### Build recurring pressure alerts
Schedule the actor and alert downstream systems when `overloadLevel` reaches HIGH or SEVERE for monitored services.

#### Maintain a historical access dataset
Use `datasetId` to append every scheduled snapshot into one dataset for trend analysis and reporting.

---

### Why use this actor instead of manual checks?

| Need | Manual checking | This actor |
|---|---|---|
| Multi-district monitoring | Slow and repetitive | One run can cover several districts |
| Structured output | Copy-paste cleanup required | Dataset rows are normalized |
| Recurring snapshots | Manual reminders | Schedule runs on Apify |
| Integrations | Custom glue needed | Works with datasets, API, webhooks, and MCP workflows |

---

### How to use Portugal SNS Emergency Wait Times Tracker

1. Choose one or more values in the `districts` dropdown.
2. Use `ALL` when you want a national SNS snapshot.
3. Optionally set `datasetId` to append results to an existing dataset.
4. Optionally set `runId` when another workflow needs to correlate these rows with an upstream job.
5. Run the actor, export the dataset, or connect it to a scheduled dashboard workflow.

```json
{
  "districts": ["Lisboa", "Porto"]
}
````

***

### Input

| Input | Type | Default | Description |
|---|---|---|---|
| `districts` | array | `["Lisboa"]` | Districts to monitor. Use `["ALL"]` for Portugal-wide SNS coverage |
| `datasetId` | string | empty | Existing Apify dataset ID to append rows to, in addition to the run dataset |
| `runId` | string | empty | Optional upstream run or workflow ID copied into each output row |

***

### Output

One row represents one visible hospital emergency-service wait. Some SNS data exposes service-level waits only, so triage fields appear only when available.

```json
{
  "hospitalName": "Unidade Local de Saúde de São José, EPE",
  "district": "Lisboa",
  "serviceType": "Urgência Geral",
  "serviceCategory": "GENERAL",
  "waitMinutes": 61,
  "overloadLevel": "MODERATE",
  "patientAction": "Compare nearby hospitals and consider SNS 24 guidance for non-life-threatening symptoms.",
  "scrapedAt": "2026-04-28T10:00:00.000Z"
}
```

If you provide `runId`, it is included in every pushed row:

```json
{
  "districts": ["Lisboa"],
  "runId": "daily-access-monitor-2026-04-28"
}
```

***

### How to run via the Apify API

```bash
curl -X POST "https://api.apify.com/v2/acts/trovevault~portugal-emergency-wait-times-tracker/runs?waitForFinish=120" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "districts": ["Lisboa", "Porto"]
  }'
```

***

### Limitations

- This actor is SNS-only. It does not include private hospitals.
- Some SNS rows expose service-level waits rather than Manchester triage queues.
- `patientsWaiting`, `triageColor`, and `triageLabel` appear only when the source exposes those values.
- A `0 min` wait can mean low visible load, a closed service, or missing provider data depending on the source context.
- `overloadLevel` is a derived operational signal, not a clinical recommendation.
- The actor does not replace SNS 24, 112, or provider guidance.

***

### Frequently asked questions

**Does this include private hospitals?**
No. This actor is SNS-only.

**Can I monitor multiple districts at once?**
Yes. Select multiple districts from the dropdown, or send an array such as `["Lisboa", "Porto"]` through the API.

**Can I monitor all of Portugal?**
Yes. Select `ALL` in the dropdown or send `"districts": ["ALL"]`.

**Why do some rows not have triage color or patient count?**
Some SNS emergency data exposes only service-level waits. Those rows still keep the hospital, service, district, and wait-minute fields populated.

**How should I track changes over time?**
Schedule the actor and use `datasetId` to append results into one long-term dataset, or compare each run dataset separately.

**Can I connect this to another Apify workflow?**
Yes. Use `runId` for upstream correlation, `datasetId` for appending results, and Apify webhooks for downstream triggers.

**Is this safe for medical decisions?**
No. This is an access-monitoring dataset. For life-threatening symptoms call 112. For non-emergency guidance use SNS 24 or provider instructions.

***

### Related actors

- [Academic Conference CFP & Registration Monitor](https://apify.com/trovevault/academic-conference-cfp-monitor): monitor structured deadline and registration signals from public event sources.

***

### Changelog

#### v0.1

- Initial SNS-only Portugal emergency wait-time tracker with district filtering, normalized wait minutes, load levels, `datasetId`, and `runId` integration fields.

***

### Feedback

Found a missing SNS service, confusing row, or district coverage issue? Open an issue on the Apify platform with the run ID, input, and a sample row.

# Actor input Schema

## `districts` (type: `array`):

Portuguese districts or autonomous regions to monitor. Select `ALL` for a national SNS snapshot, or select one or more districts such as `Lisboa`, `Porto`, `Faro`, or `Coimbra` for regional monitoring.

## `datasetId` (type: `string`):

ID of an existing Apify dataset to append results to, in addition to the default run dataset. Use this for recurring SNS emergency access dashboards that combine scheduled snapshots into one dataset. Leave blank to write only to the default run dataset.

## `runId` (type: `string`):

ID of an existing Apify actor run to associate results with. The actor copies this value into each dataset item so external workflows can connect SNS emergency wait rows to an upstream schedule, alert, or reporting job. Leave blank for standalone runs.

## Actor input object example

```json
{
  "districts": [
    "Lisboa"
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "districts": [
        "Lisboa"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("trovevault/portugal-emergency-wait-times-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "districts": ["Lisboa"] }

# Run the Actor and wait for it to finish
run = client.actor("trovevault/portugal-emergency-wait-times-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "districts": [
    "Lisboa"
  ]
}' |
apify call trovevault/portugal-emergency-wait-times-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=trovevault/portugal-emergency-wait-times-tracker",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Portugal SNS Emergency Wait Times Tracker",
        "description": "Track SNS hospital emergency wait times in Portugal by district. Export normalized service waits, load levels, and patient-access guidance for dashboards or alerts.",
        "version": "0.1",
        "x-build-id": "uZyveDbJTErRSc0vc"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/trovevault~portugal-emergency-wait-times-tracker/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-trovevault-portugal-emergency-wait-times-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/trovevault~portugal-emergency-wait-times-tracker/runs": {
            "post": {
                "operationId": "runs-sync-trovevault-portugal-emergency-wait-times-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/trovevault~portugal-emergency-wait-times-tracker/run-sync": {
            "post": {
                "operationId": "run-sync-trovevault-portugal-emergency-wait-times-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "districts": {
                        "title": "Districts",
                        "type": "array",
                        "description": "Portuguese districts or autonomous regions to monitor. Select `ALL` for a national SNS snapshot, or select one or more districts such as `Lisboa`, `Porto`, `Faro`, or `Coimbra` for regional monitoring.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "ALL",
                                "Acores",
                                "Aveiro",
                                "Beja",
                                "Braga",
                                "Braganca",
                                "Castelo Branco",
                                "Coimbra",
                                "Evora",
                                "Faro",
                                "Guarda",
                                "Leiria",
                                "Lisboa",
                                "Madeira",
                                "Portalegre",
                                "Porto",
                                "Santarem",
                                "Setubal",
                                "Viana do Castelo",
                                "Vila Real",
                                "Viseu"
                            ],
                            "enumTitles": [
                                "All Portugal",
                                "Acores",
                                "Aveiro",
                                "Beja",
                                "Braga",
                                "Braganca",
                                "Castelo Branco",
                                "Coimbra",
                                "Evora",
                                "Faro",
                                "Guarda",
                                "Leiria",
                                "Lisboa",
                                "Madeira",
                                "Portalegre",
                                "Porto",
                                "Santarem",
                                "Setubal",
                                "Viana do Castelo",
                                "Vila Real",
                                "Viseu"
                            ]
                        },
                        "default": [
                            "Lisboa"
                        ]
                    },
                    "datasetId": {
                        "title": "Dataset ID (optional)",
                        "type": "string",
                        "description": "ID of an existing Apify dataset to append results to, in addition to the default run dataset. Use this for recurring SNS emergency access dashboards that combine scheduled snapshots into one dataset. Leave blank to write only to the default run dataset."
                    },
                    "runId": {
                        "title": "Run ID (optional)",
                        "type": "string",
                        "description": "ID of an existing Apify actor run to associate results with. The actor copies this value into each dataset item so external workflows can connect SNS emergency wait rows to an upstream schedule, alert, or reporting job. Leave blank for standalone runs."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
