{"id":21331143,"url":"https://github.com/netbeast/api","last_synced_at":"2025-07-12T09:31:33.888Z","repository":{"id":57310236,"uuid":"42587402","full_name":"netbeast/api","owner":"netbeast","description":":rocket: Node.js wrapper for the resources Netbeast Router HTTP API. ","archived":false,"fork":false,"pushed_at":"2016-06-09T10:20:43.000Z","size":6769,"stargazers_count":11,"open_issues_count":6,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-11T20:38:01.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://netbeast.co","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netbeast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-16T13:02:51.000Z","updated_at":"2020-11-13T15:26:40.000Z","dependencies_parsed_at":"2022-09-09T21:20:54.222Z","dependency_job_id":null,"html_url":"https://github.com/netbeast/api","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbeast%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbeast%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbeast%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbeast%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netbeast","download_url":"https://codeload.github.com/netbeast/api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225812262,"owners_count":17527961,"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":[],"created_at":"2024-11-21T22:29:33.336Z","updated_at":"2024-11-21T22:29:33.875Z","avatar_url":"https://github.com/netbeast.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Reference\n\nWelcome to the Netbeast API Documentation!\n\nThe main goal of this documentation is to explain how the Netbeast API works. All the information that you need to start building your Apps has been gathered here.\n\n## How to use it?\n\nFirst of all, you need to install the npm package in your netbeast app\n````\nnpm install netbeast --save\n````\n Once the package is in the node_modules folder, you can require it from the code.\n\n```javascript\nvar beast = require('netbeast')\n\nbeast('lights').get()\n\nbeast('music').at('living-room').set({status: 'play', volume: 100})\n\nbeast('video').get('status')\n```\n\nControl your smart devices with Netbeast is as simple as that. Lets go deeper! :rocket:\n\n###Arguments\n\nEach device support specific parameters.\nIf you try to set an unsupported parameter to a switch (for example the brightness, `beast('switch').set({brightness: 80})`) you will return a soft error. The process keep working but send you a warning.\n\nHere is a list of supported arguments for each device.\n* switch \u0026 bridge\n    * power:  `true || false`\n* lights\n    * power:    `true || false`\n    * hue:           `0..360`\n    * saturation:    `0..100`\n    * brightness:    `0..100`\n    * color: `{r: 0, g: 0, b: 0} || #FF13AA`\n* music \u0026 video\n    * volume:       `0..100`\n    * status:       `play || pause || stop || mute || unmute || info`\n    * track:        `must be the url of the song/video`\n* temperature       `ºC`\n* humidity          `0..100`\n* luminosity        `photons per square meter`\n* battery           `0..100`\n\nA example of use:\n````javascript\nvar beast = require('netbeast')\nbeast('lights').set({power: true, brightness: 100, hue: 0, saturation: 100})\n````\n If you have white and color bulbs, the first ones are going to switch on and change the brightness. The color bulbs will also change their color to red and the execution continues without problems.\n\n###Output\n\nAll the methods acts as a promise and they always return a Javascript object if successful or an error object else.\n````javascript\nvar beast = require('netbeast')\n\nbeast('temperature').at('kitchen').get()\n.then(function (data) {\n  console.log('The temperature in the kitchen is ' + data + 'ºC')\n}).catch(function (err) {\n  console.log('Error: ' + err)\n})\n````\nYou will find all the documentation and how to use the different methods [here](http://docs.netbeast.co/chapters/api_reference/index.html)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetbeast%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetbeast%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetbeast%2Fapi/lists"}