This is Imagga's unofficial Go client, designed to enable you to use Imagga's services easily from your own applications.
Imagga is a cloud-based analytics service that through APIs allows you extract meaning from images and text.
API version | SDK version |
---|---|
v2 | v1.0.0 |
You can load imagga-go into your project by using:
go get github.com/henomis/imagga-go
The only thing you need to start using Imagga's APIs is the developer license key and related secret. Copy it and paste it in the corresponding place in the code, select the API you want to use and the parameters you want to use, and that's it.
Please refer to the examples folder to see how to use the SDK.
Here below a simple usage example:
package main
import (
"encoding/json"
"fmt"
"log"
imaggago "github.com/henomis/imagga-go"
"github.com/henomis/imagga-go/pkg/request"
)
const apiKey = "YOUR_API_KEY"
const apiSecret = "YOUR_API_SECRET"
func main() {
imaggaClient := imaggago.New(
imaggago.ImaggaEndpointV2,
apiKey,
apiSecret,
nil,
)
response, err := imaggaClient.Barcodes(
&request.Barcodes{
ImageURL: "https://imagga.com/static/images/technology/barcode.png",
},
)
if err != nil {
log.Fatal(err)
}
if !response.IsSuccess() {
log.Fatal(response.Error())
}
bytes, _ := json.MarshalIndent(response, "", " ")
fmt.Println(string(bytes))
}