Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gebruik maken van API voor twn-lijst #9

Open
RedTent opened this issue Nov 21, 2022 · 0 comments
Open

Gebruik maken van API voor twn-lijst #9

RedTent opened this issue Nov 21, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@RedTent
Copy link
Owner

RedTent commented Nov 21, 2022

Gebruik maken van API van Aquadesk

NB de API is vrij langzaam voor het ophalen van de TWN-lijst. Direct gebruik van de API is waarschijnlijk niet ideaal, maar kan bijv. wel gebruikt worden voor controle van welke taxa missen in het package

library(httr)
library(tidyverse)

get_data <- function(url){
  
  x <- httr::GET(url)
  inhoud <- httr::content(x) 
  tibble::tibble(x = inhoud$result) %>% 
  tidyr::unnest_wider(x)
 }

urls <- paste0("https://ddecoapi.aquadesk.nl/v2/parameters?filter=parametertype:eq:%27TAXON%27&page=", 1:3)

twn <- map(urls, get_data) %>% 
  reduce(bind_rows)
@RedTent RedTent added the enhancement New feature or request label Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant