
Using this link address, we expect to get a direct download of the data into a CSV file (note that your crumb= will differ from ours): Note: The context menu that contains Copy link address looks different in each browser.

But, we want a process that does not require us to click in the browser.īecause we know the HTTP procedure, we right-click Download Data and then select Copy link address as shown from a screen shot using the Google Chrome browser below: We could save this CSV file and read it into SAS. We click Historical Data -> Download Data and get a CSV file with historical stock price data for Apple. To access the historical data for Apple stock (symbol: AAPL) on the Yahoo Finance website, we use this URL: To help you automate downloads from websites that do not have an API, this blog post takes you through how we used the DEBUG feature of PROC HTTP to achieve partial automation, and eventually full automation with this case. While working on this case, we discovered that the Yahoo Finance website requires a cookie-crumb combination to download. This SAS programmer wanted to download historical stock price data "unattended," without having to click through a web page.

As an example, the Yahoo Finance website recently changed their service to decommission their API, and this generated an interesting challenge for one of our customers. We have had several requests from customers who want to use SAS® software to automate the download of data from a website when there is no application programming interface (API) to do it. This blog post was also written by SAS' Bari Lawhorn.
