getwilds / cancerprof

API Client for State Cancer Profiles
http://getwilds.org/cancerprof/
Other
2 stars 3 forks source link

Historical Trends Data #82

Open howardbaek opened 3 months ago

howardbaek commented 3 months ago

Do we have a function to extract "Historical Trends" data? For ex, https://statecancerprofiles.cancer.gov/historicaltrend/index.php?0&9953&999&7599&001&001&28&0&0&0&1&1&1&1#results

The URL to "Export Data" on the "Historical Trends" page is not pretty, to say the least: https://statecancerprofiles.cancer.gov/historicaltrend/data.php/historicaltrend.csv?0&9953&999&7599&001&001&00&0&0&0&2&0&1&1&6.

If we don't have a function already, I'm not sure how to use httr2 to grab this data. I may have to scrape this data using rvest.

realbp commented 3 months ago

We do not have a function for historical trends, although this is something that Sean and I discussed in the past but have not prioritized yet. I think it is possible to use httr2 to get the data, the numbers in the url are the same numbers in the "handle_X" functions used to code race, sex, FIPS, etc but this has not be fully decoded yet.

@seankross any thoughts on if we should explore this again?