I want to use python and rest api to get data form my printer and store it in a database (panda dataframe). For this I use Octoprint and Python (Pycharm).
I can retrieve the current state of the nozzle temperature with this command:
import requests
import pandas as pd
api_key = 'Here I fill in my API KEY'
url = f"http://localhost:5000/api/printer/tool?apikey={api_key}"
response = requests.get(url)
data = response.json()
df = pd.json_normalize(data)
print(df)
but when I use url = f""http://localhost:5000/api/printer?history=true?apikey={api_key}"]
I get the error: You don't have the permission to access the re...
I want the data history so I can do some data analysis.
Do I need to fill in my username and password somewhere? Or is there another solution?
By the way, my API KEY works, because if I don't use the key, I don't get any data.
Thanks for the help!