Go SDK

Idiomatic Go client for screaming fast goroutine-powered batch OCR requests.

go get github.com/solveocr/solveocr-go

Quickstart Menu

Initialize the Client

import "github.com/solveocr/solveocr-go"

fn main() {
    client := solveocr.NewClient("sk-your-secret-key")
}

Extract Text from a File

Easily pass local files to the synchronous extraction endpoint.

res, err := client.ExtractFile("receipt.pdf")
if err != nil {
    log.Fatal(err)
}

fmt.Printf("Total Confidence: %v\n", res.Confidence)
fmt.Printf("Text: %v\n", res.Text)

Async Batch Processing

The Go SDK utilizes optimized pipelining under the hood for parallel batch processing.

paths := []string{"doc1.png", "doc2.png", "doc3.jpeg"}
batchRes, _ := client.ExtractBatchAsync(context.Background(), paths)

for _, doc := range batchRes.Results {
    fmt.Println(doc.Text)
}
Content-Length: 0