{"__v":4,"_id":"55a940d902becf2d007aac67","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-17T17:52:25.108Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"Clone the [Go SDK](https://github.com/AYLIEN/aylien_textapi_go) from our GitHub or use `go get` to download and install the SDK:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"go get github.com/AYLIEN/aylien_textapi_go\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nYou can then initiate the SDK easily:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"package main\\n\\nimport (\\n  \\\"fmt\\\"\\n  textapi \\\"github.com/AYLIEN/aylien_textapi_go\\\"\\n)\\n\\nfunc main() {\\n  auth := textapi.Auth{\\\"[[app:id]]\\\", \\\"[[app:key]]\\\"}\\n  client, err := textapi.NewClient(auth, true)\\n  if err != nil {\\n      panic(err)\\n  }\\n}\",\n      \"language\": \"go\"\n    }\n  ]\n}\n[/block]\nThe `client` 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\": \"text := \\\"John is a very good football player!\\\"\\nsentimentParams := &textapi.SentimentParams{Text: text}\\nsentiment, err := client.Sentiment(sentimentParams)\\nif err != nil {\\n  panic(err)\\n}\\nfmt.Printf(\\\"%v\\\\n\\\", sentiment)\",\n      \"language\": \"go\"\n    }\n  ]\n}\n[/block]\nYou can find examples for utilizing other endpoints in **Go** in the Endpoints section of this documentation.","excerpt":"Easiest way to get up & running with Text Analysis API in Go","slug":"go-sdk","type":"basic","title":"Go SDK"}

Go SDK

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

Clone the [Go SDK](https://github.com/AYLIEN/aylien_textapi_go) from our GitHub or use `go get` to download and install the SDK: [block:code] { "codes": [ { "code": "go get github.com/AYLIEN/aylien_textapi_go", "language": "shell" } ] } [/block] You can then initiate the SDK easily: [block:code] { "codes": [ { "code": "package main\n\nimport (\n \"fmt\"\n textapi \"github.com/AYLIEN/aylien_textapi_go\"\n)\n\nfunc main() {\n auth := textapi.Auth{\"[[app:id]]\", \"[[app:key]]\"}\n client, err := textapi.NewClient(auth, true)\n if err != nil {\n panic(err)\n }\n}", "language": "go" } ] } [/block] The `client` 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": "text := \"John is a very good football player!\"\nsentimentParams := &textapi.SentimentParams{Text: text}\nsentiment, err := client.Sentiment(sentimentParams)\nif err != nil {\n panic(err)\n}\nfmt.Printf(\"%v\\n\", sentiment)", "language": "go" } ] } [/block] You can find examples for utilizing other endpoints in **Go** in the Endpoints section of this documentation.