blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
19.2k stars 1.76k forks source link

API Endpoint for finding camera's latest event_id #14988

Closed distinctjuggle closed 6 hours ago

distinctjuggle commented 6 hours ago

Describe what you are trying to accomplish and why in non technical terms I want to be able to reliably get the latest event_id from a camera via API. I'd like to use this to enable further API functionality.

Describe the solution you'd like An API endpoint similar to GET /api/events?camera=camname where it will return the latest event_id in the results. I specifically would like it to be filtered to a single camera.

Describe alternatives you've considered The closest I've found is GET /api/events/summary/ but it isn't limited to a single camera and there seems to be no way to request it as such.

Additional context Add any other context or screenshots about the feature request here.

NickM-27 commented 6 hours ago

This should be accomplished by just using /api/events?sort=date_desc&limit=1&camera=camera_name

distinctjuggle commented 6 hours ago

Weird, I wasn't finding the id with my previous query. It's working now though, thanks!