expersso / OECD

Reproducible and programmatic access to OECD data
126 stars 20 forks source link

Error get_dataset() #13

Open amgiraldi opened 5 years ago

amgiraldi commented 5 years ago

Hi,

I am having the following issue trying to access the data through R:

library(OECD) dataset <- get_dataset("DUR_D")

Error in function (type, msg, asError = TRUE) : Unknown SSL protocol error in connection to stats.oecd.org:443

I saw an earlier post on an error using get_databases, but this seems to be something different.

I am using Rstudio 1.1.447 on a Window OS. Any help will be greatly appreciated.

Thanks!!

Antonio

luifrancgom commented 1 year ago

Hello amgiraldi,

I understand that this response may come late. The current issue maybe[^1] lies in the fact that your attempted query is comprehensive:

https://stats.oecd.org/restsdmx/sdmx.ashx/GetData/DUR_D/AUS+AUT+BEL+CAN+COL+CRI+CZE+DNK+EST+FIN+FRA+DEU+GRC+HUN+ISL+IRL+ISR+ITA+JPN+KOR+LVA+LTU+LUX+MEX+NLD+NZL+NOR+POL+PRT+SVK+SVN+ESP+SWE+CHE+TUR+GBR+USA+OECD.MEN+WOMEN+MW.1519+1524+2024+2554+5564+6599+900000.UN1+UN2+UN3+UN4+UN5+UN+UND+UNK.A/all?startTime=1968&endTime=2022

It could be more efficient to refine your data filtering strategy. Remember that by omitting the arguments filter, start_time, and end_time, you're essentially attempting to download all dimensions and observations from the earliest recorded data point onwards.

To optimize your query results, consider implementing more specific filters to narrow down the dataset. This approach will enhance the usability and efficiency of your data retrieval process.

For example try something like:

get_dataset(dataset = 'DUR_D',
            filter = 'AUS.MEN.1519.UN1.A',
            start_time = 2018, end_time = 2018, 
            pre_formatted = TRUE)

To understand first the data. Also take into account the sometimes the data don't exist like in:

get_dataset(dataset = 'DUR_D',
            filter = 'AUS.MEN.1519.UN1.A',
            start_time = 2019, end_time = 2019, 
            pre_formatted = TRUE)

So the API will generate a message like No Results Found - No Results Found and in R you will get something like HTTP status was '404 Not Found'

[^1]: Because 443 begins with 4 it means that the request contains bad syntax or cannot be fulfilled. However searching here I was not able to find a comprehensive explanation about 443.