finnhub-python icon indicating copy to clipboard operation
finnhub-python copied to clipboard

Not access to Finnhub resource

Open yy824 opened this issue 1 year ago • 1 comments

Hi, dear all,

I am a new learner of Finnhub who is trying to do some basic work with Finnhub.

Finnhub-python version: 2.24.20.

Here is the code. API-key I have stored in .env with FINNHUB_KEY=xxxxxxxxxxxxxxxxxxxxxx

from decouple import config import finnhub import json import pandas as pd from pprint import pprint import requests

-# Get the tokens for API access api_key = config("FINNHUB_KEY")

-# Specify params symbol = 'IBM' interval = 'D' start_date = 1609455600 #2021-01-01 end_date = 1612047600 #2021-01-31

-# Specify endpoints base_url = 'https://finnhub.io/api/v1' endpoint = '/stock/candle?' query = f'symbol={symbol}&resolution={interval}&from={start_date}&to={end_date}&token={api_key}'

-# Get request response = requests.get(base_url + endpoint + query) pprint(response.json())

-# Convert to DataFrame data = pd.DataFrame.from_records(response.json()) data['t'] = pd.to_datetime(data['t'], unit='s') print(data.head())

Error: {'error': "You don't have access to this resource."}

Could someone help me on this point?

yy824 avatar Jul 02 '24 08:07 yy824

Same here. I have a free account and am not nowhere near the limits (https://finnhub.io/docs/api/rate-limit), so probably 95% of data is not available to free accounts, just like any other "free" financial API.

SomwareHR avatar Oct 04 '24 08:10 SomwareHR