{"id":28510604,"url":"https://github.com/iobroker/iobroker.simple-api","last_synced_at":"2025-07-03T05:32:08.470Z","repository":{"id":26880681,"uuid":"30341330","full_name":"ioBroker/ioBroker.simple-api","owner":"ioBroker","description":"HTTP-API Interface to read and write objets and states","archived":false,"fork":false,"pushed_at":"2025-07-01T06:58:52.000Z","size":944,"stargazers_count":42,"open_issues_count":20,"forks_count":19,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-01T07:44:11.148Z","etag":null,"topics":["api","home-automation","http-api","iobroker","smarthome"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ioBroker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-02-05T06:25:43.000Z","updated_at":"2025-07-01T05:59:35.000Z","dependencies_parsed_at":"2023-01-14T05:28:46.380Z","dependency_job_id":"7436387d-4f3a-423f-9b3e-15950e112fff","html_url":"https://github.com/ioBroker/ioBroker.simple-api","commit_stats":{"total_commits":412,"total_committers":19,"mean_commits":21.68421052631579,"dds":0.5485436893203883,"last_synced_commit":"faaedaca284819ebf2db49b130e9d33f1263ce21"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/ioBroker/ioBroker.simple-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioBroker%2FioBroker.simple-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioBroker%2FioBroker.simple-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioBroker%2FioBroker.simple-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioBroker%2FioBroker.simple-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ioBroker","download_url":"https://codeload.github.com/ioBroker/ioBroker.simple-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioBroker%2FioBroker.simple-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263268553,"owners_count":23439973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","home-automation","http-api","iobroker","smarthome"],"created_at":"2025-06-08T23:05:34.142Z","updated_at":"2025-07-03T05:32:08.443Z","avatar_url":"https://github.com/ioBroker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](admin/simple-api.png)\r\n# Simple-api\r\n\r\n![Number of Installations](http://iobroker.live/badges/simple-api-installed.svg)\r\n![Number of Installations](http://iobroker.live/badges/simple-api-stable.svg)\r\n[![NPM version](http://img.shields.io/npm/v/iobroker.simple-api.svg)](https://www.npmjs.com/package/iobroker.simple-api)\r\n\r\n![Test and Release](https://github.com/ioBroker/ioBroker.simple-api/workflows/Test%20and%20Release/badge.svg)\r\n[![Translation status](https://weblate.iobroker.net/widgets/adapters/-/simple-api/svg-badge.svg)](https://weblate.iobroker.net/engage/adapters/?utm_source=widget)\r\n[![Downloads](https://img.shields.io/npm/dm/iobroker.simple-api.svg)](https://www.npmjs.com/package/iobroker.simple-api)\r\n\r\nThis is a RESTFul interface to read the objects and states from ioBroker and to write/control the states over HTTP Get/Post requests.\r\n\r\n**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.\r\n\r\n**Use better [`ioBroker.rest-api`](https://github.com/ioBroker/ioBroker.rest-api) instead of this adapter.**\r\n\r\n## Usage\r\nCall in browser `http://ipaddress:8087/help` to get the help about API. The result is:\r\n\r\n```json\r\n{\r\n  \"getPlainValue\": \"http://ipaddress:8087/getPlainValue/stateID\",\r\n  \"getPlainValue\": \"http://ipaddress:8087/getPlainValue/stateID?json\",\r\n  \"get\": \"http://ipaddress:8087/get/stateID/?prettyPrint\",\r\n  \"getBulk\": \"http://ipaddress:8087/getBulk/stateID1,stateID2/?prettyPrint\",\r\n  \"set\": \"http://ipaddress:8087/set/stateID?value=1\u0026prettyPrint\",\r\n  \"toggle\": \"http://ipaddress:8087/toggle/stateID?prettyPrint\",\r\n  \"setBulk\": \"http://ipaddress:8087/setBulk?stateID1=0.7\u0026stateID2=0\u0026prettyPrint\",\r\n  \"objects\": \"http://ipaddress:8087/objects?pattern=system.adapter.admin.0*\u0026prettyPrint\",\r\n  \"objects\": \"http://ipaddress:8087/objects?pattern=system.adapter.admin.0*\u0026type=adapter\u0026prettyPrint\",\r\n  \"states\": \"http://ipaddress:8087/states?pattern=system.adapter.admin.0*\u0026prettyPrint\"\r\n  \"search\": \"http://ipaddress:8087/search?pattern=system.adapter.admin.0*\u0026prettyPrint\",\r\n  \"query\": \"http://ipaddress:8087/query/stateID1,stateID2/?prettyPrint\"\r\n  \"query\": \"http://ipaddress:8087/query/stateID1,stateID2/?noHistory=true\u0026prettyPrint\"\r\n  \"query\": \"http://ipaddress:8087/query/stateID1,stateID2/?dateFrom=2019-06-06T12:00:00.000Z\u0026d\u0026prettyPrint\"\r\n  \"query\": \"http://ipaddress:8087/query/stateID1,stateID2/?dateFrom=2019-06-06T12:00:00.000Z\u0026dateTo=2019-06-06T12:00:00.000Z\u0026aggregate=minmax\u0026count=2000\u0026prettyPrint\"\r\n}\r\n```\r\n\r\n### getPlainValue\r\nCall e.g.:\r\n\r\n`http://ipaddress:8087/getPlainValue/system.adapter.admin.0.alive`\r\n\r\nResult:\r\n\r\n`true`\r\n\r\nAdditionally, you can use query key `json` to force the parsing of the stored value:\r\n\r\n`http://ipaddress:8087/getPlainValue/javascript.0.value?json`\r\n\r\nResult:\r\n\r\n`{\"a\":1}`\r\n\r\nAnd without `json` flag the result would be \r\n\r\n`\"{\\\"a\\\": 1}\"`\r\n\r\nOne more useful flag could be used too, `noStringify`:\r\n\r\n`http://ipaddress:8087/getPlainValue/javascript.0.stringValue?noStringify`\r\n\r\nResult:\r\n\r\n`VALUETEXT`\r\n\r\nAnd without `noStringify` flag the result would be\r\n\r\n`\"VALUETEXT\"`\r\n\r\n### get\r\nCall e.g.:\r\n`http://ipaddress:8087/get/system.adapter.admin.0.alive`\r\n\r\nResult:\r\n```json\r\n{\"val\":true,\"ack\":true,\"ts\":1442432193,\"from\":\"system.adapter.admin.0\",\"lc\":1442431190,\"expire\":23437,\"_id\":\"system.adapter.admin.0.alive\",\"type\":\"state\",\"common\":{\"name\":\"admin.0.alive\",\"type\":\"boolean\",\"role\":\"indicator.state\"},\"native\":{}}\r\n```\r\n\r\nor call e.g.:\r\n```\r\nhttp://ipaddress:8087/get/system.adapter.admin.0.alive?prettyPrint\r\n```\r\n\r\nResult:\r\n```json\r\n{\r\n  \"val\": true,\r\n  \"ack\": true,\r\n  \"ts\": 1442432238,\r\n  \"from\": \"system.adapter.admin.0\",\r\n  \"lc\": 1442431190,\r\n  \"expire\": 28494,\r\n  \"_id\": \"system.adapter.admin.0.alive\",\r\n  \"type\": \"state\",\r\n  \"common\": {\r\n    \"name\": \"admin.0.alive\",\r\n    \"type\": \"boolean\",\r\n    \"role\": \"indicator.state\"\r\n  },\r\n  \"native\": {}\r\n}\r\n```\r\n\r\n### getBulk\r\nGet many states with one request, returned as an array of objects in order of a list in request and id/val/ts as a sub-object\r\n\r\n### set\r\nCall e.g.: `http://ipaddress:8087/set/javascript.0.test?value=1`\r\n\r\nResult:\r\n```json\r\n{\"id\":\"javascript.0.test\",\"value\":1}\r\n```\r\nor call e.g.: `http://ipaddress:8087/set/javascript.0.test?value=1\u0026prettyPrint`\r\n\r\nResult:\r\n```json\r\n{\r\n  \"id\": \"javascript.0.test\",\r\n  \"value\": 1\r\n}\r\n```\r\nOf course the data point `javascript.0.test` must exist.\r\n\r\nAdditionally, the type of value could be defined: `http://ipaddress:8087/set/javascript.0.test?value=1\u0026prettyPrint\u0026type=string`\r\n\r\nand an acknowledgment flag could be defined too: `http://ipaddress:8087/set/javascript.0.test?value=1\u0026prettyPrint\u0026ack=true`\r\n\r\n### toggle\r\nToggles value:\r\n\r\n- boolean: true =\u003e false, false =\u003e true\r\n- number without limits: x =\u003e 100-x\r\n- number with limits: x =\u003e max - (x - min)\r\n\r\n### setBulk\r\nSet many states with one request. This request supports POST method too, for POST data should be in body and not URL.\r\n\r\nPlease use content type `text/plain` for that.\r\n\r\n### setValueFromBody\r\nThis command allows setting the value of a given state to be set by the POST body content.\r\n\r\nCall e.g.:\r\n`http://ipaddress:8087/setValueFromBody/0_userdata.0.example_state`\r\nwith body `hello` where `0_userdata.0.example_state` is the ID of the state.\r\n\r\nPlease use content type `text/plain` for that.\r\n\r\n### objects\r\nRead objects of a defined type from DB.\r\n\r\nCall e.g.:\r\n`http://ipaddress:8087/objects?pattern=enum.*\u0026type=enum` - to read all enums\r\n\r\nor \r\n\r\n`http://ipaddress:8087/objects?pattern=system.adapter.admin.0.*` - to read all states in branch `system.adapter.admin.0`\r\n\r\n### states\r\n\r\n### search\r\nIf a data source (History, SQL) in the configuration is set, then only the data points known to the data source are listed.\r\nIf the option 'List all data points' has been activated or no data source has been specified, all data points will be listed.\r\nThis command is needed for the Grafana JSON / SimpleJSON Plugin.\r\n\r\n### query\r\nIf a data source (History, SQL) has been specified in the instance configuration, the data from the specified data points are read out for the specified period, otherwise only the current value is read out.\r\nThis command is needed for the Grafana JSON / SimpleJSON Plugin.\r\n\r\n### help\r\nGives [this](#usage) output back\r\n\r\n## Usage\r\nAssume, we have no security and the server runs on default port 8087.\r\n\r\nFor all queries, the name or id of the state can be specified.\r\n\r\nFor every request that returns JSON you can set parameter `prettyPrint` to get the output in human-readable form.\r\n\r\nIf authentication is enabled, two other fields are mandatory: `?user=admin\u0026pass=iobroker`\r\n\r\n### getPlainValue\r\nRead state value as text. You can specify more ids divided by semicolon\r\n\r\n`http://ip:8087/getPlainValue/admin.0.memHeapTotal` =\u003e `31.19`\r\n\r\n`http://ip:8087/getPlainValue/admin.0.memHeapTotal, admin.0.memHeapUsed` =\u003e\r\n\r\n```\r\n  31.19\r\n  17.52\r\n```\r\n\r\n### get\r\nRead state and object data of state as JSON. You can specify more ids divided by semicolon.\r\nIf more than one ID is requested, the JSON array will be returned.\r\n\r\n`http://localhost:8087/get/admin.0.memHeapTotal/?prettyPrint` =\u003e\r\n\r\n```json\r\n  {\r\n    \"val\": 31.19,\r\n    \"ack\": true,\r\n    \"ts\": 1423154619,\r\n    \"from\": \"system.adapter.admin.0\",\r\n    \"lc\": 1423153989,\r\n    \"_id\": \"system.adapter.admin.0.memHeapTotal\",\r\n    \"type\": \"state\",\r\n    \"common\": {\r\n      \"name\": \"admin.0.memHeapTotal\",\r\n      \"type\": \"number\",\r\n      \"role\": \"indicator.state\",\r\n      \"unit\": \"MB\",\r\n      \"history\": {\r\n        \"enabled\": true,\r\n        \"changesOnly\": true,\r\n        \"minLength\": 480,\r\n        \"maxLength\": 960,\r\n        \"retention\": 604800,\r\n        \"debounce\": 10000\r\n      }\r\n    },\r\n    \"native\": {}\r\n  }\r\n```\r\n\r\n`http://ip:8087/get/admin.0.memHeapTotal,admin.0.memHeapUsed/?prettyPrint` =\u003e\r\n\r\n```json\r\n  [\r\n    {\r\n      \"val\": 31.19,\r\n      \"ack\": true,\r\n      \"ts\": 1423154544,\r\n      \"from\": \"system.adapter.admin.0\",\r\n      \"lc\": 1423153989,\r\n      \"_id\": \"system.adapter.admin.0.memHeapTotal\",\r\n      \"type\": \"state\",\r\n      \"common\": {\r\n        \"name\": \"admin.0.memHeapTotal\",\r\n        \"type\": \"number\",\r\n        \"role\": \"indicator.state\",\r\n        \"unit\": \"MB\",\r\n        \"history\": {\r\n          \"enabled\": true,\r\n          \"changesOnly\": true,\r\n          \"minLength\": 480,\r\n          \"maxLength\": 960,\r\n          \"retention\": 604800,\r\n          \"debounce\": 10000\r\n        }\r\n      },\r\n      \"native\": {}\r\n    },\r\n    {\r\n      \"val\": 16.25,\r\n      \"ack\": true,\r\n      \"ts\": 1423154544,\r\n      \"from\": \"system.adapter.admin.0\",\r\n      \"lc\": 1423154544,\r\n      \"_id\": \"system.adapter.admin.0.memHeapUsed\",\r\n      \"type\": \"state\",\r\n      \"common\": {\r\n        \"name\": \"admin.0.memHeapUsed\",\r\n        \"type\": \"number\",\r\n        \"role\": \"indicator.state\",\r\n        \"unit\": \"MB\",\r\n        \"history\": {\r\n          \"enabled\": true,\r\n          \"changesOnly\": true,\r\n          \"minLength\": 480,\r\n          \"maxLength\": 960,\r\n          \"retention\": 604800,\r\n          \"debounce\": 10000\r\n        }\r\n      },\r\n      \"native\": {}\r\n    }\r\n  ]\r\n```\r\n\r\n### getBulk\r\nRead the states of more IDs with timestamp. You can specify more ids divided by semicolon.\r\nThe JSON array will be returned always.\r\n\r\n`http://ip:8087/getBulk/admin.0.memHeapTotal,admin.0.memHeapUsed/?prettyPrint` =\u003e\r\n\r\n```json\r\n  {\r\n      \"admin.0.memHeapTotal\": {\r\n          \"val\": 31.19,\r\n          \"ts\": 1423154754\r\n      },\r\n      \"admin.0.memHeapUsed\": {\r\n          \"val\": 15.6,\r\n          \"ts\": 1423154754\r\n      }\r\n  }\r\n```\r\n\r\n### set\r\nWrite the states with specified IDs. You can specify *wait* option in milliseconds to wait for answer from driver.\r\n\r\n`http://ip:8087/set/hm-rpc.0.IEQ12345.LEVEL?value=1\u0026prettyPrint` =\u003e\r\n\r\n```json\r\n{\r\n       \"id\": \"hm-rpc.0.IEQ12345.LEVEL\",\r\n       \"value\": 1\r\n     }\r\n```\r\n\r\n`http://ip:8087/set/hm-rpc.0.IEQ12345.LEVEL?value=1\u0026wait=5000\u0026prettyPrint` =\u003e\r\n\r\n```json\r\n{\r\n       \"val\": 1,\r\n       \"ack\": true,\r\n       \"ts\": 1423155399,\r\n       \"from\": \"hm-rpc.0.IEQ12345.LEVEL\",\r\n       \"lc\": 1423155399\r\n     }\r\n```\r\n\r\nIf no answer is received in specified time, the `null` value will be returned.\r\nIn the first case the answer will be returned immediately and `ack` is false. In the second case `ack` is true. That means it was response from driver.\r\n\r\n### setBulk\r\n- write the bulk of IDs in one request.\r\n\r\n`http://ip:8087/setBulk?hm-rpc.0.FEQ1234567:1.LEVEL=0.7\u0026Anwesenheit=0\u0026prettyPrint` =\u003e\r\n\r\n```json\r\n  [\r\n    {\r\n      \"id\": \"hm-rpc.0.FEQ1234567:1.LEVEL\",\r\n      \"val\": \"0.7\"\r\n    },\r\n    {\r\n      \"error\": \"error: datapoint \\\"Anwesenheit\\\" not found\"\r\n    }\r\n  ]\r\n```\r\nYou can send this request as POST too. Please use content type `text/plain` and put the data in the body.\r\n\r\n### objects\r\nGet the list of all objects for pattern. If no pattern is specified, all objects as JSON array will be returned.\r\n\r\n`http://ip:8087/objects?prettyPrint` =\u003e\r\n\r\n```json\r\n  {\r\n  \"system.adapter.admin.0.uptime\": {\r\n    \"_id\": \"system.adapter.admin.0.uptime\",\r\n    \"type\": \"state\",\r\n    \"common\": {\r\n      \"name\": \"admin.0.uptime\",\r\n      \"type\": \"number\",\r\n      \"role\": \"indicator.state\",\r\n      \"unit\": \"seconds\"\r\n    },\r\n    \"native\": {}\r\n  },\r\n  \"system.adapter.admin.0.memRss\": {\r\n    \"_id\": \"system.adapter.admin.0.memRss\",\r\n    \"type\": \"state\",\r\n    \"common\": {\r\n      \"name\": \"admin.0.memRss\",\r\n      \"desc\": \"Resident set size\",\r\n      \"type\": \"number\",\r\n      \"role\": \"indicator.state\",\r\n      \"unit\": \"MB\",\r\n      \"history\": {\r\n        \"enabled\": true,\r\n        \"changesOnly\": true,\r\n        \"minLength\": 480,\r\n        \"maxLength\": 960,\r\n        \"retention\": 604800,\r\n        \"debounce\": 10000\r\n      }\r\n    },\r\n    \"native\": {}\r\n  },\r\n  ...\r\n```\r\n\r\nGet all control objects of adapter system.adapter.admin.0:\r\n`http://ip:8087/objects?pattern=system.adapter.admin.0*\u0026prettyPrint` =\u003e\r\n\r\n```json\r\n    {\r\n    \"system.adapter.admin.0.uptime\": {\r\n      \"_id\": \"system.adapter.admin.0.uptime\",\r\n      \"type\": \"state\",\r\n      \"common\": {\r\n        \"name\": \"admin.0.uptime\",\r\n        \"type\": \"number\",\r\n        \"role\": \"indicator.state\",\r\n        \"unit\": \"seconds\"\r\n      },\r\n      \"native\": {}\r\n    },\r\n    ...\r\n\r\n```\r\n\r\n### states\r\nGet the list of all states for pattern. If no pattern is specified, all states as JSON array will be returned.\r\n\r\n`http://ip:8087/states?prettyPrint` =\u003e\r\n\r\n```json\r\n  {\r\n    \"system.adapter.admin.0.uptime\": {\r\n      \"val\": 32176,\r\n      \"ack\": true,\r\n      \"ts\": 1423156164,\r\n      \"from\": \"system.adapter.admin.0\",\r\n      \"lc\": 1423156164\r\n    },\r\n    \"system.adapter.admin.0.memRss\": {\r\n      \"val\": 41.14,\r\n      \"ack\": true,\r\n      \"ts\": 1423156164,\r\n      \"from\": \"system.adapter.admin.0\",\r\n      \"lc\": 1423156119\r\n    },\r\n    \"system.adapter.admin.0.memHeapTotal\": {\r\n      \"val\": 31.19,\r\n      \"ack\": true,\r\n      \"ts\": 1423156164,\r\n      \"from\": \"system.adapter.admin.0\",\r\n      \"lc\": 1423155084\r\n    },\r\n  ...\r\n```\r\n\r\nGet all control objects of adapter system.adapter.admin.0:\r\n\r\n`http://ip:8087/states?pattern=system.adapter.admin.0*\u0026prettyPrint` =\u003e\r\n\r\n```json\r\n    {\r\n      \"system.adapter.admin.0.uptime\": {\r\n        \"val\": 32161,\r\n        \"ack\": true,\r\n        \"ts\": 1423156149,\r\n        \"from\": \"system.adapter.admin.0\",\r\n        \"lc\": 1423156149\r\n      },\r\n      \"system.adapter.admin.0.memRss\": {\r\n        \"val\": 41.14,\r\n        \"ack\": true,\r\n        \"ts\": 1423156149,\r\n        \"from\": \"system.adapter.admin.0\",\r\n        \"lc\": 1423156119\r\n      },\r\n      \"system.adapter.admin.0.memHeapTotal\": {\r\n        \"val\": 31.19,\r\n        \"ack\": true,\r\n        \"ts\": 1423156149,\r\n        \"from\": \"system.adapter.admin.0\",\r\n        \"lc\": 1423155084\r\n      },\r\n      \"system.adapter.admin.0.memHeapUsed\": {\r\n        \"val\": 19.07,\r\n        \"ack\": true,\r\n        \"ts\": 1423156149,\r\n        \"from\": \"system.adapter.admin.0\",\r\n        \"lc\": 1423156149\r\n      },\r\n      \"system.adapter.admin.0.connected\": {\r\n        \"val\": true,\r\n        \"ack\": true,\r\n        \"ts\": 1423156149,\r\n        \"from\": \"system.adapter.admin.0\",\r\n        \"lc\": 1423128324,\r\n        \"expire\": 28100\r\n      },\r\n      \"system.adapter.admin.0.alive\": {\r\n        \"val\": true,\r\n        \"ack\": true,\r\n        \"ts\": 1423156149,\r\n        \"from\": \"system.adapter.admin.0\",\r\n        \"lc\": 1423128324,\r\n        \"expire\": 28115\r\n      }\r\n    }\r\n```\r\n\r\n### search\r\nIf a data source (History, SQL) in the configuration is set, then only the data points known to the data source are listed.\r\nIf the option 'List all data points' has been activated or no data source has been specified, all data points will be listed.\r\n\r\n`http://ip:8087/search?pattern=system.adapter.admin.0*\u0026prettyPrint` =\u003e\r\n\r\n```json\r\n  {\r\n    \"system.adapter.admin.0.outputCount\",\r\n    \"system.adapter.admin.0.inputCount\",\r\n    \"system.adapter.admin.0.uptime\",\r\n    \"system.adapter.admin.0.memRss\",\r\n    \"system.adapter.admin.0.memHeapTotal\",\r\n    \"system.adapter.admin.0.memHeapUsed\",\r\n    \"system.adapter.admin.0.cputime\",\r\n    \"system.adapter.admin.0.cpu\",\r\n    \"system.adapter.admin.0.connected\",\r\n    \"system.adapter.admin.0.alive\"\r\n  }\r\n```\r\n\r\n### query\r\nIf a data source (History, SQL) is specified, data from the specified data points will be retrieved for the given period.\r\n\r\n`http://ip:8087/query/system.host.iobroker-dev.load,system.host.iobroker-dev.memHeapUsed/?prettyPrint\u0026dateFrom=2019-06-08T01:00:00.000Z\u0026dateTo=2019-06-08T01:00:10.000Z` =\u003e\r\n\r\n```json\r\n  [\r\n    {\r\n      \"target\": \"system.host.iobroker-dev.load\",\r\n      \"datapoints\": [\r\n        [\r\n          0.12,\r\n          1559955600000\r\n        ],\r\n        [\r\n          0.46,\r\n          1559955601975\r\n        ],\r\n        [\r\n          0.44,\r\n          1559955610000\r\n        ]\r\n      ]\r\n    },\r\n    {\r\n      \"target\": \"system.host.iobroker-dev.memHeapUsed\",\r\n      \"datapoints\": [\r\n        [\r\n          23.01,\r\n          1559955600000\r\n        ],\r\n        [\r\n          22.66,\r\n          1559955601975\r\n        ],\r\n        [\r\n          22.69,\r\n          1559955610000\r\n        ]\r\n      ]\r\n    }\r\n  ]\r\n```\r\n\r\nIf no data source was specified or the noHistory parameter is passed, then only the current value of the data point is read out.\r\n\r\n`http://ip:8087/query/system.host.iobroker-dev.load,system.host.iobroker-dev.memHeapUsed/?prettyPrint\u0026noHistory=true` =\u003e\r\n\r\n```json\r\n  [\r\n    {\r\n      \"target\": \"system.host.iobroker-dev.load\",\r\n      \"datapoints\": [\r\n        [\r\n          0.58,\r\n          1559970500342\r\n        ]\r\n      ]\r\n    },\r\n    {\r\n      \"target\": \"system.host.iobroker-dev.memHeapUsed\",\r\n      \"datapoints\": [\r\n        [\r\n          21.53,\r\n          1559970500342\r\n        ]\r\n      ]\r\n    }\r\n  ]\r\n```\r\n\r\nYou can use relative time in the query. For example, `dateFrom=-1h` or `dateTo=today`.\r\n\r\nThe following relative patterns are supported:\r\n- `hour` or `thisHour` or `this hour` - start of the current hour\r\n- `last hour` or `lastHour` - start of the previous hour\r\n- `today` - start of the current day\r\n- `yesterday` - start of the previous day\r\n- `week` or `thisWeek` or `this week` - start of the current week\r\n- `lastWeek` or `last week` - start of the previous week\r\n- `month` or `thisMonth` or `this month` - start of the current month\r\n- `lastMonth` or `last month` - start of the previous month\r\n- `year` or `thisYear` or `this year` - start of the current year\r\n- `lastYear` or `last year` - start of the previous year\r\n- `-Nd` - N days ago\r\n- `-NM` - N months ago\r\n- `-Ny` - N years ago\r\n- `-Nh` - N hours ago\r\n- `-Nm` - N minutes ago\r\n- `-Ns` - N seconds ago\r\n\r\n## CORS\r\nWith option \"Allow origin (CORS)\" you can set the `Access-Control-Allow-Origin` header to allow requests from other domains.\r\n\r\nIf you leave it blank, the header will not be set.\r\n\r\n## Modifiers\r\nYou can use some options to modify the answer:\r\n- `prettyPrint` - to get the output in human-readable form\r\n- `json` - to force the parsing of the value in the `getPlainValue` command\r\n- `timeRFC3339` - to get the time of timestamps (`ts` and `lc`) in RFC3339 format, like `2019-06-08T01:00:00.000Z`\r\n- `callback` - response with JSONP format. In `callback=\u003cCALLBACK\u003e` the `CALLBACK` is the name of the callback function\r\n\r\n## Authentication\r\nThis adapter supports the following types of authentication:\r\n- Query parameter `user` and `pass`\r\n- Basic authentication\r\n- Oauth2 Bearer token in the header. Read more in the web adapter about how to get tokens.\r\n\r\n\u003c!--\r\n\tPlaceholder for the next version (at the beginning of the line):\r\n\t### **WORK IN PROGRESS**\r\n--\u003e\r\n## Changelog\n### 3.0.7 (2025-06-16)\r\n* (@GermanBluefox) corrected reading of history data\n\n### 3.0.6 (2025-03-15)\r\n* (bluefox) Added support for 'Access-Control-Allow-Origin'\r\n* (bluefox) Removed letsencrypt information\r\n* (bluefox) Added basic and OAuth2 authentication\r\n* (bluefox) Implemented JSONP response\r\n* (bluefox) Implemented relative times for query\n\n### 3.0.5 (2025-03-13)\r\n* (bluefox) Corrected the indication of running mode in admin\r\n* (bluefox) Corrected the writing of numeric values\r\n* (bluefox) Clear cache after 10 minutes\n\n### 3.0.0 (2025-03-09)\r\n* BREAKING: When the adapter is configured to work as a web extension, no own local port is opened anymore\r\n* (bluefox) Updated packages\r\n* (bluefox) Migrated to TypeScript\r\n* (bluefox) If State/Object not found, the response will be 404 (and not 500)\r\n* (bluefox) If a user has no permission, the response will be 403 (and not 401)\n\n### 2.8.0 (2024-05-23)\r\n* (foxriver76) ported to `@iobroker/webserver`\n\n### 2.7.2 (2022-10-08)\r\n* (Apollon77) Prepare for future js-controller versions\n\n### 2.7.1 (2022-08-29)\r\n* (bluefox) Check if the port is occupied only on defined interface\r\n* (bluefox) Added JSON config\n\n### 2.7.0 (2022-05-31)\r\n* (crycode-de) Allow use of ack flag for setBulk post requests\r\n* (Apollon77) Return an ack flag too on getBulk\n\n### 2.6.5 (2022-04-14)\r\n* Added support for aggregate and count for queries\n\n### 2.6.4 (2022-03-17)\r\n* (Apollon77) Optimize performance, especially when using names instead of object ids\n\n### 2.6.3 (2022-02-19)\r\n* (Apollon77) Optimize error message for multi-language objects\r\n* (Apollon77) Do not overwrite state properties by object properties\n\n### 2.6.2 (2021-11-12)\r\n* (bluefox) Support of new flags for `getPlainValue`: `json` and `noStringify`\n\n### 2.6.1 (2021-05-13)\r\n* (Apollon77) Catch error in request parsing when malformed (Sentry IOBROKER-SIMPLE-API-16)\n\n### 2.6.0 (2021-05-09)\r\n* (Apollon77) Also URL-Decode the path parts like state ids\r\n* (Apollon77) Optimize for js-controller 3.3\n\n### 2.5.3 (2021-01-25)\r\n* (Apollon77) Make sure that delayed answers are not crashing (Sentry IOBROKER-SIMPLE-API-Z)\n\n### 2.5.2 (2021-01-09)\r\n* (bluefox) Support of new Let's Encrypt (only with js-controller 3.2.x)\n\n### 2.4.8 (2020-09-17)\r\n* (Apollon77) Make sure missing favico file locally is not throwing exceptions (Sentry IOBROKER-SIMPLE-API-G)\n\n### 2.4.7 (2020-08-17)\r\n* (Apollon77) check that targets are an array for \"query\" requests (Sentry IOBROKER-SIMPLE-API-F)\n\n### 2.4.6 (2020-06-11)\r\n* (Apollon77) Make sure that the adapter is showing the correct error when webserver cannot be initialized (Sentry IOBROKER-SIMPLE-API-7)\n\n### 2.4.5 (2020-05-04)\r\n* (Apollon77) webserver initialization optimized again to prevent errors with invalid certificates\n\n### 2.4.4 (2020-05-02)\r\n* (Apollon77) Make sure Permission errors do not crash adapter (Sentry IOBROKER-SIMPLE-API-3)\n\n### 2.4.3 (2020-04-30)\r\n* (Apollon77) Optimize web server error handling\n\n### 2.4.1 (2020-04-23)\r\n* (bluefox) Caught the web server errors\n\n### 2.4.0 (2020-04-12)\r\n* (Apollon77) Add Sentry support with js-controller 3.0\r\n* (Apollon77) fix potential crash\n\n### 2.3.3 (2019-11-16)\r\n* (bluefox) Added response code for unknown commands\n\n### 2.3.2 (2019-10-18)\r\n* (Apollon77) Fix Admin 3 support\n\n### 2.3.1 (2019-10-12)\r\n* (bluefox) Admin 3 is now supported\r\n* (bluefox) NPM packages were updated\n\n### 2.2.0 (2019-09-10)\r\n* (bluefox) New flags are supported: ack and type\r\n* (bluefox) Return error codes as JSON if no pretty print defined\n\n### 2.1.2 (2019-09-05)\r\n* (Apollon77) fix compact mode\n\n### 2.1.0 (2019-07-05)\r\n* (Marco.K) Added command set for the Grafana plugins JSON / SimpleJSON. Usage see https://forum.iobroker.net/topic/23033/aufruf-modifikation-simpleapi-adapter-iobroker-als-datenquelle-f%C3%BCr-grafana\n\n### 2.0.5 (2019-06-26)\r\n* (Apollon77) remove logging\n\n### 2.0.4 (2019-06-23)\r\n* (Apollon77) fix usage as web extension\n\n### 2.0.2 (2018-12-17)\r\n* (Apollon77) fix decoding for state Ids with # in it\n\n### 2.0.0 (2018-06-29)\r\n* (Giermann) BREAKING CHANGE: getBulk is returning data in a different structure\n\n### 1.6.3 (2018-04-15)\r\n* (Apollon77) Return used character encoding (UTF-8)\n\n### 1.6.2 (2017-11-27)\r\n* (Apollon77) Fix decoding problems\n\n### 1.6.1 (2017-09-25)\r\n* (Apollon77) Fix statuscode for setBulk and optimize permission errors\n\n### 1.6.0 (2017-07-10)\r\n* (Apollon77) Fix handling of URL-encoded values, they are now decoded properly\r\n* (Apollon77) Optimize Permission handling\r\n* (Apollon77) add possibility to only allow access to states where user is also owner, finally works correct with js-controller 1.1.1!\n\n### 1.5.0 (2017-03-10)\r\n* (greyhound) Add new POST method setValueFromBody\n\n### 1.4.0 (2017-01-05)\r\n* (bluefox) new web server plugin support\n\n### 1.3.0 (2016-08-30)\r\n* (bluefox) compatible only with new admin\n\n### 1.2.0 (2016-08-27)\r\n* (bluefox) support of letsencrypt certificates\n\n### 1.1.1 (2016-07-06)\r\n* (bluefox) support of chained certificates\n\n### 1.1.0 (2016-02-09)\r\n* (bluefox) fix toggle, objects, states, setBulk, POST\r\n* (bluefox) add tests\n\n### 1.0.0 (2015-09-30)\r\n* (bluefox) stop adapter before update\n\n### 0.1.2 (2015-06-28)\r\n* (bluefox) add description in readme.md\r\n* (bluefox) change \"toggle\" for boolean and numbers\n\n### 0.1.1 (2015-06-28)\r\n* (bluefox) change setForeignState api\r\n* (bluefox) add type to io-package.json\r\n* (bluefox) enable run from \"web\"\r\n* (bluefox) add default user\n\n### 0.1.0 (2015-06-10)\r\n* (bluefox) change setForeignState api\r\n* (bluefox) support of user permissions\n\n### 0.0.4 (2015-03-11)\r\n* (bluefox) remove socket.io from file\n\n### 0.0.3 (2015-02-13)\r\n* (bluefox) remove socket.io from dependencies\n\n### 0.0.2 (2015-02-12)\r\n* (bluefox) enable be a part of \"web\"\n\n### 0.0.1 (2015-02-06)\r\n* (bluefox) initial commit\n\n## License\r\nThe MIT License (MIT)\r\n\r\nCopyright (c) 2015-2025 bluefox \u003cdogafox@gmail.com\u003e\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiobroker%2Fiobroker.simple-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiobroker%2Fiobroker.simple-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiobroker%2Fiobroker.simple-api/lists"}