[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"navigation":3,"/docs/data-sources/api-sources":100,"/docs/data-sources/api-sources-surround":478},[4,23,48,68],{"title":5,"path":6,"stem":7,"children":8,"icon":22},"Getting Started","/docs/getting-started","1.docs/1.getting-started/1.index",[9,12,17],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Creating an Account","/docs/getting-started/installation","1.docs/1.getting-started/2.installation","i-lucide-user-plus",{"title":18,"path":19,"stem":20,"icon":21},"Quick Start","/docs/getting-started/usage","1.docs/1.getting-started/3.usage","i-lucide-rocket",false,{"title":24,"path":25,"stem":26,"children":27,"page":22},"Data Sources","/docs/data-sources","1.docs/2.data-sources",[28,33,38,43],{"title":29,"path":30,"stem":31,"icon":32},"Manual Data","/docs/data-sources/manual-data","1.docs/2.data-sources/1.manual-data","i-lucide-file-text",{"title":34,"path":35,"stem":36,"icon":37},"API Sources","/docs/data-sources/api-sources","1.docs/2.data-sources/2.api-sources","i-lucide-globe",{"title":39,"path":40,"stem":41,"icon":42},"Managing Sources","/docs/data-sources/managing-sources","1.docs/2.data-sources/3.managing-sources","i-lucide-settings",{"title":44,"path":45,"stem":46,"icon":47},"Inbound API","/docs/data-sources/inbound-api","1.docs/2.data-sources/4.inbound-api","i-lucide-webhook",{"title":49,"path":50,"stem":51,"children":52,"page":22},"Visualization","/docs/visualization","1.docs/3.visualization",[53,58,63],{"title":54,"path":55,"stem":56,"icon":57},"Charts","/docs/visualization/charts","1.docs/3.visualization/1.charts","i-lucide-chart-line",{"title":59,"path":60,"stem":61,"icon":62},"Combined Views","/docs/visualization/combined-views","1.docs/3.visualization/2.combined-views","i-lucide-layers",{"title":64,"path":65,"stem":66,"icon":67},"Correlations","/docs/visualization/correlations","1.docs/3.visualization/3.correlations","i-lucide-git-compare",{"title":69,"path":70,"stem":71,"children":72,"icon":79},"Projections","/docs/projections","1.docs/4.projections/1.index",[73,75,80,85,90,95],{"title":69,"path":70,"stem":71,"icon":74},"i-lucide-chart-spline",{"title":76,"path":77,"stem":78,"icon":79},"Linear trend projection","/docs/projections/linear","1.docs/4.projections/2.linear","i-lucide-trending-up",{"title":81,"path":82,"stem":83,"icon":84},"Moving average projection","/docs/projections/moving-average","1.docs/4.projections/3.moving-average","i-lucide-activity",{"title":86,"path":87,"stem":88,"icon":89},"Exponential smoothing projection","/docs/projections/exponential-smoothing","1.docs/4.projections/4.exponential-smoothing","i-lucide-waves",{"title":91,"path":92,"stem":93,"icon":94},"Logarithmic projection","/docs/projections/logarithmic","1.docs/4.projections/5.logarithmic","i-lucide-log-in",{"title":96,"path":97,"stem":98,"icon":99},"Growth rate (CAGR) projection","/docs/projections/growth-rate","1.docs/4.projections/6.growth-rate","i-lucide-percent",{"id":101,"title":34,"body":102,"description":472,"extension":473,"meta":474,"navigation":475,"path":35,"seo":476,"stem":36,"__hash__":477},"docs/1.docs/2.data-sources/2.api-sources.md",{"type":103,"value":104,"toc":460},"minimark",[105,109,114,126,131,134,140,144,147,163,166,170,176,190,194,231,236,240,243,300,306,310,313,401,412,419,423,426,446,449,453,456],[106,107,108],"p",{},"API sources let you connect to any publicly accessible JSON API endpoint. TotalKPI will fetch data from the API and can automatically poll it on a schedule to keep your metrics up to date.",[110,111,113],"h2",{"id":112},"setting-up-an-api-source","Setting Up an API Source",[106,115,116,117,121,122,125],{},"Click ",[118,119,120],"strong",{},"Add Source",", then select ",[118,123,124],{},"API Endpoint",". The setup walks you through a multi-step process:",[127,128,130],"h3",{"id":129},"step-1-enter-your-api-url","Step 1: Enter Your API URL",[106,132,133],{},"Provide the full URL of the API endpoint you want to fetch from. Optionally, add custom headers for authentication (e.g. API keys or Bearer tokens).",[106,135,116,136,139],{},[118,137,138],{},"Test Connection"," to verify the API returns valid JSON.",[127,141,143],{"id":142},"step-2-choose-a-response-type","Step 2: Choose a Response Type",[106,145,146],{},"If the API response contains arrays, you'll be asked to choose between two modes:",[148,149,150,157],"ul",{},[151,152,153,156],"li",{},[118,154,155],{},"Data Series"," - import an array of data points that each contain a date and a value. This is ideal for APIs that return historical data.",[151,158,159,162],{},[118,160,161],{},"Single Value"," - extract a single numeric value from the response and append it as a new data point each time the API is polled. This is ideal for APIs that return current/live metrics.",[106,164,165],{},"If the response has no arrays, you'll go straight to single value mode.",[127,167,169],{"id":168},"step-3-select-your-data","Step 3: Select Your Data",[106,171,172,175],{},[118,173,174],{},"For Single Value mode:"," A JSON tree viewer shows the full API response. Click on any numeric field to select it. The selected path and extracted value are shown for confirmation.",[106,177,178,181,182,185,186,189],{},[118,179,180],{},"For Data Series mode:"," Select which array to use (if multiple exist), then map the ",[118,183,184],{},"value field"," and ",[118,187,188],{},"date field"," from the array items.",[127,191,193],{"id":192},"step-4-configure-the-source","Step 4: Configure the Source",[148,195,196,202,208,219,225],{},[151,197,198,201],{},[118,199,200],{},"Name"," - label for this data source.",[151,203,204,207],{},[118,205,206],{},"Unit"," - unit of measurement.",[151,209,210,213,214],{},[118,211,212],{},"Polling"," - enable automatic polling and choose an interval:\n",[148,215,216],{},[151,217,218],{},"1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 6 hours, or 24 hours.",[151,220,221,224],{},[118,222,223],{},"Sampling"," (Data Series mode only) - reduce data density by keeping only one data point per time window (every 10 minutes, hourly, every 6 hours, or daily).",[151,226,227,230],{},[118,228,229],{},"Max Data Points"," (Data Series mode only) - cap the number of stored data points (100, 1,000, 5,000, 10,000, or no limit).",[106,232,116,233,235],{},[118,234,120],{}," to finish.",[110,237,239],{"id":238},"custom-headers","Custom Headers",[106,241,242],{},"Use headers to pass authentication credentials to your API:",[244,245,246,259],"table",{},[247,248,249],"thead",{},[250,251,252,256],"tr",{},[253,254,255],"th",{},"Header",[253,257,258],{},"Example Value",[260,261,262,276,288],"tbody",{},[250,263,264,271],{},[265,266,267],"td",{},[268,269,270],"code",{},"Authorization",[265,272,273],{},[268,274,275],{},"Bearer your-api-token",[250,277,278,283],{},[265,279,280],{},[268,281,282],{},"X-API-Key",[265,284,285],{},[268,286,287],{},"abc123",[250,289,290,295],{},[265,291,292],{},[268,293,294],{},"Accept",[265,296,297],{},[268,298,299],{},"application/json",[106,301,116,302,305],{},[118,303,304],{},"Add Header"," to add as many key-value pairs as needed.",[110,307,309],{"id":308},"json-path-extraction","JSON Path Extraction",[106,311,312],{},"TotalKPI uses dot-notation paths to drill into nested JSON responses. For example, given this response:",[314,315,320],"pre",{"className":316,"code":317,"language":318,"meta":319,"style":319},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"data\": {\n    \"metrics\": {\n      \"revenue\": 12500\n    }\n  }\n}\n","json","",[268,321,322,331,350,366,383,389,395],{"__ignoreMap":319},[323,324,327],"span",{"class":325,"line":326},"line",1,[323,328,330],{"class":329},"sMK4o","{\n",[323,332,334,337,341,344,347],{"class":325,"line":333},2,[323,335,336],{"class":329},"  \"",[323,338,340],{"class":339},"spNyl","data",[323,342,343],{"class":329},"\"",[323,345,346],{"class":329},":",[323,348,349],{"class":329}," {\n",[323,351,353,356,360,362,364],{"class":325,"line":352},3,[323,354,355],{"class":329},"    \"",[323,357,359],{"class":358},"sBMFI","metrics",[323,361,343],{"class":329},[323,363,346],{"class":329},[323,365,349],{"class":329},[323,367,369,372,376,378,380],{"class":325,"line":368},4,[323,370,371],{"class":329},"      \"",[323,373,375],{"class":374},"sbssI","revenue",[323,377,343],{"class":329},[323,379,346],{"class":329},[323,381,382],{"class":374}," 12500\n",[323,384,386],{"class":325,"line":385},5,[323,387,388],{"class":329},"    }\n",[323,390,392],{"class":325,"line":391},6,[323,393,394],{"class":329},"  }\n",[323,396,398],{"class":325,"line":397},7,[323,399,400],{"class":329},"}\n",[106,402,403,404,407,408,411],{},"The path ",[268,405,406],{},"data.metrics.revenue"," extracts the value ",[268,409,410],{},"12500",".",[106,413,414,415,418],{},"For arrays, you can target nested arrays like ",[268,416,417],{},"data.history"," to access an array of objects.",[110,420,422],{"id":421},"polling-and-status","Polling and Status",[106,424,425],{},"Once an API source is created with polling enabled, you'll see a status indicator on the source card:",[148,427,428,434,440],{},[151,429,430,433],{},[118,431,432],{},"Green pulsing dot"," - active and polling on schedule (shows the interval, e.g. \"Every 5m\").",[151,435,436,439],{},[118,437,438],{},"Amber dot"," - the last fetch encountered an error.",[151,441,442,445],{},[118,443,444],{},"Gray dot"," - polling is paused.",[106,447,448],{},"Polling automatically pauses after 5 consecutive errors to avoid hammering a failing endpoint. You can re-enable it by editing the source.",[110,450,452],{"id":451},"security","Security",[106,454,455],{},"API requests are proxied through TotalKPI's server. Your API keys and authentication headers are never exposed to the browser. Requests to private/internal IP addresses (localhost, 192.168.x.x, 10.x.x.x, etc.) are blocked for security.",[457,458,459],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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":319,"searchDepth":333,"depth":333,"links":461},[462,468,469,470,471],{"id":112,"depth":333,"text":113,"children":463},[464,465,466,467],{"id":129,"depth":352,"text":130},{"id":142,"depth":352,"text":143},{"id":168,"depth":352,"text":169},{"id":192,"depth":352,"text":193},{"id":238,"depth":333,"text":239},{"id":308,"depth":333,"text":309},{"id":421,"depth":333,"text":422},{"id":451,"depth":333,"text":452},"Connect to any JSON API and automatically fetch data on a schedule.","md",{},{"icon":37},{"title":34,"description":472},"nk-2XMnZH94rAZ_Fc4gfgo268O_Z_C4SSI3SCotBX9c",[479,481],{"title":29,"path":30,"stem":31,"description":480,"icon":32,"children":-1},"Upload CSV files or paste data directly to create a data source.",{"title":39,"path":40,"stem":41,"description":482,"icon":42,"children":-1},"Edit, update, and remove your data sources."]