The SINCA module provides a set of helper functions and one main entry point for retrieving hourly PM2.5 data from SINCA — Chile’s Sistema de Información Nacional de Calidad del Aire, operated by the Ministerio del Medio Ambiente. Unlike the OpenAQ integration, SINCA does not offer a public REST API, so data is obtained by scraping the SINCA web portal HTML and CGI download endpoints. The module is structured as a pipeline of increasingly granular helpers — from listing all stations in a region, through extracting sensor metadata and download links, down to parsing the raw semicolon-delimited CSV files — topped by the all-in-oneDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/NASAARSET/PM2.5_AQ_Online_2026/llms.txt
Use this file to discover all available pages before exploring further.
F_get_SINCA_from_web function, which mirrors the interface
of F_get_OpenAQ_from_API and returns data in the same (lat, lon, time)
MultiIndex format.
Use F_get_SINCA_from_web as a drop-in replacement for (or complement to)
F_get_OpenAQ_from_API when working with Chilean monitoring sites, especially
in regions not yet fully covered by OpenAQ.
get_sinca_region_stations
List all monitoring stations belonging to a SINCA administrative region.
Parameters
Roman-numeral region code used by the SINCA portal. Examples:
A full list of codes is available on the
SINCA portal.
| Code | Region |
|---|---|
'I' | Tarapacá |
'II' | Antofagasta |
'VIII' | Biobío |
'RM' | Región Metropolitana de Santiago |
'XIV' | Los Ríos |
Return Value
A DataFrame with one row per station and the following columns:
| Column | Description |
|---|---|
region_id | The region code passed as input |
station_id | Numeric SINCA station identifier |
station_name | Human-readable station name |
station_url | Full URL of the station page on sinca.mma.gob.cl |
Example
get_sinca_station_metadata
Extract the geographic coordinates of a single SINCA station.
Parameters
Full URL of the SINCA station page (as returned in the
station_url column
of get_sinca_region_stations). The function parses the embedded Google
Maps JavaScript on the page to locate the latitude and longitude values.Return Value
A dictionary with keys:
| Key | Type | Description |
|---|---|---|
'lat' | float | Station latitude in decimal degrees (negative = south) |
'lon' | float | Station longitude in decimal degrees (negative = west) |
Example
get_sinca_station_graph_links
Find all data/graph download links on a SINCA station page.
Parameters
Full URL of the SINCA station page. The function parses the anchor elements
on the page to extract links pointing to pollutant-specific graph/data
subpages.
Return Value
A DataFrame with one row per pollutant/sensor combination:
| Column | Description |
|---|---|
link_text | Display text of the link (e.g., 'PM2.5', 'PM10', 'SO2') |
graph_url | Full URL of the data/graph subpage for that pollutant |
get_sinca_macro_options
Extract the macro CGI parameter needed to construct SINCA download requests.
Parameters
URL of a pollutant data/graph subpage (from the
graph_url column of
get_sinca_station_graph_links). The function parses the left navigation
frame of the page to retrieve the macro values used by the SINCA download
CGI endpoint.Return Value
A DataFrame with one row per available time-aggregation option:
| Column | Description |
|---|---|
option_text | Human-readable option label (e.g., 'Horario' for hourly) |
macro_value | Numeric macro parameter value to pass to the download CGI |
_parse_sinca_hourly
Parse a raw SINCA hourly CSV text blob into a tidy DataFrame.
This is a private helper function (indicated by the leading underscore).
It is called internally by
_download_one_station_pm25 and is not intended
for direct use. It is documented here for transparency and debugging purposes.Parameters
The raw text content of a SINCA hourly CSV download. The expected column
layout is fixed by column position, not header name:The parser prefers validated data over preliminary data over non-validated
data, in that order of priority.
Return Value
A DataFrame with columns:
| Column | Description |
|---|---|
datetime_local | Local Chile time as a datetime object |
PM2.5 | PM2.5 concentration in µg/m³ (best available validation tier) |
status | Data quality label: 'validated', 'preliminary', 'not_validated', or 'no_data' |
_download_one_station_pm25
Download hourly PM2.5 data for a single SINCA station over a date range.
This is a private helper function called internally by
F_get_SINCA_from_web. It is documented here for reference when debugging
individual-station download failures.Parameters
A single row from the DataFrame returned by
get_sinca_region_stations,
providing the station_url and other metadata needed to construct the
download request.Start date for the download, as a string in
'YYYY-MM-DD' format.End date for the download (inclusive), as a string in
'YYYY-MM-DD' format.Return Value
A tidy DataFrame with columns
datetime_local, PM2.5, and status for
the requested station and date range, or None if PM2.5 data is unavailable
for that station.F_get_SINCA_from_web
The main entry point: download hourly PM2.5 for all SINCA stations within a
geographic bounding box and time window.
Parameters
Minimum (western) longitude of the bounding box, in decimal degrees.
Minimum (southern) latitude of the bounding box, in decimal degrees.
Maximum (eastern) longitude of the bounding box, in decimal degrees.
Maximum (northern) latitude of the bounding box, in decimal degrees.
Start of the time window of interest. Must be a
numpy.datetime64 object.End of the time window of interest. Must be a
numpy.datetime64 object.Return Value
A
pandas.DataFrame with a three-level MultiIndex of (lat, lon, time) and
a 'PM2.5' column containing hourly concentrations in µg/m³. This is the
same format as the DataFrame returned by F_get_OpenAQ_from_API, making the
two functions interchangeable as inputs to F_compute_metrics.Returns None if no SINCA stations with PM2.5 data are found in the
specified region and time window.Usage Example
Combining SINCA and OpenAQ data
Because both functions return identical DataFrame formats, their outputs can be concatenated for a more complete ground-observation dataset:SINCA monitors report data in local Chilean time (CLT/CLST, UTC-4/UTC-3
depending on daylight saving). The functions convert timestamps to UTC before
building the final MultiIndex to ensure consistency with OpenAQ data, which
is always reported in UTC.
Related
F_get_OpenAQ_from_API— the equivalent function for OpenAQ ground observations; same output format.F_compute_metrics— pass the returned DataFrame as ground-truth input for satellite validation.F_plot_map— plot SINCA monitor locations and concentrations as point data viaa_data_plot_point.- SINCA Data Source — background on the SINCA network, data quality tiers, and regional coverage.
