{"__v":30,"_id":"55a8fba727a17d21005251f2","category":{"__v":6,"_id":"55a936b1cf45e1390093f362","pages":["55a936e3c8bd450d000dd1de","55a9390b4c661b3700cf4e21","55a93bd35d3abb0d0012f194","55a93cb702becf2d007aac47","55a93efb02becf2d007aac55","55a940d902becf2d007aac67"],"project":"55a7aee84a33f92b00b7a150","version":"55a7aee84a33f92b00b7a153","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-17T17:09:05.944Z","from_sync":false,"order":1,"slug":"sdks","title":"SDKs"},"parentDoc":null,"project":"55a7aee84a33f92b00b7a150","user":"55a7ae50bf1be93100d89df1","version":{"__v":6,"_id":"55a7aee84a33f92b00b7a153","project":"55a7aee84a33f92b00b7a150","createdAt":"2015-07-16T13:17:28.411Z","releaseDate":"2015-07-16T13:17:28.411Z","categories":["55a7aee94a33f92b00b7a154","55a7fefa3efe0c2f0074cbdf","55a8fb10c8bd450d000dd130","55a936b1cf45e1390093f362","55abddeaa36ccd0d00fdebe1","5624db675a86b423009462e1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-17T12:57:11.535Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Clone the [NodeJS SDK](https://github.com/AYLIEN/aylien_textapi_nodejs) from our GitHub or use `npm` to download and install the SDK:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"npm install aylien_textapi\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nYou can then import and initiate the SDK easily:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var AYLIENTextAPI = require('aylien_textapi');\\nvar textapi = new AYLIENTextAPI({\\n  application_id: \\\"[[app:id]]\\\",\\n  application_key: \\\"[[app:key]]\\\"\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nThe `textapi` object is now instantiated and contains various methods for calling different API endpoints. For instance to use Sentiment Analysis you can write the following code:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"textapi.sentiment({\\n  'text': 'John is a very good football player!'\\n}, function(error, response) {\\n  if (error === null) {\\n    console.log(response);\\n  }\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nYou can find examples for utilizing other endpoints in **NodeJS** in the Endpoints section of this documentation.","excerpt":"Easiest way to get up & running with Text Analysis API in NodeJS","slug":"node-sdk","type":"basic","title":"NodeJS SDK"}

NodeJS SDK

Easiest way to get up & running with Text Analysis API in NodeJS

Clone the [NodeJS SDK](https://github.com/AYLIEN/aylien_textapi_nodejs) from our GitHub or use `npm` to download and install the SDK: [block:code] { "codes": [ { "code": "npm install aylien_textapi", "language": "shell" } ] } [/block] You can then import and initiate the SDK easily: [block:code] { "codes": [ { "code": "var AYLIENTextAPI = require('aylien_textapi');\nvar textapi = new AYLIENTextAPI({\n application_id: \"[[app:id]]\",\n application_key: \"[[app:key]]\"\n});", "language": "javascript" } ] } [/block] The `textapi` object is now instantiated and contains various methods for calling different API endpoints. For instance to use Sentiment Analysis you can write the following code: [block:code] { "codes": [ { "code": "textapi.sentiment({\n 'text': 'John is a very good football player!'\n}, function(error, response) {\n if (error === null) {\n console.log(response);\n }\n});", "language": "javascript" } ] } [/block] You can find examples for utilizing other endpoints in **NodeJS** in the Endpoints section of this documentation.