I have not seen a way to ask Graphite for a single value, but you can request a summary of the values ββover a custom period and take the latter. (This is just to minimize the returned data, you can easily pull the last value from any series for a certain period of time.) Examples of visualization parameters:
target=summarize(abccount,'1hour','last')&from=-1h&format=json
The returned JSON will look like this:
[{"target": "summarize(abccount, \"1hour\", \"last\")", "datapoints": [[5.1333330000000004, 1442160000], [5.5499989999999997, 1442163600]]}]
Here is a Python snippet to extract and parse this using the HTTP request library
import requests r = requests.get("http://graphite.yourdomain.com/render/?" + "target=summarize(abccount,'1hour','last')&from=-1h&format=json") print r.json()[0][u'datapoints'][-1][0]
source share