GoodMem
ReferenceClient SDKsGo SDK

OCR API

OCR API documentation for Go SDK

The default url is http://localhost:8080

MethodHTTP requestDescription
OcrDocumentPost /v1/ocr:documentRun OCR on a document or image

OcrDocument

OcrDocumentResponse OcrDocument(ctx).OcrDocumentRequest(ocrDocumentRequest).Execute()

Run OCR on a document or image

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	ocrDocumentRequest := *goodmem_client.NewOcrDocumentRequest("JVBERi0xLjQKJcTl8uXr...") // OcrDocumentRequest | OCR request payload

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.OCRAPI.OcrDocument(context.Background()).OcrDocumentRequest(ocrDocumentRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `OCRAPI.OcrDocument``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `OcrDocument`: OcrDocumentResponse
	fmt.Fprintf(os.Stdout, "Response from `OCRAPI.OcrDocument`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiOcrDocumentRequest struct via the builder pattern

NameTypeDescriptionNotes
ocrDocumentRequestOcrDocumentRequestOCR request payload

Return type

OcrDocumentResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK