API for archived goals

I am currently in the process of going through all the books I’ve read in the past few years and organizing them in my personal notes database; and as part of that I find myself looking through my archived goals to find the dates on which I started and finished each of my (completed) book reading goals. Doing this manually is a bit annoying, as this is very much the sort of task that should be automatable.

If there were an API endpoint for listing archived goals, I imagine I would do something like this:

curl -s https://www.beeminder.com/api/v1/users/me/goals/archived.json?auth_token=$TOKEN |
  jq 'map(
    select(.tags | index("book") != null ) |
    { slug: .slug, start: .fullroad[0][0], end: .fullroad[-1][0] }
  )'

That would give me a list of all archived goals tagged with "book", along with the timestamp for the beginning and end of that goal’s road.

No such API endpoint exists, unfortunately. Archived goals are individually accessible through the API, but I don’t think there is a way to list all of my archived goals.

Would anyone else have a use for such an API endpoint? And should it be a separate endpoint, or perhaps instead a query parameter that can be passed to the regular goal-listing endpoint, to ask it to include archived goals? (If so, we’d need a way to distinguish which of the goals in the list are archived and which are currently active.)

1 Like

I’m sure that will be helpful to others at some point! Consider yourself deputized to implement it in the way that makes sense for your use case! Thanks so much for doing that, and for describing such use cases here!

Your exact use case will probably be useful to me in the future, but isn’t just yet :slight_smile:

1 Like