Issue with nome_get_data
Closed this issue · 3 comments
Hi I'm getting the following error. It was working before.... The other functions work i.e. get_metadata. Is it an issue with the API itself?
jobseekers_country <- nomis_get_data(id = "NM_1_1", time = "latest",
geography = "TYPE499",
measures = c(20100, 20201), sex = 5)
Nomis API did not return data in required CSV format
I can't reproduce the error on my end, it is likely an issue with the API itself. I'm not aware of any schedule maintenance by Nomis but try it again in a few minutes and see what happens.
Hi the issue is linked to the api key.
I tried nomis_api_key(check_env = FALSE) and entered the private api key from the nomis website after registration. I then executed the nomis_get_data function and it ceased working.
When I execute nomis_api_key(check_env = TRUE) and enter the private api key I get the following error-
Warning message:
In nomis_api_key(check_env = TRUE) :
Couldn't find environment variable 'NOMIS_API_KEY'
What am I doing wrong?
Try setting an environmental variable of 'NOMIS_API_KEY'
in the .Renviron
file (I use usethis::edit_r_environ()
as a shortcut). Also check what happens if you try the query without the API key, for the example you gave above you don't need a key. Restart your R session and try again.