Using the example provided by your Python api doesn't seem to work. From the code below, I get the response `You must include a hapi_key or access_token attribute when initalizing the API.
from hubspot import HubSpot
try:
tokens = HubSpot().auth.oauth.default_api.create_token(
grant_type="authorization_code",
redirect_uri='http://localhost',
client_id=client_id,
client_secret=client_secret,
code='code'
)
except Exception as e:
print(e)
I am not very familiar with getting HubSpot data via the OAuth method, but I do not see where you are referrencing your API key. I'd start here for getting your data via OAuth.
You can also start here as a means to get your data with the API key, which I found more straightforward than OAuth.