opensdmx / rsdmx

Tools for reading SDMX data and metadata in R
https://github.com/opensdmx/rsdmx/wiki
105 stars 30 forks source link

Any SDMX Service Endpoint for Statistics Canada? #125

Open Monduiz opened 7 years ago

Monduiz commented 7 years ago

Hello,

I am working on automating the processing of official statistics in a range of applications and workflows using Statistics Canada's sources. The Canadian Agency is providing its tables from Census, National household survey and other surveys, the CANSIM database as well in the sdmx-ml format.

If I can help to add the agency as a provider by default, I would love to, otherwise, this is a request to add those sources as a provider for the sdmx package.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/44432658-any-sdmx-service-endpoint-for-statistics-canada?utm_campaign=plugin&utm_content=tracker%2F521666&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F521666&utm_medium=issues&utm_source=github).
eblondel commented 7 years ago

Hi, do you know if Statistics Canada provides a SDMX web-service API implentation ? if yes could you share the link? thanks

Monduiz commented 7 years ago

I am not sure if there is an API. My guess is no but I will ask.

The Census datasets are accessible through links like this one with the tables identified with a PID: http://www12.statcan.gc.ca/datasets/OpenDataDownload.cfm?PID=102009"

Even though they seemed to be catalogued with an id, it is not comprehensive. The link above refers to catalogue: 98-311-XCB2011022.

The CANSIM tables can be accessed through links like this one with the table number, in this case, CANSIM 2820003: http://www20.statcan.gc.ca/tables-tableaux/cansim/sdmx/02820003.zip

I will try to get more information.

Monduiz commented 7 years ago

So, there is a Web API that will launch. I will get more details soon. What would you need to make the service provider?

eblondel commented 7 years ago

When it is launched publicly, paste the URL of the web API here, better if there is some web documentation of the API. And then i can have a look to it and see feasibility to add it as embedded service endpoint!

eblondel commented 7 years ago

Hello @Monduiz any news about this new SDMX web API?

Monduiz commented 7 years ago

I will try to get an update this week and post back.

eblondel commented 7 years ago

@Monduiz did you get any update regarding an eventual SDMX web API for Statistics Canada?

eblondel commented 6 years ago

@Monduiz any reference on the web mentioning an SDMX API for Canada statistics?

Monduiz commented 6 years ago

I am going to do a follow-up this week.

eblondel commented 6 years ago

@Monduiz are you aware of any service for this? I've been searching a bit, no way to find a SDMX web-service for Statistics Canada.. is there something in beta stage?

Monduiz commented 6 years ago

@eblondel Hi! I apologize for the lack of updates. I had surgery and was stuck in bed for a few months. I want to catch up with this. Here is what I suggest, I will investigate with StatCan and start working on a way to make this happen. I am working on an analytics program proposal for my department in the Government of Canada and if we want to automate some functions, we need that form of access to the data from the agency. I will report back. Sorry again for the delay!

eblondel commented 6 years ago

No problem, hope you are recovering well. In case you need professionnal service support related to SDMX and rsdmx, let me know. http://eblondel.github.io/#/contact Best regards

Monduiz commented 5 years ago

Ok, so StatsCan has been working on implementing web service APIs, this one is for the Census profile.

Census profile

More info for developers on this page:

developers

We are still looking into the specifics and what else we can have access to and if more is coming. I will update soon.

KrishnaTO commented 4 years ago

Fairly new to SDMX but I was looking for a similar connector, and based on StatsCan's API function getFullTableDownloadSDMX, I was able to easily get the data, with help from this snippet

In my case, enter the document number to create folder, download files per document num, and switch to the folder.

library(httr) library(rsdmx)

statscanSDMX <- function(docNum) { Files<-GET(paste("https://www150.statcan.gc.ca/t1/wds/rest/getFullTableDownloadSDMX", docNum, sep = "/")) dir.create(paste(getwd(), docNum, sep = "/")) setwd(docNum) download.file(content(Files)$object, docNum, method="auto", quiet = FALSE) unzippedist<-unzip(docNum) }

file1 <- readSDMX(unzippedist[1], isURL = F)

eblondel commented 3 years ago

Thanks, it seems this is an adhoc web-service and not a standard SDMX web api, however this might be plugged into rsdmx, why not. I will look into it when i have time.

RichardMN commented 3 years ago

Just to note that there are already other R packages tailored to accessing StatsCan data:

Not to say that it might not be nice to see it among the other providers, but this may not need to be a priority.

lucasjfriesen commented 1 year ago

Thanks for those pointers @RichardMN. Looks like I'm following a few folks down this rabbit hole.

StatsCan has set up as a proper SDMX web service now. https://www.statcan.gc.ca/en/developers/sdmx/user-guide

eblondel commented 1 year ago

Thanks @lucasjfriesen for this, it's a good news, I will have a look the above link, and see if I can plug a connector asap.