Available in Classic and VPC
After completing template registration in the CLOVA OCR builder and finishing testing and service deployment, you can use CLOVA OCR through the REST API. This document provides guidance on how to input an image through TEXT OCR API, obtain the recognition results, and convert them, along with examples.
- Template OCR also can call API in the same way.
- For more information on API call, see CLOVA OCR API guide.
The following is a description on the steps to enter and convert images through TEXT OCR API and details of each step.
- 1. API environment settings
- 2. Automatic integrating with API Gateway
- 3. API Gateway creation URL check
- 4. API call through Postman
1. API environment settings
To control TEXT OCR via API, the very first step is to create a domain in CLOVA OCR of the NAVER Cloud Platform console. Once you create a domain in the OCR builder, a unique InvokeURL is assigned. The InvokeURL is not disclosed directly to external services for the provision of secure service, and it is designed to be integrated with API Gateway to increase the level of security and service processing.
2. Automatic integrating with API Gateway
To use InvokeURL, integrate it with API Gateway. There are two ways to integrate with API Gateway: automatic and manual. If you choose automatic integration, you can complete the process easily with just a few clicks. The following example shows how to perform automatic integration: To set up an automatic integration:
- To create a Secret Key in OCR builder, click [Create].

- To connect API Gateway automatically, click [Automatic integration].
- If you are not currently using API Gateway, when the automatic integration popup appears, click [OK] to apply for use.

- Once the integration is complete, copy the Secret Key and the OCR Invoke URL values required for API calls.
- Secret Key: {X-OCR-SECRET}
- OCR Invoke URL: {OCR Invoke URL}
3. API Gateway creation URL check
Go to the API Gateway section in the NAVER Cloud Platform Console and check the API Gateway creation URL. If the Product named OCR_CUSTOM_API_KR was successfully created, the API call is ready. To check the API Gateway creation URL:
- In the NAVER Cloud Platform console, navigate to
> Services > AI Services > CLOVA OCR. - Click My Products menu.
- Check if the product named OCR_CUSTOM_API_KR was created.
- If it was successfully created, the API call is ready.
4. API call through Postman
When you run the Text OCR API, you can extract text from the uploaded image. The image recognition results are returned in JSON format, and you can utilize the returned values in your service. To call the Text OCR API:
The Text OCR API call section briefly explains how to extract. For more information, see CLOVA OCR API guide.
- Create a new API in Postman and set the call method to POST.
- In the Invoke URL address, enter InvokeURL of API Gateway that you created in OCR.

- Enter X-OCR-SECRET information in the Header section.
- Content-Type : application/json
- X-OCR-SECRET : {X-OCR-SECRET }
- Add the text OCR call body in an image recognition request body form.

{ "images": [ { "format": "png", "name": "medium", "data": null, "url": "https://kr.object.ncloudstorage.com/ocr-img/OCR_ko(1)REAN_ko(1).png" } ], "lang": "ko", "requestId": "string", "resultType": "string", "timestamp": {{$timestamp}}, "version": "V1" } - To check the response result, click [SEND].

- Check the response result.
{ "version":"V1", "requestId":"string", "timestamp":1576569034247, "images":[ { "uid":"9fd73a6aacad4025b3099a36ee55aacd", "name":"medium","inferResult":"SUCCESS","message":"SUCCESS", "fields":[ {"inferText":"I","inferConfidence":0.9967288}, {"inferText":"return","inferConfidence":0.9998919}, {"inferText":"to heavens","inferConfidence":0.9999104}, {"inferText":"When the picnic ends","inferConfidence":0.99992156}, {"inferText":"in this beautiful","inferConfidence":0.99958915}, {"inferText":"world","inferConfidence":0.9998707}, {"inferText":"I","inferConfidence":0.9988277}, {"inferText":"will","inferConfidence":0.9999253}, {"inferText":"say","inferConfidence":0.99908936}, {"inferText":"it","inferConfidence":0.99974936}, {"inferText":"was","inferConfidence":0.9997728}, {"inferText":"wonderful","inferConfidence":0.9993808} ], "validationResult":{"result":"NO_REQUESTED"}} ] } - Use the response result in your service.