/aylien_textapi_go

AYLIEN's officially supported Go client library for accessing Text API

Primary LanguageGoOtherNOASSERTION

About

This is the Go client library for AYLIEN's APIs. If you haven't already done so, you will need to sign up.

Installation

To install, simply use go get:

$ go get github.com/AYLIEN/aylien_textapi_go

See the Developers Guide for additional documentation.

Example

package main

import (
	"fmt"
	textapi "github.com/AYLIEN/aylien_textapi_go"
)

func main() {
	auth := textapi.Auth{"YourApplicationId", "YourApplicationKey"}
	client, err := textapi.NewClient(auth, true)
	if err != nil {
		panic(err)
	}
	params := &textapi.SentimentParams{Text: "John is a very good football player!"}
	sentiment, err := client.Sentiment(params)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%v\n", sentiment)
}