API query to view watch history?

Hi All,

I’ve been playing around with the Plex API and had what I thought to be a way to list the watch history using the following:

http://:32400/status/sessions/history/all

However upon closer investigation I’ve found this only returns a partial result. Am I missing something? Am I issuing the command incorrectly?

FYI, my server IP precedes the port# in the example above.
Example: http://10.0.1.11:32400/status/sessions/history/all

Plex doesn’t store watched history for very long.
It will disappear as the log file fills up with new data.

Ah, that explains it… so the output from the API call is only a “recent history” and not a full history if I understand you correctly. If this is the case what would be the best way to begin monitoring watch history in your opinion? Should I monitor the Plex Media Server log and correlate the playqueID with a field in one of the sqlite tables that maps back to the metadata (movie title, etc)? The end goal is to simply provide a full history/analysis of what media is being played and how often.

Well, it is the full history that plex has, as plex doesn’t store anything other than what is currently in the log file. And as you have seen the data in there isn’t very long.

Take a look at PlexPy what you want is already been developed.
https://forums.plex.tv/discussion/169591/plexpy-another-plex-monitoring-program/p1