sofarocean/sofar-api-client-python

general token for prototyping?

Opened this issue · 3 comments

I'm prototyping and debuging some code that I'd like to run later this season when my buoy gets redeployed. In the meantime, is there a way for me to point my requests at an open-access buoy that is deployed?

tcj commented

Hi @ryancoe

Indeed! Signing up for a Trial API account would grant you access to SPOT-0222. You can log in to weather.sofarocean.com, click "Get Your API Token," and start a trial. The instructions are also written up here.

Hope that helps.

Thans @tcj!

@tcj - We tried to query SPOT-0222 again recently for development/prototyping, but that didn't seem to work. I'm guessing this is because, as you mention above, access to SPOT-0222 was related to some sort of trial period. Is the best course of action to sign up for a new trial, or is there a public buoy that we can always query (this would be helpful, as we'd like to release our code open-source).

Python code
from pysofar.sofar import SofarApi
from pysofar import get_token
sofar_token = my_token # replace with token
get_token()
sofar = SofarApi(sofar_token)
sofar
spotter_grid = sofar.get_spotters()
[spotter.id for spotter in spotter_grid]
['SPOT-0589']

CC @andermi @hamilton8415