πŸ‡ΊπŸ‡¦ We stand with Ukraine! πŸ‡ΊπŸ‡¦

Get more than 300 historic values from REST API

What is the problem?

I want to get historic data with REST API, but receive only last 300 values.
My GET request looks like this:

/api/printer?history=true

What did you already try to solve it?

I tried to increase limit size. Didn't work.
Enabled serial logging, no difference.

Systeminfo Bundle

browser.user_agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36

connectivity.connection_check : 1.1.1.1:53

connectivity.connection_ok : True

connectivity.enabled : True

connectivity.online : True

connectivity.resolution_check : octoprint.org

connectivity.resolution_ok : True

env.hardware.cores : 4

env.hardware.freq : 1500.0

env.hardware.ram : 915296256

env.os.bits : 32

env.os.id : linux

env.os.platform : linux2

env.plugins.pi_support.model : Raspberry Pi 4 Model B Rev 1.1

env.plugins.pi_support.octopi_version : 0.17.0

env.plugins.pi_support.throttle_state : 0x0

env.python.pip : 19.3.1

env.python.version : 2.7.16

env.python.virtualenv : True

octoprint.safe_mode : False

octoprint.version : 1.7.3

systeminfo.generator : zipapi

No one knows how to set this up?

Or rather, they typed a reply but didn't actually post it and it was saved as a draft....

By default, the limit is 300 when you apply the ?history=true parameter to the request. It can be configured in the request by sending the limit parameter as well, like

GET /api/printer?history=true&limit=500

The only maximum limit that applies is up to the maximum amount of data OctoPrint stores. It is not possible to get an unlimited amount of data, for obvious reasons that it would become a memory issue if we stored it forever.

By default, OctoPrint will store temperature data for 30 mins, but this can be increased in the settings under 'temperature' if you need even more data.

2 Likes