[{"data":1,"prerenderedAt":607},["ShallowReactive",2],{"doc-\u002Fapi\u002Fmeasurements":3},{"id":4,"title":5,"body":6,"description":597,"edit":598,"extension":599,"meta":600,"navigation":601,"path":602,"seo":603,"stem":604,"vertical":598,"weight":605,"__hash__":606},"content\u002Fapi\u002Fmeasurements.md","Measurements API",{"type":7,"value":8,"toc":587},"minimark",[9,24,29,39,42,183,206,210,354,364,368,374,377,466,469,472,478,484,500,504,529,536,547,553,560,564,571,577,583],[10,11,12,13,17,18,23],"p",{},"Read measurements as a stream of ",[14,15,16],"code",{},"(ts, value)"," pairs, optionally\naggregated. The endpoint is designed to back the dashboard's charts and\nto be hit hard from the ",[19,20,22],"a",{"href":21},"\u002Fapi\u002Freports","reports"," generator. Everyone else\nshould call it sparingly.",[25,26,28],"h2",{"id":27},"endpoint","Endpoint",[30,31,36],"pre",{"className":32,"code":34,"language":35},[33],"language-text","GET \u002Fv1\u002Fchannels\u002Fchn_a1b2\u002Fmeasurements\n","text",[14,37,34],{"__ignoreMap":38},"",[10,40,41],{},"Query parameters:",[43,44,45,61],"table",{},[46,47,48],"thead",{},[49,50,51,55,58],"tr",{},[52,53,54],"th",{},"Param",[52,56,57],{},"Default",[52,59,60],{},"Meaning",[62,63,64,78,91,117,151,164],"tbody",{},[49,65,66,72,75],{},[67,68,69],"td",{},[14,70,71],{},"from",[67,73,74],{},"now − 24 h",[67,76,77],{},"RFC 3339, inclusive",[49,79,80,85,88],{},[67,81,82],{},[14,83,84],{},"to",[67,86,87],{},"now",[67,89,90],{},"RFC 3339, exclusive",[49,92,93,98,103],{},[67,94,95],{},[14,96,97],{},"agg",[67,99,100],{},[14,101,102],{},"raw",[67,104,105,107,108,107,111,107,114],{},[14,106,102],{},", ",[14,109,110],{},"5m",[14,112,113],{},"1h",[14,115,116],{},"1d",[49,118,119,124,129],{},[67,120,121],{},[14,122,123],{},"fn",[67,125,126],{},[14,127,128],{},"mean",[67,130,131,107,133,107,136,107,139,107,142,107,145,107,148],{},[14,132,128],{},[14,134,135],{},"min",[14,137,138],{},"max",[14,140,141],{},"count",[14,143,144],{},"last",[14,146,147],{},"p50",[14,149,150],{},"p95",[49,152,153,158,161],{},[67,154,155],{},[14,156,157],{},"limit",[67,159,160],{},"5000",[67,162,163],{},"Cap on returned points",[49,165,166,171,176],{},[67,167,168],{},[14,169,170],{},"format",[67,172,173],{},[14,174,175],{},"json",[67,177,178,107,180],{},[14,179,175],{},[14,181,182],{},"csv",[10,184,185,187,188,107,190,107,192,194,195,197,198,201,202,205],{},[14,186,102],{}," returns every stored measurement; ",[14,189,110],{},[14,191,113],{},[14,193,116],{}," return rollups\nfrom the corresponding continuous-aggregate (faster, lower precision).\nFor HACCP reports use ",[14,196,110],{}," with ",[14,199,200],{},"fn=min"," and ",[14,203,204],{},"fn=max"," to get the\nhourly envelope.",[25,207,209],{"id":208},"response-json","Response (JSON)",[30,211,214],{"className":212,"code":213,"language":175,"meta":38,"style":38},"language-json shiki shiki-themes github-dark github-dark","{\n  \"channel_id\": \"chn_a1b2\",\n  \"agg\":        \"5m\",\n  \"fn\":         \"mean\",\n  \"data\": [\n    [ \"2026-05-17T08:00:00Z\", 4.13 ],\n    [ \"2026-05-17T08:05:00Z\", 4.21 ],\n    ...\n  ],\n  \"next_cursor\": null,\n  \"has_more\": false\n}\n",[14,215,216,225,242,256,270,279,296,311,318,324,337,348],{"__ignoreMap":38},[217,218,221],"span",{"class":219,"line":220},"line",1,[217,222,224],{"class":223},"suv1-","{\n",[217,226,228,232,235,239],{"class":219,"line":227},2,[217,229,231],{"class":230},"s8ozJ","  \"channel_id\"",[217,233,234],{"class":223},": ",[217,236,238],{"class":237},"s4wv1","\"chn_a1b2\"",[217,240,241],{"class":223},",\n",[217,243,245,248,251,254],{"class":219,"line":244},3,[217,246,247],{"class":230},"  \"agg\"",[217,249,250],{"class":223},":        ",[217,252,253],{"class":237},"\"5m\"",[217,255,241],{"class":223},[217,257,259,262,265,268],{"class":219,"line":258},4,[217,260,261],{"class":230},"  \"fn\"",[217,263,264],{"class":223},":         ",[217,266,267],{"class":237},"\"mean\"",[217,269,241],{"class":223},[217,271,273,276],{"class":219,"line":272},5,[217,274,275],{"class":230},"  \"data\"",[217,277,278],{"class":223},": [\n",[217,280,282,285,288,290,293],{"class":219,"line":281},6,[217,283,284],{"class":223},"    [ ",[217,286,287],{"class":237},"\"2026-05-17T08:00:00Z\"",[217,289,107],{"class":223},[217,291,292],{"class":230},"4.13",[217,294,295],{"class":223}," ],\n",[217,297,299,301,304,306,309],{"class":219,"line":298},7,[217,300,284],{"class":223},[217,302,303],{"class":237},"\"2026-05-17T08:05:00Z\"",[217,305,107],{"class":223},[217,307,308],{"class":230},"4.21",[217,310,295],{"class":223},[217,312,314],{"class":219,"line":313},8,[217,315,317],{"class":316},"sX7ps","    ...\n",[217,319,321],{"class":219,"line":320},9,[217,322,323],{"class":223},"  ],\n",[217,325,327,330,332,335],{"class":219,"line":326},10,[217,328,329],{"class":230},"  \"next_cursor\"",[217,331,234],{"class":223},[217,333,334],{"class":230},"null",[217,336,241],{"class":223},[217,338,340,343,345],{"class":219,"line":339},11,[217,341,342],{"class":230},"  \"has_more\"",[217,344,234],{"class":223},[217,346,347],{"class":230},"false\n",[217,349,351],{"class":219,"line":350},12,[217,352,353],{"class":223},"}\n",[10,355,356,357,360,361,363],{},"Pairs are sorted ascending by ",[14,358,359],{},"ts",". Missing buckets (the sensor was\noffline) are omitted, not filled with ",[14,362,334],{},". The dashboard renders the\ngap as a break in the line.",[25,365,367],{"id":366},"multiple-channels-in-one-call","Multiple channels in one call",[30,369,372],{"className":370,"code":371,"language":35},[33],"GET \u002Fv1\u002Fmeasurements?channel_ids=chn_a1b2,chn_a1b3,chn_a1b4&agg=1h\n",[14,373,371],{"__ignoreMap":38},[10,375,376],{},"Response is keyed by channel:",[30,378,380],{"className":212,"code":379,"language":175,"meta":38,"style":38},"{\n  \"data\": {\n    \"chn_a1b2\": [ [\"...Z\", 4.13], ... ],\n    \"chn_a1b3\": [ [\"...Z\", 64.1], ... ],\n    \"chn_a1b4\": [ [\"...Z\", 92], ... ]\n  }\n}\n",[14,381,382,386,393,416,436,457,462],{"__ignoreMap":38},[217,383,384],{"class":219,"line":220},[217,385,224],{"class":223},[217,387,388,390],{"class":219,"line":227},[217,389,275],{"class":230},[217,391,392],{"class":223},": {\n",[217,394,395,398,401,404,406,408,411,414],{"class":219,"line":244},[217,396,397],{"class":230},"    \"chn_a1b2\"",[217,399,400],{"class":223},": [ [",[217,402,403],{"class":237},"\"...Z\"",[217,405,107],{"class":223},[217,407,292],{"class":230},[217,409,410],{"class":223},"], ",[217,412,413],{"class":316},"...",[217,415,295],{"class":223},[217,417,418,421,423,425,427,430,432,434],{"class":219,"line":258},[217,419,420],{"class":230},"    \"chn_a1b3\"",[217,422,400],{"class":223},[217,424,403],{"class":237},[217,426,107],{"class":223},[217,428,429],{"class":230},"64.1",[217,431,410],{"class":223},[217,433,413],{"class":316},[217,435,295],{"class":223},[217,437,438,441,443,445,447,450,452,454],{"class":219,"line":272},[217,439,440],{"class":230},"    \"chn_a1b4\"",[217,442,400],{"class":223},[217,444,403],{"class":237},[217,446,107],{"class":223},[217,448,449],{"class":230},"92",[217,451,410],{"class":223},[217,453,413],{"class":316},[217,455,456],{"class":223}," ]\n",[217,458,459],{"class":219,"line":281},[217,460,461],{"class":223},"  }\n",[217,463,464],{"class":219,"line":298},[217,465,353],{"class":223},[10,467,468],{},"Up to 32 channel ids per request. The endpoint is rate-limited harder\nthan the single-channel one.",[25,470,471],{"id":182},"CSV",[10,473,474,477],{},[14,475,476],{},"?format=csv"," returns:",[30,479,482],{"className":480,"code":481,"language":35},[33],"ts,value\n2026-05-17T08:00:00Z,4.13\n2026-05-17T08:05:00Z,4.21\n",[14,483,481],{"__ignoreMap":38},[10,485,486,487,490,491,495,496,499],{},"Headers stable, separator is comma, decimal point is ",[14,488,489],{},".",". We do ",[492,493,494],"strong",{},"not","\nemit semicolon-separated CSV. Excel users on EU locales should open\nwith ",[14,497,498],{},"Data → From text"," rather than double-click.",[25,501,503],{"id":502},"pagination","Pagination",[10,505,506,507,510,511,514,515,518,519,522,523,525,526,528],{},"Use ",[14,508,509],{},"next_cursor"," if ",[14,512,513],{},"has_more"," is true. The cursor is opaque and\nembeds ",[14,516,517],{},"(from, to, agg, last_ts)",". Pass it as ",[14,520,521],{},"?cursor=..."," on the\nnext request; ignore ",[14,524,71],{}," \u002F ",[14,527,84],{}," (the cursor carries them).",[25,530,532,533],{"id":531},"gaps-and-no_data","Gaps and ",[14,534,535],{},"no_data",[10,537,538,539,542,543,546],{},"A channel that has not reported in ",[14,540,541],{},"> 2 × cadence"," has a\n",[14,544,545],{},"state = no_data"," flag separate from the values endpoint. To find\ngaps explicitly:",[30,548,551],{"className":549,"code":550,"language":35},[33],"GET \u002Fv1\u002Fchannels\u002Fchn_a1b2\u002Fgaps?from=…&to=…\n",[14,552,550],{"__ignoreMap":38},[10,554,555,556,559],{},"Returns intervals where consecutive measurements are ",[14,557,558],{},"> 5 × cadence","\napart. Useful for the report's \"device offline\" timeline.",[25,561,563],{"id":562},"bulk-export","Bulk export",[10,565,566,567,570],{},"For multi-day exports use the ",[14,568,569],{},"export"," endpoint, which streams CSV\nwithout loading the whole result set into memory:",[30,572,575],{"className":573,"code":574,"language":35},[33],"GET \u002Fv1\u002Fchannels\u002Fchn_a1b2\u002Fexport?from=…&to=…&format=csv\n",[14,576,574],{"__ignoreMap":38},[10,578,579,580,582],{},"This bypasses the ",[14,581,157],{}," cap and the rate limiter (it has a separate,\nslower budget of 1 export per 5 minutes). Returns up to 1 year of raw\ndata per call.",[584,585,586],"style",{},"html pre.shiki code .suv1-, html code.shiki .suv1-{--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .s8ozJ, html code.shiki .s8ozJ{--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .s4wv1, html code.shiki .s4wv1{--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .sX7ps, html code.shiki .sX7ps{--shiki-default:#FDAEB7;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":38,"searchDepth":244,"depth":244,"links":588},[589,590,591,592,593,594,596],{"id":27,"depth":227,"text":28},{"id":208,"depth":227,"text":209},{"id":366,"depth":227,"text":367},{"id":182,"depth":227,"text":471},{"id":502,"depth":227,"text":503},{"id":531,"depth":227,"text":595},"Gaps and no_data",{"id":562,"depth":227,"text":563},"Read with aggregations",null,"md",{},true,"\u002Fapi\u002Fmeasurements",{"title":5,"description":597},"api\u002Fmeasurements",280,"h8mJXgcK37n7gxeJEDNwFMJLCvHYiH_RqkY9Kfk9zJs",1779022954193]