Closed mcfsalla closed 3 years ago
Here's the website. https://www.nasdaq.com/market-activity/stocks/screener?exchange=nyse
I can't find the link that will download the CSV from it. Seems like they don't want people getting the CSV via CURL.
Yes, I figured it out, sorry for not closing the issue. On 29 Jan 2021 16:49 -0300, Matt Dancho notifications@github.com, wrote:
Here's the website. https://www.nasdaq.com/market-activity/stocks/screener?exchange=nyse I can't find the link that will download the CSV from it. Seems like they don't want people getting the CSV via CURL. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I ran into the same issue. I found when you click on the download CSV button there is an API call made that returns a JSON envelope back with the info. No authorization header required.
The exchange can be tweaked, the limit=25 doesn't seem to matter.
Awesome! This could be the solution.
Ran into the same problem:
tq_exchange("NASDAQ")
Error: Can't rename columns that don't exist.
x Column `Symbol` doesn't exist.
Looking for guidance from the team, It seems like this is the path to a solution: https://stackoverflow.com/questions/37996827/convert-json-file-to-a-csv-file-using-r
Agree?
I ended up using httr's GET() function which can do json parsing. It produces a data frame with the column headers and a list of rows, each being a list of values.
Solution seems straightforward. I'm tied up and won't be able to tackle for a bit. If someone can make a pull request, it would be much appreciated. Otherwise I'll tackle once I get some free time.
I tried to fix it, works for me: https://github.com/business-science/tidyquant/pull/194
Hey everyone, #194 has just been merged. Thanks @mgei for helping with integrating. It works very fast. Give him a 👏
Until this fix gets to CRAN please install using:
remotes::install_github("business-science/tidyquant")
The tq_exchange function is returning the same error for any exchange: Error: Can't rename columns that don't exist. x Column 'Symbol' doesn't exist.