# Current red line value from goal API?

**URL:** <https://forum.beeminder.com/t/current-red-line-value-from-goal-api/10503>\
**Category:** Tech\
**Created:** [August 20, 2022, 11:41am UTC](https://forum.beeminder.com/t/current-red-line-value-from-goal-api/10503 "2022-08-20T11:41:45Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![zzq](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/zzq/32/6471_2.png) [@zzq](https://forum.beeminder.com/u/zzq)\
**Post date:** [August 20, 2022, 4:20pm UTC](https://forum.beeminder.com/t/current-red-line-value-from-goal-api/10503/3 "2022-08-20T16:20:51Z")

</div>

I think the (deprecated) `baremintotal` field contains the information you want, but unfortunately it’s a string (intended for display), not a number. If you really wanted to use it for this you’d have to parse it, taking into account that for timey goals it’s in `hour:minute` format. (Also, it’s generally a bad idea to build something new that depends on a deprecated field, and all that.)

I agree with @adamwolf that a non-deprecated version of this (as a number, without the need for reverse-engineering) would make a very good addition to the API.

As for “what is a day’s value” (which also would make a very good addition to the API), at least for now Altbee has an API for calculating this. (I’ve previously described it [here](https://forum.beeminder.com/t/beeminder-mathematica-package/7385/12).)

It works something like this:

```bash
curl -s \
  https://www.beeminder.com/api/v1/users/me/goals/$GOAL.json?auth_token=$AUTH_TOKEN\&datapoints=true |
  curl https://altbee.aeonc.com/api/bagg \
    -H 'Content-Type: application/json' --data @-

```

That is, just send to `https://altbee.aeonc.com/api/bagg` a `POST` with the results from the Beeminder goal API (with `datapoints=true`), and you’ll get back the same object with an additional field with the aggregated values for each day.

---

_[View the full topic](https://forum.beeminder.com/t/current-red-line-value-from-goal-api/10503)._
