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

403 Error when pulling data from api #49

Open
ramk01 opened this issue Feb 17, 2023 · 10 comments
Open

403 Error when pulling data from api #49

ramk01 opened this issue Feb 17, 2023 · 10 comments

Comments

@ramk01
Copy link

ramk01 commented Feb 17, 2023

symbol="AAPL"
api_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote/?token={IEX_CLOUD_API_TOKEN}'#base url
#print(api_url)
data=requests.get(api_url)
print(data.status_code)

Hi I am using this code to pull data but instead end up getting 403 error. Any solutions?

@NTYDOLab
Copy link

Solution:

  1. Open a https://iexcloud.io/ account
    a.Create a new account
    b.Go to Dashboard and copy "secret" from WORKSPACE API token. #https://iexcloud.io/console/home
    c.open Jupyter file secrets.py and paste your new "secret". #http://localhost:XXXX/tree/algorithmic-trading-python/starter_files
    d.retry pulling data.

@anilegin
Copy link

Solution:

  1. Open a https://iexcloud.io/ account
    a.Create a new account
    b.Go to Dashboard and copy "secret" from WORKSPACE API token. #https://iexcloud.io/console/home
    c.open Jupyter file secrets.py and paste your new "secret". #http://localhost:XXXX/tree/algorithmic-trading-python/starter_files
    d.retry pulling data.

still getting the 403 status code

@johnpd
Copy link

johnpd commented Feb 23, 2023

This works (get your public key and change your secrets.py (in my case I had to change secrets.py to api.py as it breaks numpy)

My workspace is called Algorithmic (you can call it anilegin as an example in the console you create it.

symbol = 'AAPL'
api_url = f'https://ALGORITHMIC.iex.cloud/v1/data/core/quote/{symbol}?token={IEX_CLOUD_API_TOKEN}'
print(api_url)
data = requests.get(api_url).json()
print(data)

@munirahd
Copy link

munirahd commented Apr 3, 2023

better to follow the same steps as above

This works (get your public key and change your secrets.py (in my case I had to change secrets.py to api.py as it breaks numpy)

My workspace is called Algorithmic (you can call it anilegin as an example in the console you create it.

symbol = 'AAPL' api_url = f'https://ALGORITHMIC.iex.cloud/v1/data/core/quote/{symbol}?token={IEX_CLOUD_API_TOKEN}' print(api_url) data = requests.get(api_url).json() print(data)

thank you your solution had helped so much .. however I advise to do the following *this what worked for me *

  1. Create a new account
  2. Go to Dashboard and copy "public key" from WORKSPACE API token.
  3. open Jupyter file secrets.py and paste your new key.
  4. paste API URL instead it mentioned in thier docs and it is the same data as the video https://cloud.iexapis.com/stable/stock/aapl/quote?token=YOUR_TOKEN_HERE
  5. restart the kernal and try to pull the data again

the link is displayed in their website
image

@Shanu2092
Copy link

Shanu2092 commented Apr 3, 2023

import requests

symbol = "AAPL"
#IEX_CLOUD_API_TOKEN = "your_api_token_here" # replace with your actual API token
api_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote/?token=sk_47bb0c7b1acd49fe883ab7bde495b8b8' # base url

response = requests.get(api_url)

if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Error: {response.status_code}")

Still giving error 403

  1. Added new token from a new account
  2. Changed names,didnt work
  3. replaced token id with the token itself

@yichenCY
Copy link

But this one is real-time data which need to purchase after 7 days trial

@rayna0921
Copy link

Solution:

  1. Open a https://iexcloud.io/ account
    a.Create a new account
    b.Go to Dashboard and copy "secret" from WORKSPACE API token. #https://iexcloud.io/console/home
    c.open Jupyter file secrets.py and paste your new "secret". #http://localhost:XXXX/tree/algorithmic-trading-python/starter_files
    d.retry pulling data.

and i change the sandbox into https://cloud.iexapis.com/, it worked then

@kiet-doki
Copy link

This works (get your public key and change your secrets.py (in my case I had to change secrets.py to api.py as it breaks numpy)

My workspace is called Algorithmic (you can call it anilegin as an example in the console you create it.

symbol = 'AAPL' api_url = f'https://ALGORITHMIC.iex.cloud/v1/data/core/quote/{symbol}?token={IEX_CLOUD_API_TOKEN}' print(api_url) data = requests.get(api_url).json() print(data)

works for me! thanks a lot

@Ni-zav
Copy link

Ni-zav commented Jun 13, 2024

In my case there is no register new account button on the login/register page on IEX cloud, is there any help for this?

@Surtur-Rising
Copy link

Surtur-Rising commented Jun 20, 2024

In my case there is no register new account button on the login/register page on IEX cloud, is there any help for this?

I have the same issue and cannot make a new account but found this site

https://iexcloud.io/product-bulletin

They are ending their service and the data will be availibly from intrinio.com
https://intrinio.com/iex-cloud

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

No branches or pull requests