{"_id":"55a936e3c8bd450d000dd1de","parentDoc":null,"category":{"_id":"55a936b1cf45e1390093f362","version":"55a7aee84a33f92b00b7a153","__v":6,"project":"55a7aee84a33f92b00b7a150","pages":["55a936e3c8bd450d000dd1de","55a9390b4c661b3700cf4e21","55a93bd35d3abb0d0012f194","55a93cb702becf2d007aac47","55a93efb02becf2d007aac55","55a940d902becf2d007aac67"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-17T17:09:05.944Z","from_sync":false,"order":1,"slug":"sdks","title":"SDKs"},"project":"55a7aee84a33f92b00b7a150","__v":7,"user":"55a7ae50bf1be93100d89df1","version":{"_id":"55a7aee84a33f92b00b7a153","__v":6,"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-17T17:09:55.184Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"Clone the [Ruby SDK](https://github.com/AYLIEN/aylien_textapi_ruby) from our GitHub or use `gem` to download and install the SDK:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"gem install aylien_text_api\",\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\": \"require 'aylien_text_api'\\n\\ntextapi = AylienTextApi::Client.new(app_id: \\\"[[app:id]]\\\", app_key: \\\"[[app:key]]\\\")\",\n      \"language\": \"ruby\"\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 text: \\\"John is a very good football player!\\\"\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\nYou can find examples for utilizing other endpoints in **Ruby** in the Endpoints section of this documentation.","excerpt":"Easiest way to get up & running with Text Analysis API in Ruby","slug":"ruby-sdk","type":"basic","title":"Ruby SDK"}

Ruby SDK

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

Clone the [Ruby SDK](https://github.com/AYLIEN/aylien_textapi_ruby) from our GitHub or use `gem` to download and install the SDK: [block:code] { "codes": [ { "code": "gem install aylien_text_api", "language": "shell" } ] } [/block] You can then import and initiate the SDK easily: [block:code] { "codes": [ { "code": "require 'aylien_text_api'\n\ntextapi = AylienTextApi::Client.new(app_id: \"[[app:id]]\", app_key: \"[[app:key]]\")", "language": "ruby" } ] } [/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 text: \"John is a very good football player!\"", "language": "ruby" } ] } [/block] You can find examples for utilizing other endpoints in **Ruby** in the Endpoints section of this documentation.