API Query Rate

I have a few uses of the API where I want the latest data for all of my goals, such that it’s a bit easier and less “buggy” to dump all of that data from the API arbitrarily frequently. Currently I probably limit myself to a few dozen times a day, but I would happily do it a lot more if I knew that it wouldn’t be considered a waste of resources.

Even better (more efficient) would be a way to be notified when a goal is changed, or just a query parameter for goals.json to get all goals updated in the last minute-or-whatever.

So my actual question is, is it okay for me to call goals.json every five minutes (e.g.), and/or is there a more efficient way to get what I want?

1 Like

It is definitely OK to call goals.json every five minutes.

There is a webhook for each goal’s datapoints, I think, but we could definitely use better webhooks!

2 Likes

The API docs only mention webhooks for reminders. A webhook for datapoints definitely sounds useful – is that what the reminders one actually is, or is it a separate system?

I searched the API docs page more closely and found this link: Webhook/Callback documentation?

2 Likes

The datapoints webhook has existed more or less forever, predating the API, so is pretty much separate at least from the user’s perspective.

You’ll find the relevant field on each goal’s SETTINGS TAB, in the section about data sources and display precision.

I use this to chain several of my goals together, a usage which will hopefully soon become defunct.

1 Like