blakeblackshear.frigate/usage/api/index.html
2021-01-22 13:50:27 +00:00

38 lines
35 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.70">
<link rel="alternate" type="application/rss+xml" href="/frigate/blog/rss.xml" title="Frigate Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/frigate/blog/atom.xml" title="Frigate Blog Atom Feed"><title data-react-helmet="true">HTTP API | Frigate</title><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" name="docusaurus_locale" content="en"><meta data-react-helmet="true" name="docusaurus_version" content="current"><meta data-react-helmet="true" name="docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:title" content="HTTP API | Frigate"><meta data-react-helmet="true" name="description" content="A web server is available on port 5000 with the following endpoints."><meta data-react-helmet="true" property="og:description" content="A web server is available on port 5000 with the following endpoints."><meta data-react-helmet="true" property="og:url" content="https://blakeblackshear.github.io/frigate/usage/api"><link data-react-helmet="true" rel="shortcut icon" href="/frigate/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://blakeblackshear.github.io/frigate/usage/api"><link rel="stylesheet" href="/frigate/styles.3cef2c0e.css">
<link rel="preload" href="/frigate/styles.9ee538de.js" as="script">
<link rel="preload" href="/frigate/runtime~main.e5ee0dc0.js" as="script">
<link rel="preload" href="/frigate/main.a244e8e4.js" as="script">
<link rel="preload" href="/frigate/1.ae1576eb.js" as="script">
<link rel="preload" href="/frigate/2.0c8f52fa.js" as="script">
<link rel="preload" href="/frigate/24.22ef4830.js" as="script">
<link rel="preload" href="/frigate/935f2afb.a10c19ec.js" as="script">
<link rel="preload" href="/frigate/17896441.8d5dd138.js" as="script">
<link rel="preload" href="/frigate/72a19f07.a7e83a1a.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<nav aria-label="Skip navigation links"><button type="button" tabindex="0" class="skipToContent_11B0">Skip to main content</button></nav><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><div aria-label="Navigation bar toggle" class="navbar__toggle" role="button" tabindex="0"><svg aria-label="Menu" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></div><a class="navbar__brand" href="/frigate/"><img src="/frigate/img/logo.svg" alt="Frigate" class="themedImage_YANc themedImage--light_3CMI navbar__logo"><img src="/frigate/img/logo-dark.svg" alt="Frigate" class="themedImage_YANc themedImage--dark_3ARp navbar__logo"><strong class="navbar__title">Frigate</strong></a><a class="navbar__item navbar__link" href="/frigate/">Docs</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/blakeblackshear/frigate" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub</a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_2N3Q"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_3NWk">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_3NWk">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/frigate/"><img src="/frigate/img/logo.svg" alt="Frigate" class="themedImage_YANc themedImage--light_3CMI navbar__logo"><img src="/frigate/img/logo-dark.svg" alt="Frigate" class="themedImage_YANc themedImage--dark_3ARp navbar__logo"><strong class="navbar__title">Frigate</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" href="/frigate/">Docs</a></li><li class="menu__list-item"><a href="https://github.com/blakeblackshear/frigate" target="_blank" rel="noopener noreferrer" class="menu__link">GitHub</a></li></ul></div></div></div></nav><div class="main-wrapper"><div class="docPage_vMrn"><div class="docSidebarContainer_3Ak5" role="complementary"><div class="sidebar_3gvy"><div class="menu menu--responsive thin-scrollbar menu_1yIk"><button aria-label="Open Menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_1CUI" width="24" height="24" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item"><a class="menu__link menuLinkText_yu3-">Frigate</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/">Features</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/how-it-works">How it works</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/hardware">Recommended hardware</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/installation">Installation</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/troubleshooting">Troubleshooting</a></li></ul></li><li class="menu__list-item"><a class="menu__link menuLinkText_yu3-">Configuration</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/configuration/index">Configuration</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/configuration/cameras">Cameras</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/configuration/optimizing">Optimizing performance</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/configuration/detectors">Detectors</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/configuration/false_positives">Reducing false positives</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/configuration/advanced">Advanced</a></li></ul></li><li class="menu__list-item"><a class="menu__link menuLinkText_yu3-">Usage</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/usage/home-assistant">Home Assistant</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/usage/web">Web Interface</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/frigate/usage/api">HTTP API</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/frigate/usage/mqtt">MQTT</a></li></ul></li></ul></div><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_2WRA"><svg width="20" height="20" role="img" class="collapseSidebarButtonIcon_CoMu"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div><main class="docMainContainer_2iGs"><div class="container padding-vert--lg docItemWrapper_1bxp"><div class="row"><div class="col docItemCol_U38p"><div class="docItemContainer_a7m4"><article><header><h1 class="docTitle_Oumm">HTTP API</h1></header><div class="markdown"><p>A web server is available on port 5000 with the following endpoints.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apicamera_name"></a><code>/api/&lt;camera_name&gt;</code><a class="hash-link" href="#apicamera_name" title="Direct link to heading">#</a></h3><p>An mjpeg stream for debugging. Keep in mind the mjpeg endpoint is for debugging only and will put additional load on the system when in use.</p><p>Accepts the following query string parameters:</p><table><thead><tr><th>param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>fps</code></td><td>int</td><td>Frame rate</td></tr><tr><td><code>h</code></td><td>int</td><td>Height in pixels</td></tr><tr><td><code>bbox</code></td><td>int</td><td>Show bounding boxes for detected objects (0 or 1)</td></tr><tr><td><code>timestamp</code></td><td>int</td><td>Print the timestamp in the upper left (0 or 1)</td></tr><tr><td><code>zones</code></td><td>int</td><td>Draw the zones on the image (0 or 1)</td></tr><tr><td><code>mask</code></td><td>int</td><td>Overlay the mask on the image (0 or 1)</td></tr><tr><td><code>motion</code></td><td>int</td><td>Draw blue boxes for areas with detected motion (0 or 1)</td></tr><tr><td><code>regions</code></td><td>int</td><td>Draw green boxes for areas where object detection was run (0 or 1)</td></tr></tbody></table><p>You can access a higher resolution mjpeg stream by appending <code>h=height-in-pixels</code> to the endpoint. For example <code>http://localhost:5000/back?h=1080</code>. You can also increase the FPS by appending <code>fps=frame-rate</code> to the URL such as <code>http://localhost:5000/back?fps=10</code> or both with <code>?fps=10&amp;h=1000</code>.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apicamera_nameobject_namebestjpgh300crop1"></a><code>/api/&lt;camera_name&gt;/&lt;object_name&gt;/best.jpg[?h=300&amp;crop=1]</code><a class="hash-link" href="#apicamera_nameobject_namebestjpgh300crop1" title="Direct link to heading">#</a></h3><p>The best snapshot for any object type. It is a full resolution image by default.</p><p>Example parameters:</p><ul><li><code>h=300</code>: resizes the image to 300 pixes tall</li><li><code>crop=1</code>: crops the image to the region of the detection rather than returning the entire image</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apicamera_namelatestjpgh300"></a><code>/api/&lt;camera_name&gt;/latest.jpg[?h=300]</code><a class="hash-link" href="#apicamera_namelatestjpgh300" title="Direct link to heading">#</a></h3><p>The most recent frame that frigate has finished processing. It is a full resolution image by default.</p><p>Accepts the following query string parameters:</p><table><thead><tr><th>param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>h</code></td><td>int</td><td>Height in pixels</td></tr><tr><td><code>bbox</code></td><td>int</td><td>Show bounding boxes for detected objects (0 or 1)</td></tr><tr><td><code>timestamp</code></td><td>int</td><td>Print the timestamp in the upper left (0 or 1)</td></tr><tr><td><code>zones</code></td><td>int</td><td>Draw the zones on the image (0 or 1)</td></tr><tr><td><code>mask</code></td><td>int</td><td>Overlay the mask on the image (0 or 1)</td></tr><tr><td><code>motion</code></td><td>int</td><td>Draw blue boxes for areas with detected motion (0 or 1)</td></tr><tr><td><code>regions</code></td><td>int</td><td>Draw green boxes for areas where object detection was run (0 or 1)</td></tr></tbody></table><p>Example parameters:</p><ul><li><code>h=300</code>: resizes the image to 300 pixes tall</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apistats"></a><code>/api/stats</code><a class="hash-link" href="#apistats" title="Direct link to heading">#</a></h3><p>Contains some granular debug info that can be used for sensors in HomeAssistant.</p><p>Sample response:</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-json codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/* Per Camera Stats */</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;back&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * Frames per second being consumed from your camera. If this is higher</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * than it is supposed to be, you should set -r FPS in your input_args.</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * camera_fps = process_fps + skipped_fps</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;camera_fps&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5.0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * Number of times detection is run per second. This can be higher than</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * your camera FPS because frigate often looks at the same frame multiple times</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * or in multiple locations</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;detection_fps&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1.5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * PID for the ffmpeg process that consumes this camera</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;capture_pid&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">27</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * PID for the process that runs detection for this camera</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;pid&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">34</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * Frames per second being processed by frigate.</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;process_fps&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5.1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * Frames per second skip for processing by frigate.</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;skipped_fps&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.0</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * Sum of detection_fps across all cameras and detectors.</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * This should be the sum of all detection_fps values from cameras.</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;detection_fps&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">5.0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/* Detectors Stats */</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;detectors&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;coral&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * Timestamp when object detection started. If this value stays non-zero and constant</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * for a long time, that means the detection process is stuck.</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;detection_start&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * Time spent running object detection in milliseconds.</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;inference_speed&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10.48</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/***************</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> * PID for the shared process that runs object detection on the Coral.</span></div><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"> ***************/</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;pid&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">25321</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;service&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">/* Uptime in seconds */</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;uptime&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">10</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;version&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;0.8.0-8883709&quot;</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apiconfig"></a><code>/api/config</code><a class="hash-link" href="#apiconfig" title="Direct link to heading">#</a></h3><p>A json representation of your configuration</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apiversion"></a><code>/api/version</code><a class="hash-link" href="#apiversion" title="Direct link to heading">#</a></h3><p>Version info</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apievents"></a><code>/api/events</code><a class="hash-link" href="#apievents" title="Direct link to heading">#</a></h3><p>Events from the database. Accepts the following query string parameters:</p><table><thead><tr><th>param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>before</code></td><td>int</td><td>Epoch time</td></tr><tr><td><code>after</code></td><td>int</td><td>Epoch time</td></tr><tr><td><code>camera</code></td><td>str</td><td>Camera name</td></tr><tr><td><code>label</code></td><td>str</td><td>Label name</td></tr><tr><td><code>zone</code></td><td>str</td><td>Zone name</td></tr><tr><td><code>limit</code></td><td>int</td><td>Limit the number of events returned</td></tr><tr><td><code>has_snapshot</code></td><td>int</td><td>Filter to events that have snapshots (0 or 1)</td></tr><tr><td><code>has_clip</code></td><td>int</td><td>Filter to events that have clips (0 or 1)</td></tr></tbody></table><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apieventssummary"></a><code>/api/events/summary</code><a class="hash-link" href="#apieventssummary" title="Direct link to heading">#</a></h3><p>Returns summary data for events in the database. Used by the HomeAssistant integration.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apieventsid"></a><code>/api/events/&lt;id&gt;</code><a class="hash-link" href="#apieventsid" title="Direct link to heading">#</a></h3><p>Returns data for a single event.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apieventsidthumbnailjpg"></a><code>/api/events/&lt;id&gt;/thumbnail.jpg</code><a class="hash-link" href="#apieventsidthumbnailjpg" title="Direct link to heading">#</a></h3><p>Returns a thumbnail for the event id optimized for notifications. Works while the event is in progress and after completion. Passing <code>?format=android</code> will convert the thumbnail to 2:1 aspect ratio.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="apieventsidsnapshotjpg"></a><code>/api/events/&lt;id&gt;/snapshot.jpg</code><a class="hash-link" href="#apieventsidsnapshotjpg" title="Direct link to heading">#</a></h3><p>Returns the snapshot image for the event id. Works while the event is in progress and after completion.</p><p>Accepts the following query string parameters, but they are only applied when an event is in progress. After the event is completed, the saved snapshot is returned from disk without modification:
|param|Type|Description|
|----|-----|--|
|<code>h</code>|int|Height in pixels|
|<code>bbox</code>|int|Show bounding boxes for detected objects (0 or 1)|
|<code>timestamp</code>|int|Print the timestamp in the upper left (0 or 1)|
|<code>crop</code>|int|Crop the snapshot to the (0 or 1)|</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="clipscamera-idmp4"></a><code>/clips/&lt;camera&gt;-&lt;id&gt;.mp4</code><a class="hash-link" href="#clipscamera-idmp4" title="Direct link to heading">#</a></h3><p>Video clip for the given camera and event id.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="clipscamera-idjpg"></a><code>/clips/&lt;camera&gt;-&lt;id&gt;.jpg</code><a class="hash-link" href="#clipscamera-idjpg" title="Direct link to heading">#</a></h3><p>JPG snapshot for the given camera and event id.</p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/blakeblackshear/frigate/edit/master/docs/docs/usage/api.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 40 40" class="iconEdit_2LL7"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Blog list page navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/frigate/usage/web"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Web Interface</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/frigate/usage/mqtt"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">MQTT »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_2xL- thin-scrollbar"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#apicamera_name" class="table-of-contents__link"><code>/api/&lt;camera_name&gt;</code></a></li><li><a href="#apicamera_nameobject_namebestjpgh300crop1" class="table-of-contents__link"><code>/api/&lt;camera_name&gt;/&lt;object_name&gt;/best.jpg[?h=300&amp;crop=1]</code></a></li><li><a href="#apicamera_namelatestjpgh300" class="table-of-contents__link"><code>/api/&lt;camera_name&gt;/latest.jpg[?h=300]</code></a></li><li><a href="#apistats" class="table-of-contents__link"><code>/api/stats</code></a></li><li><a href="#apiconfig" class="table-of-contents__link"><code>/api/config</code></a></li><li><a href="#apiversion" class="table-of-contents__link"><code>/api/version</code></a></li><li><a href="#apievents" class="table-of-contents__link"><code>/api/events</code></a></li><li><a href="#apieventssummary" class="table-of-contents__link"><code>/api/events/summary</code></a></li><li><a href="#apieventsid" class="table-of-contents__link"><code>/api/events/&lt;id&gt;</code></a></li><li><a href="#apieventsidthumbnailjpg" class="table-of-contents__link"><code>/api/events/&lt;id&gt;/thumbnail.jpg</code></a></li><li><a href="#apieventsidsnapshotjpg" class="table-of-contents__link"><code>/api/events/&lt;id&gt;/snapshot.jpg</code></a></li><li><a href="#clipscamera-idmp4" class="table-of-contents__link"><code>/clips/&lt;camera&gt;-&lt;id&gt;.mp4</code></a></li><li><a href="#clipscamera-idjpg" class="table-of-contents__link"><code>/clips/&lt;camera&gt;-&lt;id&gt;.jpg</code></a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">Community</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/blakeblackshear/frigate" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://github.com/blakeblackshear/frigate/discussions" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discussions</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2021 Blake Blackshear</div></div></div></footer></div>
<script src="/frigate/styles.9ee538de.js"></script>
<script src="/frigate/runtime~main.e5ee0dc0.js"></script>
<script src="/frigate/main.a244e8e4.js"></script>
<script src="/frigate/1.ae1576eb.js"></script>
<script src="/frigate/2.0c8f52fa.js"></script>
<script src="/frigate/24.22ef4830.js"></script>
<script src="/frigate/935f2afb.a10c19ec.js"></script>
<script src="/frigate/17896441.8d5dd138.js"></script>
<script src="/frigate/72a19f07.a7e83a1a.js"></script>
</body>
</html>