Setting a Break in the API (seeking custom days off per week)

I was wondering if there was any way to set a break for a goal in the Beeminder API currently?

Specifically, I’m aiming to use the API to accomplish something similar to weekends off but not restricted to only taking weekends off (e.g. taking Tues-Wed off). Is this a supported use case?

It may be possible to hack something together by setting a rate of zero in the API for the break and then resetting the rate to its previous value. This is a bit hacky though and would require remembering the goal’s original rate.

2 Likes

Yes, you can submit the road through API, so it should be pretty easy to have a script create the road fragments based on your needs and then submit without doing that manually through the road editor.

3 Likes

I would love if a new feature were added to the API that let you specify two dates and the rate this portion of the graph should be set to. Would have made some of my previous projects a ton easier.

Something like:

curl -X PUT https://www.beeminder.com/api/v1/users/alice/goals/exercise/graph.json \
    -d auth_token=abc124 \
    -d start=2025-06-01 \
    -d end=2025-06-07 \
    -d rate=3
3 Likes

Thanks both! Seems like there’s a functional if somewhat cumbersome solution.

I’ll do some testing with the API and see what I can come up with. If it’s any good or sufficiently generalizable I’ll share a github link here.

+1 to being able to specify a start/end time for rate changes. That would be very helpful.

2 Likes

I did have a script to do this through road changes, but then my laptop died without a backup and I never got around to rewriting it…

Alright, here it is: GitHub - maxtrussell/bee-scheduler: Scheduler for beeminder.com

Installable with pip install bee-scheduler

Here’s an example of using it to scheduler a break from April 19th to April 20th:

from datetime import date

from bee_scheduler.scheduler import schedule_rate

start = date(year=2025, month=4, day=19)
end = date(year=2025, month=4, day=20)
rate = 0
schedule_rate(goal_name, start, end, rate)
6 Likes