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

Can't generate API token #52

Open
marcelxelo opened this issue Sep 8, 2023 · 19 comments
Open

Can't generate API token #52

marcelxelo opened this issue Sep 8, 2023 · 19 comments
Assignees
Milestone

Comments

@marcelxelo
Copy link

Hi there,

I'm trying to get the IUCN categories for some species. For that you need a key, which one should be able to generate here:
https://apiv3.iucnredlist.org/api/v3/token

Nonetheless, the link doesn't work, and therefore I cannot retrieve any kind of information form rredlist.

Cheers,
Marcel

@willgearty
Copy link
Contributor

It looks like the red list API is currently down, as you've identified. Unfortunately, I'm not affiliated with IUCN, so there's not much I can do on my end. Hopefully the issue will be resolved soon.

@willgearty
Copy link
Contributor

I reached out to the Red List team, and unfortunately, I received the following reply:

Thank you for your email and apologies for this issue. The API token request system is currently down. Unfortunately we don't have a timescale on when it might be possible to get it running again, and there is no other way to generate a token.

@magpiedin
Copy link

magpiedin commented Oct 3, 2023

In case it helps in the meantime, GBIF looks like it has a recent (May 2023) snapshot of the IUCN Red List dataset -- including threat status: https://www.gbif.org/dataset/19491596-35ae-4a91-9a98-85cf505f1bd3

You might be able to sub in something from rgbif for now to cover some rredlist options -- e.g.:

iucn_check <- name_lookup("Echinus esculentus", datasetKey = "19491596-35ae-4a91-9a98-85cf505f1bd3")

iucn_check$data[,c("speciesKey", "scientificName", "threatStatuses")]

# # A tibble: 1 × 3
#    speciesKey   scientificName                      threatStatuses 
#         <int>   <chr>                               <chr>          
#  1  176596789   Echinus esculentus Linnaeus, 1758   NEAR_THREATENED

@martijnvandepol
Copy link

I also reached out to the Red List team last week, no response. Looks like the API route is dead for now with no outlook on a solution. Anyone have some ideas on other ways to get access to historical IUCN Red List dataset to look at changes over time?

@klausriede
Copy link

maybe on CD (at least for older versions...)

@malmagrok
Copy link

I found a fairly simple way to access it. On the page they have several examples of the outputs. Just by copying the API of the example (visible in the url) it is possible to access the dataset.

@simon-tarr
Copy link

Hi Everyone, I'm Simon and I'm the Conservation Informatics Manager at the IUCN. As you've rightly identified, we're having some issues with the v3 API at the moment - we had to turn off token generation while we work to understand a few technical issues with this aging system. We've ended up getting a little sidetracked with this work as we've been pulled away to work on the 2023-1 Red List update, so fixing the API token system has, unfortunately, fallen by the wayside. I apologise that this hasn't been communicated more clearly.

As @malmagrok points out you could, for now, use the example API token on the understanding that you are allowed to use IUCN Red List data as per the terms and conditions i.e. for non-commercial purposes

Now to the good news. We're actively working on a "next-gen" API (v4) and we hope to have a beta version ready in Q1 2024 (but this might spill over into early Q2 2024) @willgearty Would you be the best person to contact nearer release about updating rredlist with the new endpoints? We will be looking to deprecate the v3 API before the end of 2024.

Cheers!

@willgearty
Copy link
Contributor

Thanks for the information @simon-tarr, and it's great news that you're working on a new API. Yes, please reach out to me closer to the release so I can update rredlist!

@simon-tarr
Copy link

Great! I'll be in touch soon.

@benscarlson
Copy link

It will be nice to have the iucn api functioning again!

@mcauchoix
Copy link

Hello,
It can't generate a token on my side neither. And I don't see the examples mentioned by @malmagrok on the webpages. Is there any other solution?
Best

@willgearty
Copy link
Contributor

@mcauchoix the examples are here. For example, to get the count of species in the API, you could go here. That latter link has the example token that you can use, provided you are using it for non-commercial purposes as described above.

@ToleranceTrading
Copy link

@simon-tarr Hi Simon, it appears that the API is still down?

@willgearty willgearty added this to the v1.0 milestone Apr 26, 2024
@willgearty willgearty self-assigned this Apr 26, 2024
@simon-tarr
Copy link

Dear All, this is to let you know that you can now sign up for the new v4 API here: https://api.iucnredlist.org/users/sign_up./

Note that the new API is still in beta so things may change from time to time until we're out of the beta phase. Also, to the best of my knowledge, none of the community R packages that query the v3 API have been updated to query the v4 API so, until this work can happen, you will have to develop your own methods for extracting data from the API e.g with httr2.

@Andresmrv3
Copy link

Good news!

@willgearty
Copy link
Contributor

My plan is to update the rredlist package before the end of the summer. Feel free to reply here with anything you see in the new API that you'd like to see included in the new version of the package!

@Andresmrv3
Copy link

Does the api support python? Error 401 using requests, forbidden. I can access it on the website but not in python.

@simon-tarr
Copy link

I'm not sure why you're getting the 401 error @Andresmrv3 - the API is language agnostic as it's just a regular old OpenAPI spec API. Have you signed up to the new v4 API and provided your v4 token (displayed in your user area after signing up)

@Andresmrv3
Copy link

@simon-tarr Fixed. I was using bearer authorization, that was the problem. I can't wait to explore! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests