Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tq_exchange("NASDAQ") not working #226

Open
mdancho84 opened this issue Nov 15, 2022 · 7 comments
Open

tq_exchange("NASDAQ") not working #226

mdancho84 opened this issue Nov 15, 2022 · 7 comments

Comments

@mdancho84
Copy link
Collaborator

I'm getting the following error. It looks like 403 meaning access is being prevented. Any alternatives for getting exchange data for NASDAQ, AMEX, and NYSE?

tq_exchange("NASDAQ")
Getting data...

Error in open.connection(con, "rb") : 
  cannot open the connection to 'https://api.nasdaq.com/api/screener/stocks?tableonly=true&exchange=nasdaq&download=true'
In addition: Warning message:
In open.connection(con, "rb") :
  cannot open URL 'https://api.nasdaq.com/api/screener/stocks?tableonly=true&exchange=nasdaq&download=true': HTTP status was '403 Forbidden'
@jamesfulford
Copy link

Seems like anti-scraper filter? I can reach URL from browser but not from curl.

@gabrielodom
Copy link

Following for updates (and I will see if I can get anything to work).

@munishkgitbub
Copy link

Has this issue been sorted out? Its not giving for AMEX and NYSE exchange data also.

@marinov-alexander
Copy link

Has this issue been resolved or looked at?

@arunamalla
Copy link

yes, looks like an anti-spam filter is there.

api.nasdaq.com - sever is allowing only few values as 'User Agent' in the http request header.
below are the allowed values as user agent
{
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
}

modify package in local machine to make HTTP call with above mentioned user-agent

@mdancho84
Copy link
Collaborator Author

I will test this out. Thanks a lot. 😀

@ptoche
Copy link

ptoche commented Oct 31, 2023

I'm getting issues too, that I wasn't getting back in Jan 2022:

nyse <- tq_exchange("NYSE")
Getting data...

Error in open.connection(con, "rb") : 
  cannot open the connection to 'https://api.nasdaq.com/api/screener/stocks?tableonly=true&exchange=nyse&download=true'
In addition: Warning message:
In open.connection(con, "rb") :
  URL 'https://api.nasdaq.com/api/screener/stocks?tableonly=true&exchange=nyse&download=true': status was 'Failure when receiving data from the peer'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants