Skip to content

Infodengue data

get_infodengue(api_key, disease, start_date, end_date, uf=None, geocode=None)

Fetch InfoDengue Data from Mosqlimate API for dengue, zika, or chikungunya.

Parameters

api_key : str
    API key used to authenticate with the Mosqlimate service.
disease : {'dengue', 'zika', 'chikungunya'}
    The arbovirus to retrieve data for.
start_date : date or str
    Start date of the data range (as a `datetime.date` or ISO format string).
end_date : date or str
    End date of the data range (as a `datetime.date` or ISO format string).
uf : types.UF, optional
    The Brazilian state abbreviation (e.g., 'SP', 'RJ'). If provided without `geocode`, filters by state.
geocode : int, optional
    IBGE geocode of a municipality. If provided, overrides `uf`.

Returns

pandas.DataFrame DataFrame containing the epidemiological time series data for the specified region and time period. Detailed descriptions of each column in the DataFrame can be found in the official API documentation: https://api.mosqlimate.org/docs/datastore/GET/infodengue/

Notes

Either uf or geocode must be provided to specify the target geographic area.

Examples

get_infodengue( ... api_key="your_api_key", ... disease="dengue", ... start_date="2023-01-01", ... end_date="2023-03-01", ... uf="RJ" ... )

Source code in mosqlient/datastore/_infodengue_get_impl.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def get_infodengue(
    api_key: str,
    disease: Literal["dengue", "zika", "chikungunya"],
    start_date: date | str,
    end_date: date | str,
    uf: Optional[types.UF] = None,
    geocode: Optional[int] = None,
) -> pd.DataFrame:
    """
    Fetch InfoDengue Data from Mosqlimate API for dengue, zika, or chikungunya.

    Parameters
    ----------
        api_key : str
            API key used to authenticate with the Mosqlimate service.
        disease : {'dengue', 'zika', 'chikungunya'}
            The arbovirus to retrieve data for.
        start_date : date or str
            Start date of the data range (as a `datetime.date` or ISO format string).
        end_date : date or str
            End date of the data range (as a `datetime.date` or ISO format string).
        uf : types.UF, optional
            The Brazilian state abbreviation (e.g., 'SP', 'RJ'). If provided without `geocode`, filters by state.
        geocode : int, optional
            IBGE geocode of a municipality. If provided, overrides `uf`.

    Returns
    -------
    pandas.DataFrame
        DataFrame containing the epidemiological time series data for the specified region and time period.
        Detailed descriptions of each column in the DataFrame can be found in the official API documentation:
        https://api.mosqlimate.org/docs/datastore/GET/infodengue/

    Notes
    -----
    Either `uf` or `geocode` must be provided to specify the target geographic area.

    Examples
    --------
    >>> get_infodengue(
    ...     api_key="your_api_key",
    ...     disease="dengue",
    ...     start_date="2023-01-01",
    ...     end_date="2023-03-01",
    ...     uf="RJ"
    ... )
    """

    return pd.DataFrame(
        Infodengue.get(
            api_key=api_key,
            disease=disease,
            start=start_date,
            end=end_date,
            uf=uf,
            geocode=geocode,
        )
    )