403 forbidden error when making API call

I’m trying to make an API call using python. I am using the exact url from the python example on the api documentation for get exchange markets ticker as seen here except using my personal key instead of the demo. I also added some exception handling. No matter what I try I am hitting the first HTTPError exception “ERROR:root:Data not retrieved because HTTP Error 403: Forbidden” I am unclear why using the example code and my own key I would get a forbidden error. Can someone help?

import urllib.request
from urllib.error import HTTPError, URLError
import socket
import logging
url = “https://api.nomics.com/v1/exchange-markets/ticker?key=mykey&interval=1d,30d&currency=BTC,ETH&exchange=binance,gdax&convert=BTC
response = urllib.request.urlopen(url, timeout=10).read().decode(‘utf-8’)
except HTTPError as error:
logging.error(‘Data not retrieved because %s\nURL: %s’, error, url)
except URLError as error:
if isinstance(error.reason, socket.timeout):
logging.error(‘socket timed out - URL %s’, url)
logging.error(‘some other error happened’)
logging.info(‘Access successful.’)

Hi @kmathers,

Check out the documentation for the Exchange Markets Ticker:


At the top it says " This API endpoint is only available to customers of our paid API plans. Please go here to learn more."

From there you can see our pricing information and you can follow instructions to upgrade your plan or start a trial.