I am new-ish to Python and am trying to use an API in my Jupyter notebook, which requires a token. The API is from NOAA.
I put my request in the format given on NOAA's website. Everything below is literally what I put in my code with the exception of the token itself, replaced as MYLONGTOKEN:
curl -H "token:<MYLONGTOKEN>" "https://www.ncdc.noaa.gov/cdo-web/api/v2/stations"
$.ajax({ url:<url>, data:{<data>}, headers:{ token:<token> } })
I get back a syntax error pointing at the " after MYLONGTOKEN. I have tried taking it out of the brackets and quotes, adding spaces, etc but can't seem to get rid of the error. I'm also not clear if the < token > on the second line is supposed to be replaced with the actual token, but I haven't gotten past the error in the first line to find out.
I also tried following a different syntax offered on a previous post but that gave me a JSONDECODE error.
I'm using python3 and wondering if NOAA's code might be outdated.
Any help is appreciated! Thank you.