# Retrieve HAB Data From IOC-UNESCO Databases

## IOC-UNESCO Databases

The Intergovernmental Oceanographic Commission (IOC) of UNESCO is the United Nations body dedicated to supporting global ocean science, services, and governance. The IOC-UNESCO Taxonomic Reference List of Harmful Microalgae focuses on species known to produce toxins or exhibit toxic effects, along with a few species suspected of toxin production. All toxic species in the list are verified with WoRMS to ensure accurate taxonomy.

The IOC-UNESCO Toxins database complements this list by providing detailed reference information about toxins, some of which are associated with harmful algal events.

The information from these databases can be access through APIs, as demonstrated in this tutorial using `SHARK4R`.

## Getting Started

#### Installation

You can install the latest version of `SHARK4R` from CRAN using:

    install.packages("SHARK4R")

Load the `SHARK4R` and `dplyr` libraries:

    library(SHARK4R)
    library(dplyr)

## Retrieve HAB List From IOC Taxonomic List

The complete HAB list, including scientific names and AphiaIDs, can be downloaded from the IOC-UNESCO Taxonomic Reference List of Harmful Microalgae. The output fields are customizable through function parameters—for example, setting `classification = FALSE` excludes higher taxonomic information from the results.

    # Retrieve complete HAB list
    hab_list <- get_hab_list()

    # Print result as tibble
    tibble(hab_list)

    ## # A tibble: 695 × 29
    ##    AphiaID ScientificName      Authority AphiaID_accepted ScientificName_accep…¹
    ##      <dbl> <chr>               <chr>                <dbl> <chr>
    ##  1 1653558 Aerosakkonemataceae Struneck…          1653558 Aerosakkonemataceae
    ##  2  836651 Aetokthonos         S.B.Wild…           836651 Aetokthonos
    ##  3  841664 Aetokthonos hydril… S.B.Wild…           841664 Aetokthonos hydrillic…
    ##  4  231787 Akashiwo            G.Hansen…           231787 Akashiwo
    ##  5  232546 Akashiwo sanguinea  (K.Hiras…           232546 Akashiwo sanguinea
    ##  6  109470 Alexandrium         Halim, 1…           109470 Alexandrium
    ##  7  109707 Alexandrium affine  (H.Inoue…           109707 Alexandrium affine
    ##  8  231872 Alexandrium anders… Balech, …           246835 Alexandrium andersonii
    ##  9  246835 Alexandrium anders… Balech, …           246835 Alexandrium andersonii
    ## 10  233452 Alexandrium angust… F.J.R.Ta…           109711 Alexandrium minutum
    ## # ℹ 685 more rows
    ## # ℹ abbreviated name: ¹​ScientificName_accepted
    ## # ℹ 24 more variables: Authority_accepted <chr>, Fossil <dbl>, Kingdom <chr>,
    ## #   Phylum <chr>, Class <chr>, Order <chr>, Family <chr>, taxonRank <chr>,
    ## #   Genus <chr>, Subgenus <lgl>, Species <chr>, Subspecies <lgl>, Marine <dbl>,
    ## #   Brackish <dbl>, Fresh <dbl>, Terrestrial <dbl>, taxonomicStatus <chr>,
    ## #   Qualitystatus <chr>, Unacceptreason <chr>, DateLastModified <date>, …

## Retrieve HAB Toxins From IOC Toxins Database

The complete Toxin list can be downloaded from the IOC-UNESCO Toxins database using the `get_toxin_list()` function.

    # Retrieve complete toxin list
    toxin_list <- get_toxin_list()

    ## Warning in get_toxin_list(): Partial response detected during download. Returning only complete toxin records. Error: Could not resolve hostname [toxins.hais.ioc-unesco.org]:
    ## Could not resolve host: toxins.hais.ioc-unesco.org

    # Print result as tibble
    tibble(toxin_list)

    ## # A tibble: 0 × 0

## Citation

    ## To cite package 'SHARK4R' in publications use:
    ##
    ##   Lindh, M. and Torstensson, A. (2025). SHARK4R: Accessing and
    ##   Validating Marine Environmental Data from 'SHARK' and Related
    ##   Databases. R package version 1.0.2.
    ##   https://CRAN.R-project.org/package=SHARK4R
    ##
    ## A BibTeX entry for LaTeX users is
    ##
    ##   @Manual{,
    ##     title = {SHARK4R: Accessing and Validating Marine Environmental Data from 'SHARK' and Related Databases},
    ##     author = {Markus Lindh and Anders Torstensson},
    ##     year = {2025},
    ##     note = {R package version 1.0.2},
    ##     url = {https://CRAN.R-project.org/package=SHARK4R},
    ##   }