CLOVA OCR Document API
    • PDF

    CLOVA OCR Document API

    • PDF

    Article Summary

    version

    VersionDateChanges
    v1.0.02021-03-04최초작성
    v1.0.22021-07-22foundValuesSum -> foundValueSum
    신분증에 maskingPolys 추가
    v1.0.32021-09-16신분증에 외국인등록증 추가
    v1.0.42022-04-21신분증 테두리 위치 표기
    외국인 등록증에 alienRegNumEtc 추가
    신용카드에 이름 추가
    v1.0.52023-05-25여권 MRZ API
    v1.0.62023-11-23영수증 부가세 및 할인금액 추가

    요청

    MethodRequest URI
    POSTCLOVA OCR 빌더에서 생성된 API Gateway의 InvokeURL로 호출합니다.
    각 도메인마다 고유의 호출 URL이 생성됩니다.

    Requesting document OCR recognition

    구분설명Path
    Document영수증/document/receipt
    Document신용카드/document/credit-card
    Document명함/document/name-card
    Document사업자등록증/document/biz-license
    Document신분증(주민등록증, 운전면허증, 여권)/document/id-card
    Document여권(Global)/document/passport

    요청 헤더

    헤더명설명
    X-OCR-SECRET도메인에서 API Gateway 연동시 생성한 X-OCR-SECRET:{Client Secret}
    Content-Typeapplication/json : 요청에 JSON 본문 사용. Base64로 인코딩된 image.data 지원.
    - multipart/form-data : 요청에 멀티파트 본문 사용. 스트리밍으로 전송된 이미지 파일 지원.

    요청 바디

    Content-Type : application/json

    1. 이미지 인식 요청
    구분Json Model
    이미지 인식 요청{
    "version": "string",
    "requestId": "string",
    "timestamp": 0,
    "images": [{ "format": "string", "data": "string", "name": "string"}]
    }

    이미지 인식 요청 필드 상세 설명

    필드명필수 여부타입설명제약 사항
    versionYesstring"V2"로 고정
    requestIdYesstringAPI 호출 UUID입니다.
    timestampYes0API 호출 Timestamp 값입니다.
    imagesYesstringJson array로 입력되며, 현재는 1개의 이미지 입력만 허용 됩니다. (한국어/일본어)
    images.formatYesstring이미지 포맷을 설정합니다.“jpg”, “jpeg”, “png” 이미지,"pdf","tiff" 단일 페이지 형식을 지원합니다.
    image.dataYesstringimage.data는 base64 인코딩 이미지 바이트입니다.
    image.nameYesstring이미지 명을 입력합니다. 이미지를 식별하는데 사용되며, 응답 결과 확인에 사용됩니다.

    CURL example:

    curl --request POST 'your apigw invoke url' \
    --header 'X-OCR-SECRET: your secret key' \
    --data-raw '{"images":[{"format":"jpg","name":"demo","data":"your image base64 bytes"}],"requestId":"guide-json-demo","version":"V2","timestamp":1584062336793}'
    

    Content-Type : multipart/form-data

    1. 이미지 인식 요청
    KEYRequiredVALUE
    messageY{"version": "string","requestId": "string","timestamp": 0,"images": [{ "format": "string", "name": "string" }]}
    fileYimage file steam data

    Form Data Message Value Description

    Field nameRequiredTypeDescriptionConstraints
    versionYesstring"V2"로 고정
    requestIdYesstringAPI 호출 UUID입니다.
    timestampYesintegerAPI 호출 Timestamp 값입니다.
    imagesYesstringJSON 어레이로 입력되며, 현재는 1개의 이미지 입력만 허용.
    images.formatYesstring이미지 포맷을 설정합니다.“jpg”, “jpeg”, “png” 이미지 ,"pdf","tiff" 단일 페이지형식을 지원합니다.
    image.nameYesstring이미지 명을 입력합니다. 이미지를 식별하는데 사용되며, 응답 결과 확인에 사용됩니다.

    CURL example:

    curl --request POST 'your apigw invoke url' \
    --header 'X-OCR-SECRET: your secret key' \
    --form 'message={"images":[{"format":"png","name":"demo"}],"requestId":"guide-demo","version":"V2","timestamp":1584062336793}' \
    --form 'file=@image.png'
    

    응답

    응답 바디

    1. Image recognition results
    ClassificationJson Model
    Image recognition results{
    "uid": "string",
    "name": "string",
    "inferResult": "string",
    "message": "string",
    "receipt": {},
    "creditCard": {},
    "bizLicense": {},
    "idCard": {},
    "nameCard": {},
    "passport": {},
    "validationResult": { "result": "string", "message": "string"}
    }

    Detailed description of the Image recognition results field

    Field NameData TypeDescription
    uidstringAPI의 유효성 검사를 위해 제공되는 고유 ID로, 유효성 검사 요청을 추적하는 데 사용.
    namestring요청된 이미지 명.
    inferResultstring이미지 추론 결과.
    "SUCCESS": 이미지 인식 성공. “FAILURE”: 이미지 인식 실패.“ERROR”: 이미지 인식 예외 사항.
    messagestring성공적인 이미지 인식의 경우 "SUCCESS."
    이미지 인식이 실패할 경우, 오류 메시지가 표기됨.
    오류 메시지는 하단에 자세히 표기됨.
    receiptjson objectreceipt 객체 참조
    creditCardjson objectcreditCard 객체 참조
    bizLicensejson objectbizLicense 객체 참조
    idCardjson objectidCard 객체 참조
    nameCardjson objectnameCard 객체 참조
    passportjson objectpassport 객체 참조
    validationResultjson object유효성 검사 결과
    validationResult.resultstring결과 코드
    “NO_REQUESTED”: 유효성 검사 작업이 실행되지 않음.
    “UNCHECKED”: 동작 응답이 확인되지 않거나 수락되지 않음.
    “ERROR”: 유효성 검사 실행 오류.
    “VALID”: 인증 결과가 유효함.
    “INVALID”: 인증 결과가 유효하지 않음.
    “UNCHECHED”, “ERROR” 및 “INVALID” 등은 유효성 검사 실패로 표기됨.
    validationResult.messagestring유효성 검사 상세 메시지에서 항상 반환되는 값은 아님.
    convertedImageInfojson object이미지 형식이 PDF/TIFF인 경우에만 응답.
    요청 형식이 PDF/TIFF인 경우, 좌표는 변환된 이미지를 기준으로 함.
    convertedImageInfo.widthinteger기본 이미지 너비.
    convertedImageInfo.heightinteger기본 이미지 높이.
    convertedImageInfo.pageIndexintegerPDF/TIFF의 페이지 색인
    1. receipt object
    ClassificationJson Model
    receipt Field{
    "meta": {},
    "result": {},
    }

    Receipt Object Field Details

    Field NameData TypeDescription
    metajson object메타 정보
    meta.estimatedLanguagestringOCR에서 추정한 언어 (en: 영어, ja: 일본어, ko: 한국어) | OCR 인식 언어
    resultjson object인식 결과
    result.storeInfojson object매장 정보
    result.storeInfo.poiInfoPoiObject[]POI 그라운딩 결과
    result.storeInfo.nameStringObject상호명
    result.storeInfo.subNameStringObject지점명
    result.storeInfo.bizNumStringObject사업자번호
    result.storeInfo.movieNameStringObject영화 제목 (영화표 관련 항목)
    result.storeInfo.addressesStringObject[]매장 주소
    result.storeInfo.telTelObject[]Telephone number of the store
    result.paymentInfojson object결제 정보
    result.paymentInfo.dateDateObject결제 날짜
    result.paymentInfo.timeTimeObject결제 시간
    result.paymentInfo.cardInfojson objectTransaction card information
    result.paymentInfo.cardInfo.companyStringObject카드사 이름
    result.paymentInfo.cardInfo.numberStringObject카드 번호
    result.paymentInfo.confirmNumBaseObject결제 번호
    result.subResultsjson array항목 그룹 정보
    result.subResults.itemsjson array인식된 항목 정보 (메뉴 등)
    result.subResults.items.nameStringObject항목명
    result.subResults.items.codeStringObject항목 코드
    result.subResults.items.countFloatObject항목 수량
    result.subResults.items.pricejson object가격정보
    result.subResults.items.price.priceFloatObject가격
    result.subResults.items.price.unitPriceFloatObject단가
    result.totalPricejson object총 금액 정보
    result.totalPrice.priceFloatObject총 금액
    result.subtotalFloatObject총 합계 정보
    result.subtotal.taxpriceFloatObject부과세
    result.subtotal.discountpriceFloatObject할인금액
    1. creditCard object
    ClassificationJson Model
    creditCard Field{
    "meta": {},
    "result": {},
    }

    creditCard Object Field Details

    Field NameData TypeDescription
    metajson object메타 정보
    meta.estimatedLanguagestringOCR에서 추정한 언어 (en: 영어, ja: 일본어, ko: 한국어)
    resultjson object인식 결과
    result.numberField objectField 객체 참조
    result.validThruField objectField 객체 참조
    result.nameField object카드 소유자 이름
    Field 객체 참조
    1. bizLicense object
    ClassificationJson Model
    bizLicense Field{
    "meta": {},
    "result": {},
    }

    bizLicense Object Field Details

    Field NameData TypeDescription
    metajson object메타 정보
    meta.estimatedLanguagestringOCR에서 추정한 언어 (en: 영어, ja: 일본어, ko: 한국어)
    resultjson object인식 결과
    result.birthBaseObject[]생년월일
    result.bisAddressBaseObject[]사업자 주소
    result.bisAreaBaseObject[]사업장 소재지
    result.bisItemBaseObject[]사업 항목
    result.registerNumberBaseObject[]사업자등록번호
    result.bisTypeBaseObject[]업종
    result.companyNameBaseObject[]상호
    result.coRepNameBaseObject[]공동 대표자 이름
    result.corpNameBaseObject[]법인(그룹)명
    result.corpRegisterNumBaseObject[]사업자등록번호
    result.coRepSocialNumBaseObject[]공동 대표자의 주민등록번호
    result.documentTypeStringObject[]문서 유형
    result.headAddressBaseObject[]본사 주소
    result.issuanceDateBaseObject[]발행 일자
    result.issuanceReasonBaseObject[]발행 사유
    result.openDateBaseObject[]사업 시작일
    result.repNameBaseObject[]대표자 이름
    result.socialNumberBaseObject[]주민등록번호
    result.taxTypeBaseObject[]과세 유형
    1. idCard object
    ClassificationJson Model
    idcard Field{
    "meta": {},
    "result": {},
    }

    idCard Object Field Details

    Field NameData TypeDescription
    metajson object메타 정보
    meta.estimatedLanguagestringOCR에서 추정한 언어 (en: 영어, ja: 일본어, ko: 한국어)
    resultjson object인식 결과
    result.isConfidentboolean신뢰성 자격 요건을 반영하는 지표
    각 ID 유형에 필요한 세부 정보가 있으면 True로 출력되고, 그렇지 않으면 False로 출력됨.
    result.IDTypestring신분증 유형
    반환 값은 "신분증", "운전면허증", "여권", "알 수 없음" 중 하나임.
    result.roisBoundingPoly[]객체 테두리 위치 정보
    result.icjson object주민등록증 정보
    result.ic.nameStringObject[]이름(한국어)
    result.ic.personalNumStringObject[]주민등록번호
    result.ic.addressStringObject[]주소
    result.ic.issueDateDateObject[]발급 일자
    result.ic.authorityStringObject[]발급 기관
    result.dljson object운전면허증 정보
    result.dl.typeBaseObject[]면허 유형
    result.dl.numStringObject[]면허 번호
    result.dl.nameStringObject[]이름(한국어)
    result.dl.personalNumStringObject[]주민등록번호
    result.dl.addressStringObject[]Address
    result.dl.renewStartDateDateObject[]갱신기간 시작일
    result.dl.renewEndDateDateObject[]갱신기간 종료일
    result.dl.conditionStringObject[]면허 조건
    result.dl.codeStringObject[]면허 코드
    result.dl.organDonationBaseObject[]장기 및 조직 기증 등록
    result.dl.issueDateDateObject[]발급 일자
    result.dl.authorityStringObject[]발급 기관
    result.ppjson object여권 정보
    result.pp.typeStringObject[]여권 유형
    result.pp.issueCountryBaseObject[]발급 국가
    result.pp.numStringObject[]여권 번호
    result.pp.surNameStringObject[]
    result.pp.givenNameStringObject[]이름
    result.pp.nationalityStringObject[]국적
    result.pp.birthDateDateObject[]생년월일
    result.pp.personalNumStringObject[]주민등록번호
    result.pp.sexStringObject[]성별
    result.pp.issueDateDateObject[]발급 일자
    result.pp.expireDateDateObject[]만료 일자
    result.pp.authorityBaseObject[]발행 기관
    result.pp.fullNameKorStringObject[]이름(한국어)
    result.pp.MRZ1StringObject[]Machine Readable Zone (MRZ) 1
    result.pp.MRZ2StringObject[]Machine Readable Zone (MRZ) 2
    result.acjson object외국인 등록증 정보
    result.ac.alienRegNumStringObject[]외국인 등록번호
    result.ac.sexStringObject[]성별
    result.ac.nameStringObject[]이름
    result.ac.nationalityStringObject[]국적
    result.ac.visaTypeStringObject[]비자 유형
    result.ac.issueDateDateObject[]발급 일자
    result.ac.authorityStringObject[]발급 기관
    result.ac.authorityEngStringObject[]발급 기관(영문)
    result.ac.alienRegNumEtcStringObject[]외국인 등록번호 등
    1. nameCard object
    ClassificationJson Model
    nameCard Field{
    "meta": {},
    "result": {},
    }

    nameCard Object Field Details

    Field NameData TypeDescription
    metajson object메타 정보
    meta.estimatedLanguagestringOCR에서 추정한 언어 (en: 영어, ja: 일본어, ko: 한국어)
    resultjson object인식 결과
    result.nameStringObject[]이름 정보
    result.nameFuriganaStringObject[]후리가나 이름 정보(언어가 ja일 때만 응답)
    result.companyStringObject[]회사 정보
    result.departmentStringObject[]부서 정보
    result.addressStringObject[]주소 정보
    result.positionStringObject[]직급 정보
    result.mobileTelObject[]휴대폰 정보
    result.telTelObject[]전화 정보
    result.faxTelObject[]팩스 정보
    result.emailStringObject[]이메일 정보
    result.homepageStringObject[]홈페이지 정보
    1. passport object
    ClassificationJson Model
    passport Field{
    " passportResult": {},
    }

    passport Object Field Details

    Field NameData TypeDescription
    passportResultjson object인식 결과
    passportResult.documentClassCodeMrzString문서 코드. "여권"
    passportResult.issuingStateCodeMrzString발급 국가
    passportResult.firstNameMrzString이름
    passportResult.lastName1MrzString첫번째 성
    passportResult.lastName2MrzString두번째 성
    passportResult.documentNumberMrzString여권번호
    passportResult.checkDigitForDocumentNumberMrzString문서 번호에 대한 확인 숫자
    passportResult.nationalityMrzString국적
    passportResult.dateOfBirthMrzString생년월일
    passportResult.ageMrzInt나이
    passportResult.checkDigitForDateOfBirthMrzString생년월일에 대한 확인 숫자
    passportResult.genderMrzString성별
    passportResult.dateOfExpiryMrzString만료일자
    passportResult.checkDigitForDateOfExpiryMrzString만료일자에 대한 확인 숫자
    passportResult.personalNumberMrzString주민등록번호
    passportResult.checkDigitForPersonalNumberMrzString주민등록번호에 대한 확인 숫자
    passportResult.finalCheckDigitMrzString최종 확인 숫자
    passportResult.mrzTypeMrzStringMRZ 타입
    passportResult.mrzLinesMrzStringMRZ 텍스트
    passportResult.isExpiredMrzbool만료됨
    1. field object
    ClassificationJson Model
    field Field{
    "text": "",
    "confidence": 0.0,
    "boundingPoly": {},
    "subBoundingPolys": []
    }

    field Object Field Details

    Field NameData TypeDescription
    textstring인식 결과 텍스트
    confidencefloat추론 결과 신뢰도. 0~1의 값이 클수록 정확도가 높음.
    boundingPolyBoundingPoly objectboundingPoly 객체 참조
    subBoundingPolysBoundingPoly[]boundingPoly 객체 참조
    1. boundingPoly object
    ClassificationJson Model
    boundingPoly{
    "vertices":[{}]
    }

    boundingPoly Object Field Details

    Field NameData TypeDescription
    verticesvertices objectvertices 객체 참조
    1. vertices object
    ClassificationJson Model
    vertices{
    "x": 0.0,
    "y": 0.0
    }

    vertices Object Field Details

    Field NameData TypeDescription
    xfloatX 좌표
    yfloaty 좌표
    1. baseObject
    ClassificationJson Model
    baseObject{
    "text": "",
    "boundingPolys": []
    }

    baseObject Field Details

    Field NameData TypeDescription
    textstring파싱된 텍스트
    boundingPolysBoundingPoly[]boundingPoly 객체 참조
    1. dateObject
    ClassificationJson Model
    dateObject{
    "text": "",
    "formatted": {},
    "boundingPolys": []
    }

    dateObject Field Details

    Field NameData TypeDescription
    textstring파싱된 텍스트
    formattedjson object파싱된 텍스트에 대한 추가 정보
    formatted.yearstring년. 네 자리 숫자의 연도를 나타냄. 빈 문자열일 수 있다는 점을 제외하면 ISO 8601 표준 형식을 따름.
    formatted.monthstring월. 두 자리 숫자의 월을 나타냄. 빈 문자열일 수 있다는 점을 제외하면 ISO 8601 표준 형식을 따름.
    formatted.daystring날짜. 두 자리 숫자의 날짜를 나타냄. 빈 문자열일 수 있다는 점을 제외하면 ISO 8601 표준 형식을 따름.
    boundingPolysBoundingPoly[]boundingPoly 객체 참조
    1. timeObject
    ClassificationJson Model
    timeObject{
    "text": "",
    "formatted": {},
    "boundingPolys": [],
    "maskingPolys": []
    }

    timeObject Field Details

    Field NameData TypeDescription
    textstring파싱된 텍스트
    formattedjson object파싱된 텍스트에 대한 추가 정보
    formatted.hourstring시. 두 자리 숫자의 시를 나타냄. 빈 문자열일 수 있다는 점을 제외하면 ISO 8601 표준 형식을 따름.
    formatted.minutestring분. 두 자리 숫자의 분을 나타냄. 빈 문자열일 수 있다는 점을 제외하면 ISO 8601 표준 형식을 따름.
    formatted.secondstring초. 두 자리 숫자의 초를 나타냄. 빈 문자열일 수 있다는 점을 제외하면 ISO 8601 표준 형식을 따름.
    boundingPolysBoundingPoly[]boundingPoly 객체 참조
    maskingPolysBoundingPoly[]개인정보 마스킹
    1. TelObject
    ClassificationJson Model
    TelObject{
    "text": "",
    "formatted": {},
    "boundingPolys": []
    }

    TelObject Field Details

    Field NameData TypeDescription
    textstring파싱된 텍스트
    formattedjson object파싱된 텍스트에 대한 추가 정보
    formatted.valuestring전화번호 유형을 나타내는 서식 있는 텍스트. 주로 숫자 문자열 형태이지만 전화 식별자(+)를 포함할 수 있음. 인식 세분화에 실패하면 빈 문자열일 수 있음.
    boundingPolysBoundingPoly[]boundingPoly 객체 참조
    1. FloatObject
    ClassificationJson Model
    FloatObject{
    "text": "",
    "formatted": {},
    "boundingPolys": []
    }

    FloatObject Field Details

    Field NameData TypeDescription
    textstring파싱된 텍스트
    formattedjson object파싱된 텍스트에 대한 추가 정보
    formatted.valuestring실수 유형을 나타내는 서식 있는 텍스트. 실수 문자열 유형. 품목의 개수와 가격을 설명하는 데 유용함. 인식 세분화에 실패하면 빈 문자열일 수 있음.
    boundingPolysBoundingPoly[]boundingPoly 객체 참조
    1. StringObject
    ClassificationJson Model
    StringObject{
    "text": "",
    "formatted": {},
    "boundingPolys": [],
    "maskingPolys": []
    }

    StringObject Field Details

    Field NameData TypeDescription
    textstring파싱된 텍스트
    formattedjson object파싱된 텍스트에 대한 추가 정보
    formatted.valuestring정제된 텍스트. 정제 과정은 각 신분증의 분류에 따라 다름. 빈 문자열일 수 있음.
    boundingPolysBoundingPoly[]boundingPoly 객체 참조
    maskingPolysBoundingPoly[]개인정보
    1. PoiObject
    ClassificationJson Model
    PoiObject{
    "gid": "",
    "title": "",
    "phone": "",
    "address": "",
    "roadAddress": "",
    "biznum": "",
    "confidence": ""
    }

    PoiObject Field Details

    Field NameData TypeDescription
    gidstring고유 ID
    titlestring상호명
    phonestring전화번호
    addressstring주소
    roadAddressstring도로명주소
    biznumstring사업자번호(아직 정식으로 지원되지 않아 null일 수 있으나 추후 추가될 수 있음)
    confidencestring신뢰도(높을 수록 정확도가 높음)
    1. MedicalReceipt object
    ClassificationJson Model
    medicalReceipt{
    "checksum": {},
    "result": []
    }

    medicalReceipt Object Field Details

    Field NameData TypeDescription
    checksumjson objectChecksum results
    checksum.sumPaidByPatientChecksum본인부담금 합계
    checksum.sumPaidByInsurerChecksum공단부담금 합계
    checksum.sumPaidByPatientFullChecksum전액본인부담금 합계
    checksum.sumTreatmentCostEtcChecksum선택진료료 합계
    checksum.sumTreatmentCostEtcChecksum선택진료료이외 합계
    checksum.totalAmountChecksum총액확인
    checksum.totalPaidChecksum환자부담액
    resultMedicalReceiptResult[]List of value cell results

    19.MedicalReceiptResult object

    ClassificationJson Model
    result{
    "id": "",
    "keyTexts": "",
    "valueText": "",
    "confidence": "",
    "keyCells": [],
    "valueCell": {}
    }

    MedicalReceiptResult Object Field Details

    Field NameData TypeDescription
    idint셀 ID
    keyTextsstring“|“ 로 분류된 문자 텍스트
    valueTextstring응답 셀의 값
    confidencefloat응답 셀의 신뢰도
    keyCellsKeyCell[]키 값 리스트
    valueCellValueCell응답셀 객체

    20.Checksum object

    ClassificationJson Model
    checksum Field{
    "found": "",
    "foundValueIds": [],
    "foundValueSum": "",
    "foundTotalIds": [],
    "foundTotalSum": "",
    "foundTotalSum": ""
    }

    Checksum Object Field Details

    Field NameData TypeDescription
    foundjson object체크섬 필드의 발견 여부를 나타내는 플래그
    foundValueIdsint[]발견된 값 셀의 ID 목록
    foundValueSumfloat발견된 값의 합
    foundTotalIdsint[]발견된 전체 셀의 ID 목록
    foundTotalSumfloat발견된 전체 값의 합
    differencefloat값과 전체 셀의 차이

    21.KeyCell object

    ClassificationJson Model
    KeyCell Field{
    "boundingPoly": {},
    "depth": "",
    "formatted": "",
    "group": "",
    "value": ""
    }

    KeyCell Object Field Details

    Field NameData TypeDescription
    boundingPolyBoundingPoly셀 테두리 상자 좌표
    depthstring발견된 키 셀의 깊이
    formattedstring키 셀의 그라운딩 텍스트
    groupstring열/행별 키를 구분하기 위한 식별자
    valuestring키 셀의 그라운딩되지 않은 텍스트

    22.ValueCell object

    ClassificationJson Model
    ValueCell Field{
    "boundingPoly": {},
    "confidence": "",
    "value": ""
    }

    ValueCell Object Field Details

    Field NameData TypeDescription
    boundingPolyBoundingPoly셀 테두리 상자 좌표
    confidencefloat값 셀 신뢰도
    valuestring값 셀의 텍스트

    23.MrzString object

    ClassificationJson Model
    MrzString Field{
    "rawText": "",
    "refinedText ": "",
    "postprocessed": [0]
    }

    MrzString Object Field Details

    Field NameData TypeDescription
    rawTextstring원본 텍스트
    refinedTextstring정제된 텍스트
    postprocessedint32정제 방식

    24.Mrzbool object

    ClassificationJson Model
    Mrzbool Field{
    "rawText": "",
    "refinedText ": "",
    "postprocessed": [0]
    }

    Mrzbool Object Field Details

    Field NameData TypeDescription
    rawTextstring원본 텍스트
    refinedTextbool정제된 텍스트
    postprocessedint32정제 방식

    25.MrzInt object

    ClassificationJson Model
    MrzInt Field{
    "rawText": "",
    "refinedText ": 0,
    "postprocessed": [0]
    }

    MrzInt Object Field Details

    Field NameData TypeDescription
    rawTextstring원본 텍스트
    refinedTextint정제된 텍스트
    postprocessedint32정제 방식

    예시

    DOCUMENT OCR 요청 예시

    {
      "version": "V2",
      "requestId": "string",
      "timestamp": 0,
      "images": [
        {
          "format": "jpg",
          "name": "test 1",
          "data": "data"
        }
      ]
    }
    

    Credit Card 응답 예시

    {
        "version": "V2",
        "requestId": "string",
        "timestamp": 1613984515468,
        "images": [
            {
                "creditCard": {
                    "result": {
                        "number": {
                            "text": "5307123456749012",
                            "confidence": 0.96435016,
                            "boundingPoly": {
                                "vertices": [
                                    {
                                        "x": 64.0,
                                        "y": 218.0
                                    },
                                    {
                                        "x": 582.0,
                                        "y": 222.0
                                    },
                                    {
                                        "x": 582.0,
                                        "y": 265.0
                                    },
                                    {
                                        "x": 64.0,
                                        "y": 261.0
                                    }
                                ]
                            },
                            "subBoundingPolys": [
                                {
                                    "vertices": [
                                        {
                                            "x": 65.0,
                                            "y": 222.0
                                        },
                                        {
                                            "x": 175.0,
                                            "y": 225.0
                                        },
                                        {
                                            "x": 174.0,
                                            "y": 260.0
                                        },
                                        {
                                            "x": 64.0,
                                            "y": 257.0
                                        }
                                    ]
                                },
                                {
                                    "vertices": [
                                        {
                                            "x": 202.0,
                                            "y": 225.0
                                        },
                                        {
                                            "x": 312.0,
                                            "y": 225.0
                                        },
                                        {
                                            "x": 312.0,
                                            "y": 262.0
                                        },
                                        {
                                            "x": 202.0,
                                            "y": 262.0
                                        }
                                    ]
                                },
                                {
                                    "vertices": [
                                        {
                                            "x": 340.0,
                                            "y": 225.0
                                        },
                                        {
                                            "x": 445.0,
                                            "y": 225.0
                                        },
                                        {
                                            "x": 445.0,
                                            "y": 260.0
                                        },
                                        {
                                            "x": 340.0,
                                            "y": 260.0
                                        }
                                    ]
                                },
                                {
                                    "vertices": [
                                        {
                                            "x": 470.0,
                                            "y": 222.0
                                        },
                                        {
                                            "x": 582.0,
                                            "y": 222.0
                                        },
                                        {
                                            "x": 582.0,
                                            "y": 260.0
                                        },
                                        {
                                            "x": 470.0,
                                            "y": 260.0
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                },
                "uid": "5f824ebe5b9744bb81bd3e1ef7f42e4e",
                "name": "testV2Demo",
                "inferResult": "SUCCESS",
                "message": "SUCCESS",
                "validationResult": {
                    "result": "NO_REQUESTED"
                }
            }
        ]
    }
    

    Receipt 응답 예시

    {
    	"version": "V2",
    	"requestId": "string",
    	"timestamp": 1613984672273,
    	"images": [{
    		"receipt": {
    			"meta": {
    				"estimatedLanguage": "ko"
    			},
    			"result": {
    				"storeInfo": {
    					"name": {
    						"text": "emart everyday",
    						"formatted": {
    							"value": "emart everyday"
    						},
    						"boundingPolys": [{
    							"vertices": [{
    									"x": 263.0,
    									"y": 96.0
    								},
    								{
    									"x": 390.0,
    									"y": 100.0
    								},
    								{
    									"x": 389.0,
    									"y": 141.0
    								},
    								{
    									"x": 262.0,
    									"y": 137.0
    								}
    							]
    						}]
    					},
    					"subName": {
    						"text": "분당정지2점",
    						"formatted": {
    							"value": "분당정지2점"
    						},
    						"boundingPolys": [{
    							"vertices": [{
    									"x": 530.0,
    									"y": 102.0
    								},
    								{
    									"x": 611.0,
    									"y": 102.0
    								},
    								{
    									"x": 611.0,
    									"y": 122.0
    								},
    								{
    									"x": 530.0,
    									"y": 122.0
    								}
    							]
    						}]
    					},
    					"bizNum": {
    						"text": "212-81-25544",
    						"formatted": {
    							"value": "212-81-25544"
    						},
    						"boundingPolys": [{
    							"vertices": [{
    									"x": 402.0,
    									"y": 125.0
    								},
    								{
    									"x": 515.0,
    									"y": 124.0
    								},
    								{
    									"x": 515.0,
    									"y": 141.0
    								},
    								{
    									"x": 402.0,
    									"y": 142.0
    								}
    							]
    						}]
    					},
    					"addresses": [{
    						"text": "경기 성남시분당구 정자일로 120",
    						"formatted": {
    							"value": "경기 성남시분당구 정자일로 120"
    						},
    						"boundingPolys": [{
    							"vertices": [{
    									"x": 401.0,
    									"y": 144.0
    								},
    								{
    									"x": 432.0,
    									"y": 144.0
    								},
    								{
    									"x": 432.0,
    									"y": 165.0
    								},
    								{
    									"x": 401.0,
    									"y": 165.0
    								}
    							]
    						}]
    					}],
    					"tel": [{
    						"text": "(031)786-1171",
    						"formatted": {
    							"value": "0317861171"
    						},
    						"boundingPolys": [{
    							"vertices": [{
    									"x": 569.0,
    									"y": 122.0
    								},
    								{
    									"x": 716.0,
    									"y": 118.0
    								},
    								{
    									"x": 716.0,
    									"y": 140.0
    								},
    								{
    									"x": 570.0,
    									"y": 144.0
    								}
    							]
    						}]
    					}]
    				},
    				"paymentInfo": {
    					"date": {
    						"text": "2020-04-16",
    						"formatted": {
    							"year": "2020",
    							"month": "04",
    							"day": "16"
    						},
    						"boundingPolys": [{
    							"vertices": [{
    									"x": 261.0,
    									"y": 256.0
    								},
    								{
    									"x": 432.0,
    									"y": 260.0
    								},
    								{
    									"x": 431.0,
    									"y": 284.0
    								},
    								{
    									"x": 260.0,
    									"y": 280.0
    								}
    							]
    						}]
    					},
    					"time": {
    						"text": "20: 11",
    						"formatted": {
    							"hour": "20",
    							"minute": "11",
    							"second": "00"
    						},
    						"boundingPolys": [{
    							"vertices": [{
    									"x": 437.0,
    									"y": 261.0
    								},
    								{
    									"x": 468.0,
    									"y": 261.0
    								},
    								{
    									"x": 468.0,
    									"y": 279.0
    								},
    								{
    									"x": 437.0,
    									"y": 279.0
    								}
    							]
    						}]
    					},
    					"cardInfo": {
    						"company": {
    							"text": "신 한",
    							"formatted": {
    								"value": "신한"
    							},
    							"boundingPolys": [{
    								"vertices": [{
    										"x": 309.0,
    										"y": 585.0
    									},
    									{
    										"x": 334.0,
    										"y": 585.0
    									},
    									{
    										"x": 334.0,
    										"y": 610.0
    									},
    									{
    										"x": 309.0,
    										"y": 610.0
    									}
    								]
    							}]
    						},
    						"number": {
    							"text": "4221**8666",
    							"formatted": {
    								"value": "4221**8666"
    							},
    							"boundingPolys": [{
    								"vertices": [{
    										"x": 522.0,
    										"y": 586.0
    									},
    									{
    										"x": 716.0,
    										"y": 592.0
    									},
    									{
    										"x": 716.0,
    										"y": 612.0
    									},
    									{
    										"x": 522.0,
    										"y": 606.0
    									}
    								]
    							}]
    						}
    					},
    					"confirmNum": {
    						"text": "28672931",
    						"boundingPolys": [{
    							"vertices": [{
    									"x": 522.0,
    									"y": 586.0
    								},
    								{
    									"x": 716.0,
    									"y": 592.0
    								},
    								{
    									"x": 716.0,
    									"y": 612.0
    								},
    								{
    									"x": 522.0,
    									"y": 606.0
    								}
    							]
    						}]
    					}
    				},
    				"subResults": [{
    					"items": [{
    						"name": {
    							"text": "씨그램 레몬350ml",
    							"formatted": {
    								"value": "씨그램 레몬350ml"
    							},
    							"boundingPolys": [{
    								"vertices": [{
    										"x": 310.0,
    										"y": 345.0
    									},
    									{
    										"x": 372.0,
    										"y": 345.0
    									},
    									{
    										"x": 372.0,
    										"y": 369.0
    									},
    									{
    										"x": 310.0,
    										"y": 369.0
    									}
    								]
    							}]
    						},
    						"count": {
    							"text": "2",
    							"formatted": {
    								"value": "2"
    							},
    							"boundingPolys": [{
    								"vertices": [{
    										"x": 601.0,
    										"y": 348.0
    									},
    									{
    										"x": 615.0,
    										"y": 348.0
    									},
    									{
    										"x": 615.0,
    										"y": 365.0
    									},
    									{
    										"x": 601.0,
    										"y": 365.0
    									}
    								]
    							}]
    						},
    						"price": {
    							"price": {
    								"text": "1,600",
    								"formatted": {
    									"value": "1600"
    								},
    								"boundingPolys": [{
    									"vertices": [{
    											"x": 662.0,
    											"y": 347.0
    										},
    										{
    											"x": 716.0,
    											"y": 347.0
    										},
    										{
    											"x": 716.0,
    											"y": 367.0
    										},
    										{
    											"x": 662.0,
    											"y": 367.0
    										}
    									]
    								}]
    							},
    							"unitPrice": {
    								"text": "800",
    								"formatted": {
    									"value": "800"
    								},
    								"boundingPolys": [{
    									"vertices": [{
    											"x": 541.0,
    											"y": 347.0
    										},
    										{
    											"x": 577.0,
    											"y": 347.0
    										},
    										{
    											"x": 577.0,
    											"y": 368.0
    										},
    										{
    											"x": 541.0,
    											"y": 368.0
    										}
    									]
    								}]
    							}
    						}
    					}]
    				}],
    				"totalPrice": {
    					"price": {
    						"text": "1,600",
    						"formatted": {
    							"value": "1600"
    						},
    						"boundingPolys": [{
    							"vertices": [{
    									"x": 651.0,
    									"y": 546.0
    								},
    								{
    									"x": 717.0,
    									"y": 548.0
    								},
    								{
    									"x": 717.0,
    									"y": 569.0
    								},
    								{
    									"x": 651.0,
    									"y": 567.0
    								}
    							]
    						}]
    					}
    				}
    			}
    		},
    		"uid": "5b9de1f9765448eca574efc1a4231bbe",
    		"name": "testV2Demo",
    		"inferResult": "SUCCESS",
    		"message": "SUCCESS",
    		"validationResult": {
    			"result": "NO_REQUESTED"
    		}
    	}]
    }
    

    biz license 응답 예시

    {
    	"version": "V2",
    	"requestId": "string",
    	"timestamp": 1613984821070,
    	"images": [{
    		"bizLicense": {
    			"meta": {
    				"estimatedLanguage": "ko"
    			},
    			"result": {
    				"birth": [{
    					"text": "1951 년 12 03 일",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 396.0,
    								"y": 254.0
    							},
    							{
    								"x": 421.0,
    								"y": 254.0
    							},
    							{
    								"x": 421.0,
    								"y": 265.0
    							},
    							{
    								"x": 396.0,
    								"y": 265.0
    							}
    						]
    					}]
    				}],
    				"bisAddress": [{
    					"text": "경상남도 사천시 사천용 보공로 54",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 193.0,
    								"y": 288.0
    							},
    							{
    								"x": 235.0,
    								"y": 288.0
    							},
    							{
    								"x": 235.0,
    								"y": 300.0
    							},
    							{
    								"x": 193.0,
    								"y": 300.0
    							}
    						]
    					}]
    				}],
    				"bisArea": [],
    				"bisItem": [{
    					"text": "비주거용 건물 임대업(점포, 자기자)",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 368.0,
    								"y": 325.0
    							},
    							{
    								"x": 399.0,
    								"y": 325.0
    							},
    							{
    								"x": 399.0,
    								"y": 334.0
    							},
    							{
    								"x": 368.0,
    								"y": 334.0
    							}
    						]
    					}]
    				}],
    				"registerNumber": [{
    					"text": "611-01-99810",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 290.0,
    								"y": 210.0
    							},
    							{
    								"x": 386.0,
    								"y": 211.0
    							},
    							{
    								"x": 386.0,
    								"y": 227.0
    							},
    							{
    								"x": 290.0,
    								"y": 225.0
    							}
    						]
    					}]
    				}],
    				"bisType": [{
    					"text": "부동산업 및 임대업",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 221.0,
    								"y": 322.0
    							},
    							{
    								"x": 262.0,
    								"y": 322.0
    							},
    							{
    								"x": 262.0,
    								"y": 333.0
    							},
    							{
    								"x": 221.0,
    								"y": 333.0
    							}
    						]
    					}]
    				}],
    				"companyName": [{
    					"text": "동성자동차종합정비",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 194.0,
    								"y": 232.0
    							},
    							{
    								"x": 293.0,
    								"y": 233.0
    							},
    							{
    								"x": 293.0,
    								"y": 247.0
    							},
    							{
    								"x": 194.0,
    								"y": 245.0
    							}
    						]
    					}]
    				}],
    				"coRepName": [],
    				"corpName": [],
    				"corpRegisterNum": [],
    				"coRepSocialNum": [],
    				"documentType": [{
    					"text": "사업자등록증",
    					"formatted": {
    						"value": "사업자등록증"
    					},
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 199.0,
    								"y": 157.0
    							},
    							{
    								"x": 396.0,
    								"y": 160.0
    							},
    							{
    								"x": 396.0,
    								"y": 189.0
    							},
    							{
    								"x": 198.0,
    								"y": 186.0
    							}
    						]
    					}]
    				}],
    				"headAddress": [],
    				"issuanceDate": [{
    					"text": "2017 년 06 월 29일",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 225.0,
    								"y": 623.0
    							},
    							{
    								"x": 259.0,
    								"y": 623.0
    							},
    							{
    								"x": 259.0,
    								"y": 637.0
    							},
    							{
    								"x": 225.0,
    								"y": 637.0
    							}
    						]
    					}]
    				}],
    				"issuanceReason": [{
    					"text": "2017 년 06 월 29일",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 225.0,
    								"y": 623.0
    							},
    							{
    								"x": 259.0,
    								"y": 623.0
    							},
    							{
    								"x": 259.0,
    								"y": 637.0
    							},
    							{
    								"x": 225.0,
    								"y": 637.0
    							}
    						]
    					}]
    				}],
    				"openDate": [{
    					"text": "2014 년 06 월 09 일",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 193.0,
    								"y": 271.0
    							},
    							{
    								"x": 218.0,
    								"y": 271.0
    							},
    							{
    								"x": 218.0,
    								"y": 280.0
    							},
    							{
    								"x": 193.0,
    								"y": 280.0
    							}
    						]
    					}]
    				}],
    				"repName": [{
    					"text": "김영두",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 193.0,
    								"y": 251.0
    							},
    							{
    								"x": 228.0,
    								"y": 251.0
    							},
    							{
    								"x": 228.0,
    								"y": 264.0
    							},
    							{
    								"x": 193.0,
    								"y": 264.0
    							}
    						]
    					}]
    				}],
    				"socialNumber": [],
    				"taxType": [{
    					"text": "일반과세자",
    					"boundingPolys": [{
    						"vertices": [{
    								"x": 238.0,
    								"y": 185.0
    							},
    							{
    								"x": 357.0,
    								"y": 187.0
    							},
    							{
    								"x": 357.0,
    								"y": 209.0
    							},
    							{
    								"x": 238.0,
    								"y": 207.0
    							}
    						]
    					}]
    				}]
    			}
    		},
    		"uid": "ecf05843a1f444b6943e9d202475c3eb",
    		"name": "testV2Demo",
    		"inferResult": "SUCCESS",
    		"message": "SUCCESS",
    		"validationResult": {
    			"result": "NO_REQUESTED"
    		}
    	}]
    }
    

    name card 응답 예시

    {
        "version": "V2",
        "requestId": "string",
        "timestamp": 1613984872349,
        "images": [
            {
                "nameCard": {
                    "meta": {
                        "estimatedLanguage": "ko"
                    },
                    "result": {
                        "name": [
                            {
                                "text": "홍길동",
                                "boundingPolys": [
                                    {
                                        "vertices": [
                                            {
                                                "x": 286.0,
                                                "y": 194.0
                                            },
                                            {
                                                "x": 348.0,
                                                "y": 194.0
                                            },
                                            {
                                                "x": 348.0,
                                                "y": 266.0
                                            },
                                            {
                                                "x": 286.0,
                                                "y": 266.0
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "nameFurigana": [],
                        "company": [
                            {
                                "text": "우리은행",
                                "boundingPolys": [
                                    {
                                        "vertices": [
                                            {
                                                "x": 317.0,
                                                "y": 274.0
                                            },
                                            {
                                                "x": 356.0,
                                                "y": 274.0
                                            },
                                            {
                                                "x": 356.0,
                                                "y": 316.0
                                            },
                                            {
                                                "x": 317.0,
                                                "y": 316.0
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "department": [],
                        "address": [
                            {
                                "text": "(홍길동)",
                                "boundingPolys": [
                                    {
                                        "vertices": [
                                            {
                                                "x": 338.0,
                                                "y": 189.0
                                            },
                                            {
                                                "x": 414.0,
                                                "y": 189.0
                                            },
                                            {
                                                "x": 414.0,
                                                "y": 288.0
                                            },
                                            {
                                                "x": 338.0,
                                                "y": 288.0
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "position": [
                            {
                                "text": "소장",
                                "boundingPolys": [
                                    {
                                        "vertices": [
                                            {
                                                "x": 286.0,
                                                "y": 194.0
                                            },
                                            {
                                                "x": 348.0,
                                                "y": 194.0
                                            },
                                            {
                                                "x": 348.0,
                                                "y": 266.0
                                            },
                                            {
                                                "x": 286.0,
                                                "y": 266.0
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "mobile": [
                            {
                                "text": "010-1234-5678",
                                "boundingPolys": [
                                    {
                                        "vertices": [
                                            {
                                                "x": 297.0,
                                                "y": 183.0
                                            },
                                            {
                                                "x": 396.0,
                                                "y": 183.0
                                            },
                                            {
                                                "x": 396.0,
                                                "y": 305.0
                                            },
                                            {
                                                "x": 297.0,
                                                "y": 305.0
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "tel": [
                            {
                                "text": "123-4567-8901",
                                "boundingPolys": [
                                    {
                                        "vertices": [
                                            {
                                                "x": 338.0,
                                                "y": 189.0
                                            },
                                            {
                                                "x": 414.0,
                                                "y": 189.0
                                            },
                                            {
                                                "x": 414.0,
                                                "y": 288.0
                                            },
                                            {
                                                "x": 338.0,
                                                "y": 288.0
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "fax": [],
                        "email": [],
                        "homepage": []
                    }
                },
                "uid": "3277149ad2324de0b412669f7eac474a",
                "name": "testV2Demo",
                "inferResult": "SUCCESS",
                "message": "SUCCESS",
                "validationResult": {
                    "result": "NO_REQUESTED"
                }
            }
        ]
    }
    

    id card 응답 예시

    {
        "version": "V2",
        "requestId": "string",
        "timestamp": 1613984543939,
        "images": [
            {
                "idCard": {
                    "meta": {
                        "estimatedLanguage": "ko"
                    },
                    "result": {
                        "isConfident": true,
                        "ic": {
                            "name": [
                                {
                                    "text": "소닉",
                                    "formatted": {
                                        "value": "소닉"
                                    },
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 93.0,
                                                    "y": 135.0
                                                },
                                                {
                                                    "x": 257.0,
                                                    "y": 135.0
                                                },
                                                {
                                                    "x": 257.0,
                                                    "y": 161.0
                                                },
                                                {
                                                    "x": 93.0,
                                                    "y": 161.0
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "personalNum": [
                                {
                                    "text": "910623-1062372",
                                    "formatted": {
                                        "value": "910623-1062372"
                                    },
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 83.0,
                                                    "y": 166.0
                                                },
                                                {
                                                    "x": 260.0,
                                                    "y": 166.0
                                                },
                                                {
                                                    "x": 260.0,
                                                    "y": 186.0
                                                },
                                                {
                                                    "x": 83.0,
                                                    "y": 186.0
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "address": [
                                {
                                    "text": "서울특별시 종로구 종로1가 24 르메이에르 종로타운",
                                    "formatted": {
                                        "value": "서울특별시 종로구 종로1가 24 르메이에르 종로타운"
                                    },
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 43.0,
                                                    "y": 232.0
                                                },
                                                {
                                                    "x": 148.0,
                                                    "y": 232.0
                                                },
                                                {
                                                    "x": 148.0,
                                                    "y": 255.0
                                                },
                                                {
                                                    "x": 43.0,
                                                    "y": 255.0
                                                }
                                            ]
                                        },
                                        {
                                            "vertices": [
                                                {
                                                    "x": 47.0,
                                                    "y": 212.0
                                                },
                                                {
                                                    "x": 150.0,
                                                    "y": 212.0
                                                },
                                                {
                                                    "x": 150.0,
                                                    "y": 234.0
                                                },
                                                {
                                                    "x": 47.0,
                                                    "y": 234.0
                                                }
                                            ]
                                        },
                                        {
                                            "vertices": [
                                                {
                                                    "x": 154.0,
                                                    "y": 232.0
                                                },
                                                {
                                                    "x": 240.0,
                                                    "y": 232.0
                                                },
                                                {
                                                    "x": 240.0,
                                                    "y": 255.0
                                                },
                                                {
                                                    "x": 154.0,
                                                    "y": 255.0
                                                }
                                            ]
                                        },
                                        {
                                            "vertices": [
                                                {
                                                    "x": 156.0,
                                                    "y": 212.0
                                                },
                                                {
                                                    "x": 219.0,
                                                    "y": 212.0
                                                },
                                                {
                                                    "x": 219.0,
                                                    "y": 234.0
                                                },
                                                {
                                                    "x": 156.0,
                                                    "y": 234.0
                                                }
                                            ]
                                        },
                                        {
                                            "vertices": [
                                                {
                                                    "x": 224.0,
                                                    "y": 212.0
                                                },
                                                {
                                                    "x": 302.0,
                                                    "y": 212.0
                                                },
                                                {
                                                    "x": 302.0,
                                                    "y": 235.0
                                                },
                                                {
                                                    "x": 224.0,
                                                    "y": 235.0
                                                }
                                            ]
                                        },
                                        {
                                            "vertices": [
                                                {
                                                    "x": 305.0,
                                                    "y": 213.0
                                                },
                                                {
                                                    "x": 333.0,
                                                    "y": 213.0
                                                },
                                                {
                                                    "x": 333.0,
                                                    "y": 234.0
                                                },
                                                {
                                                    "x": 305.0,
                                                    "y": 234.0
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "issueDate": [
                                {
                                    "text": "2011.3. 6.",
                                    "formatted": {
                                        "year": "2011",
                                        "month": "03",
                                        "day": "06"
                                    },
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 261.0,
                                                    "y": 314.0
                                                },
                                                {
                                                    "x": 351.0,
                                                    "y": 314.0
                                                },
                                                {
                                                    "x": 351.0,
                                                    "y": 336.0
                                                },
                                                {
                                                    "x": 261.0,
                                                    "y": 336.0
                                                }
                                            ]
                                        },
                                        {
                                            "vertices": [
                                                {
                                                    "x": 354.0,
                                                    "y": 314.0
                                                },
                                                {
                                                    "x": 376.0,
                                                    "y": 314.0
                                                },
                                                {
                                                    "x": 376.0,
                                                    "y": 334.0
                                                },
                                                {
                                                    "x": 354.0,
                                                    "y": 334.0
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "authority": [
                                {
                                    "text": "소닉대통령추진회 소덕회장",
                                    "formatted": {
                                        "value": "소닉대통령추진회 소덕회장"
                                    },
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 172.0,
                                                    "y": 338.0
                                                },
                                                {
                                                    "x": 346.0,
                                                    "y": 338.0
                                                },
                                                {
                                                    "x": 346.0,
                                                    "y": 366.0
                                                },
                                                {
                                                    "x": 172.0,
                                                    "y": 366.0
                                                }
                                            ]
                                        },
                                        {
                                            "vertices": [
                                                {
                                                    "x": 347.0,
                                                    "y": 338.0
                                                },
                                                {
                                                    "x": 435.0,
                                                    "y": 336.0
                                                },
                                                {
                                                    "x": 435.0,
                                                    "y": 363.0
                                                },
                                                {
                                                    "x": 348.0,
                                                    "y": 365.0
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        },
                        "idtype": "ID Card"
                    }
                },
                "uid": "0012374f247f4e70966d35eaa3c41d2a",
                "name": "testV2Demo",
                "inferResult": "SUCCESS",
                "message": "SUCCESS",
                "validationResult": {
                    "result": "NO_REQUESTED"
                }
            }
        ]
    }
    

    medical receipt 응답 예시

    {
      "version": "V2",
      "requestId": "string",
      "timestamp": 1621394368343,
      "images": [
        {
          "medicalReceipt": {
            "result": [
              {
                "id": 60,
                "keyTexts": "선택항목|비급여|계",
                "valueText": "53435",
                "confidence": 0.9542916,
                "keyCells": [
                  {
                    "boundingPoly": {
                      "vertices": [
                        {
                          "x": 303,
                          "y": 16
                        },
                        {
                          "x": 596,
                          "y": 16
                        },
                        {
                          "x": 596,
                          "y": 33
                        },
                        {
                          "x": 303,
                          "y": 33
                        }
                      ]
                    },
                    "depth": 1,
                    "formatted": "선택항목",
                    "group": "column",
                    "value": "선택항목"
                  },
                  {
                    "boundingPoly": {
                      "vertices": [
                        {
                          "x": 513,
                          "y": 34
                        },
                        {
                          "x": 598,
                          "y": 34
                        },
                        {
                          "x": 598,
                          "y": 50
                        },
                        {
                          "x": 513,
                          "y": 50
                        }
                      ]
                    },
                    "depth": 2,
                    "formatted": "비급여",
                    "group": "column",
                    "value": "비급여"
                  }
                ],
                "valueCell": {
                  "boundingPoly": {
                    "vertices": [
                      {
                        "x": 513,
                        "y": 195
                      },
                      {
                        "x": 597,
                        "y": 195
                      },
                      {
                        "x": 597,
                        "y": 212
                      },
                      {
                        "x": 513,
                        "y": 212
                      }
                    ]
                  },
                  "confidence": 0.9542916,
                  "value": "53435"
                }
              }
            ],
            "checksum": {
              "sumPaidByPatient": {
                "found": false,
                "foundValueIds": [],
                "foundValueSum": 0,
                "foundTotalIds": [],
                "foundTotalSum": 0,
                "difference": 0
              },
              "sumPaidByInsurer": {
                "found": false,
                "foundValueIds": [],
                "foundValueSum": 0,
                "foundTotalIds": [],
                "foundTotalSum": 0,
                "difference": 0
              },
              "sumPaidByPatientFull": {
                "found": false,
                "foundValueIds": [],
                "foundValueSum": 0,
                "foundTotalIds": [],
                "foundTotalSum": 0,
                "difference": 0
              },
              "sumTreatmentCost": {
                "found": false,
                "foundValueIds": [],
                "foundValueSum": 0,
                "foundTotalIds": [],
                "foundTotalSum": 0,
                "difference": 0
              },
              "sumTreatmentCostEtc": {
                "found": false,
                "foundValueIds": [],
                "foundValueSum": 0,
                "foundTotalIds": [],
                "foundTotalSum": 0,
                "difference": 0
              },
              "totalAmount": {
                "found": true,
                "foundValueIds": [],
                "foundValueSum": 0,
                "foundTotalIds": [
                  40
                ],
                "foundTotalSum": 1541717,
                "difference": 1541717
              },
              "totalPaid": {
                "found": true,
                "foundValueIds": [],
                "foundValueSum": 0,
                "foundTotalIds": [
                  84
                ],
                "foundTotalSum": 102130,
                "difference": 102130
              }
            }
          },
          "uid": "ef80a5d290284373acad3ba23cb4edfc",
          "name": "test 1",
          "inferResult": "SUCCESS",
          "message": "SUCCESS",
          "validationResult": {
            "result": "NO_REQUESTED"
          }
        }
      ]
    }
    

    passport 응답 예시

    {
        "version": "V2",
        "requestId": "string",
        "timestamp": 1684203696126,
        "images": [
            {
                "passport": {
                    "passportResult": {
                        "documentClassCode": {
                            "rawText": "P<",
                            "refinedText": "Passport",
                            "postprocessed": [
                                1
                            ]
                        },
                        "issuingStateCode": {
                            "rawText": "KOR",
                            "refinedText": "Korea (the Republic of)",
                            "postprocessed": []
                        },
                        "firstName": {
                            "rawText": "HONG",
                            "refinedText": "HONG",
                            "postprocessed": []
                        },
                        "lastName1": {
                            "rawText": "GILSOON",
                            "refinedText": "GILSOON",
                            "postprocessed": []
                        },
                        "lastName2": {
                            "rawText": "-",
                            "refinedText": "-",
                            "postprocessed": []
                        },
                        "documentNumber": {
                            "rawText": "M123A4567",
                            "refinedText": "M123A4567",
                            "postprocessed": []
                        },
                        "checkDigitForDocumentNumber": {
                            "rawText": "0",
                            "refinedText": "0",
                            "postprocessed": []
                        },
                        "nationality": {
                            "rawText": "KOR",
                            "refinedText": "Korea (the Republic of)",
                            "postprocessed": []
                        },
                        "dateOfBirth": {
                            "rawText": "870201",
                            "refinedText": "1987/02/01",
                            "postprocessed": []
                        },
                        "age": {
                            "rawText": "",
                            "refinedText": 36,
                            "postprocessed": []
                        },
                        "checkDigitForDateOfBirth": {
                            "rawText": "0",
                            "refinedText": "0",
                            "postprocessed": []
                        },
                        "gender": {
                            "rawText": "F",
                            "refinedText": "Female",
                            "postprocessed": []
                        },
                        "dateOfExpiry": {
                            "rawText": "300815",
                            "refinedText": "2030/08/15",
                            "postprocessed": []
                        },
                        "checkDigitForDateOfExpiry": {
                            "rawText": "0",
                            "refinedText": "0",
                            "postprocessed": []
                        },
                        "personalNumber": {
                            "rawText": "V2000000000000",
                            "refinedText": "V2000000000000",
                            "postprocessed": []
                        },
                        "checkDigitForPersonalNumber": {
                            "rawText": "0",
                            "refinedText": "0",
                            "postprocessed": []
                        },
                        "finalCheckDigit": {
                            "rawText": "0",
                            "refinedText": "0",
                            "postprocessed": []
                        },
                        "mrzType": {
                            "rawText": "",
                            "refinedText": "ID-3",
                            "postprocessed": []
                        },
                        "mrzLines": {
                            "rawText": "PMKORHONG<<GILSOON<<<<<<<<<<<<<<<<<<<<<<<<<<<<\nM123A45670KOR8702010F3008150V20000000000000000",
                            "refinedText": "PMKORHONG<<GILSOON<<<<<<<<<<<<<<<<<<<<<<<<<<<<\nM123A45670KOR8702010F3008150V20000000000000000",
                            "postprocessed": [
                                1
                            ]
                        },
                        "isExpired": {
                            "rawText": "",
                            "refinedText": false,
                            "postprocessed": []
                        }
                    }
                },
                "uid": "8f8a04985a6e429e97c3ca4184b3c0e4",
                "name": "test 1",
                "inferResult": "SUCCESS",
                "message": "SUCCESS",
                "validationResult": {
                    "result": "NO_REQUESTED"
                }
            }
        ]
    }
    

    API 예제

    다음은 각 언어별 CLOVA OCR API 구현 예제입니다

    • Request with multipart/form-data
    import java.io.BufferedReader;
    import java.io.DataOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.util.UUID;
    
    import org.json.JSONArray;
    import org.json.JSONObject;
    
    public class OCRAPIDemo {
    
    	public static void main(String[] args) {
    		String apiURL = "YOUR_API_URL";
    		String secretKey = "YOUR_SECRET_KEY";
    		String imageFile = "YOUR_IMAGE_FILE";
    
    		try {
    			URL url = new URL(apiURL);
    			HttpURLConnection con = (HttpURLConnection)url.openConnection();
    			con.setUseCaches(false);
    			con.setDoInput(true);
    			con.setDoOutput(true);
    			con.setReadTimeout(30000);
    			con.setRequestMethod("POST");
    			String boundary = "----" + UUID.randomUUID().toString().replaceAll("-", "");
    			con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
    			con.setRequestProperty("X-OCR-SECRET", secretKey);
    
    			JSONObject json = new JSONObject();
    			json.put("version", "V2");
    			json.put("requestId", UUID.randomUUID().toString());
    			json.put("timestamp", System.currentTimeMillis());
    			JSONObject image = new JSONObject();
    			image.put("format", "jpg");
    			image.put("name", "demo");
    			JSONArray images = new JSONArray();
    			images.put(image);
    			json.put("images", images);
    			String postParams = json.toString();
    
    			con.connect();
    			DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    			long start = System.currentTimeMillis();
    			File file = new File(imageFile);
    			writeMultiPart(wr, postParams, file, boundary);
    			wr.close();
    
    			int responseCode = con.getResponseCode();
    			BufferedReader br;
    			if (responseCode == 200) {
    				br = new BufferedReader(new InputStreamReader(con.getInputStream()));
    			} else {
    				br = new BufferedReader(new InputStreamReader(con.getErrorStream()));
    			}
    			String inputLine;
    			StringBuffer response = new StringBuffer();
    			while ((inputLine = br.readLine()) != null) {
    				response.append(inputLine);
    			}
    			br.close();
    
    			System.out.println(response);
    		} catch (Exception e) {
    			System.out.println(e);
    		}
    	}
    
    	private static void writeMultiPart(OutputStream out, String jsonMessage, File file, String boundary) throws
    		IOException {
    		StringBuilder sb = new StringBuilder();
    		sb.append("--").append(boundary).append("\r\n");
    		sb.append("Content-Disposition:form-data; name=\"message\"\r\n\r\n");
    		sb.append(jsonMessage);
    		sb.append("\r\n");
    
    		out.write(sb.toString().getBytes("UTF-8"));
    		out.flush();
    
    		if (file != null && file.isFile()) {
    			out.write(("--" + boundary + "\r\n").getBytes("UTF-8"));
    			StringBuilder fileString = new StringBuilder();
    			fileString
    				.append("Content-Disposition:form-data; name=\"file\"; filename=");
    			fileString.append("\"" + file.getName() + "\"\r\n");
    			fileString.append("Content-Type: application/octet-stream\r\n\r\n");
    			out.write(fileString.toString().getBytes("UTF-8"));
    			out.flush();
    
    			try (FileInputStream fis = new FileInputStream(file)) {
    				byte[] buffer = new byte[8192];
    				int count;
    				while ((count = fis.read(buffer)) != -1) {
    					out.write(buffer, 0, count);
    				}
    				out.write("\r\n".getBytes());
    			}
    
    			out.write(("--" + boundary + "--\r\n").getBytes("UTF-8"));
    		}
    		out.flush();
    	}
    }
    
    import requests
    import uuid
    import time
    import json
    
    api_url = 'YOUR_API_URL'
    secret_key = 'YOUR_SECRET_KEY'
    image_file = 'YOUR_IMAGE_FILE'
    
    request_json = {
        'images': [
            {
                'format': 'jpg',
                'name': 'demo'
            }
        ],
        'requestId': str(uuid.uuid4()),
        'version': 'V2',
        'timestamp': int(round(time.time() * 1000))
    }
    
    payload = {'message': json.dumps(request_json).encode('UTF-8')}
    files = [
      ('file', open(image_file,'rb'))
    ]
    headers = {
      'X-OCR-SECRET': secret_key
    }
    
    response = requests.request("POST", api_url, headers=headers, data = payload, files = files)
    
    print(response.text.encode('utf8'))
    
    
    <?php
      $client_secret = "YOUR_SECRET_KEY";
      $url = "YOUR_API_URL";
      $image_file = "YOUR_IMAGE_FILE";
    
      $params->version = "V2";
      $params->requestId = uniqid();
      $params->timestamp = time();
      $image->format = "jpg";
      $image->name = "demo";
      $images = array($image);
      $params->images = $images;
      $json = json_encode($params);
      
      $boundary = uniqid();
      $is_post = true;
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_POST, $is_post);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      $post_form = array("message" => $json, "file" => new CURLFILE($image_file));
      curl_setopt($ch, CURLOPT_POSTFIELDS, $post_form);
      $headers = array();
      $headers[] = "X-OCR-SECRET: ".$client_secret;
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
      $response = curl_exec($ch);
      $err = curl_error($ch);
      $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
      curl_close ($ch);
    
      echo $status_code;
      if($status_code == 200) {
        echo $response;
      } else {
        echo "ERROR: ".$response;
      }
    ?>
    
    • Request with application/json
    import java.io.BufferedReader;
    import java.io.DataOutputStream;
    import java.io.InputStreamReader;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.util.UUID;
    
    import org.json.JSONArray;
    import org.json.JSONObject;
    
    public class OCRGeneralAPIDemo {
    
    	public static void main(String[] args) {
    		String apiURL = "YOUR_API_URL";
    		String secretKey = "YOUR_SECRET_KEY";
    
    		try {
    			URL url = new URL(apiURL);
    			HttpURLConnection con = (HttpURLConnection)url.openConnection();
    			con.setUseCaches(false);
    			con.setDoInput(true);
    			con.setDoOutput(true);
    			con.setRequestMethod("POST");
    			con.setRequestProperty("Content-Type", "application/json; charset=utf-8");
    			con.setRequestProperty("X-OCR-SECRET", secretKey);
    
    			JSONObject json = new JSONObject();
    			json.put("version", "V2");
    			json.put("requestId", UUID.randomUUID().toString());
    			json.put("timestamp", System.currentTimeMillis());
    			JSONObject image = new JSONObject();
    			image.put("format", "jpg");
    			image should be public, otherwise, should use data
    			FileInputStream inputStream = new FileInputStream("YOUR_IMAGE_FILE");
    			byte[] buffer = new byte[inputStream.available()];
    			inputStream.read(buffer);
    			inputStream.close();
    			image.put("data", buffer);
    			image.put("name", "demo");
    			JSONArray images = new JSONArray();
    			images.put(image);
    			json.put("images", images);
    			String postParams = json.toString();
    
    			DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    			wr.writeBytes(postParams);
    			wr.flush();
    			wr.close();
    
    			int responseCode = con.getResponseCode();
    			BufferedReader br;
    			if (responseCode == 200) {
    				br = new BufferedReader(new InputStreamReader(con.getInputStream()));
    			} else {
    				br = new BufferedReader(new InputStreamReader(con.getErrorStream()));
    			}
    			String inputLine;
    			StringBuffer response = new StringBuffer();
    			while ((inputLine = br.readLine()) != null) {
    				response.append(inputLine);
    			}
    			br.close();
    
    			System.out.println(response);
    		} catch (Exception e) {
    			System.out.println(e);
    		}
    	}
    
    }
    
    
    import requests
    import uuid
    import time
    import base64
    import json
    
    api_url = 'YOUR_API_URL'
    secret_key = 'YOUR_SECRET_KEY'
    image_file = 'YOUR_IMAGE_FILE'
    with open(image_file,'rb') as f:
    file_data = f.read()
    
    request_json = {
        'images': [
            {
                'format': 'jpg',
                'name': 'demo',
                'data': base64.b64encode(file_data).decode()
            }
        ],
        'requestId': str(uuid.uuid4()),
        'version': 'V2',
        'timestamp': int(round(time.time() * 1000))
    }
    
    payload = json.dumps(request_json).encode('UTF-8')
    headers = {
      'X-OCR-SECRET': secret_key,
      'Content-Type': 'application/json'
    }
    
    response = requests.request("POST", api_url, headers=headers, data = payload)
    
    print(response.text)
    
    
    <?php
      $client_secret = "YOUR_SECRET_KEY";
      $url = "YOUR_API_URL";
      $image_file = "YOUR_IMAGE_FILE";
    
      $params->version = "V2";
      $params->requestId = "uuid";
      $params->timestamp = time();
      $image->format = "jpg";
      $image->data = base64_encode(file_get_contents($image_file));
      $image->name = "demo";
      $images = array($image);
      $params->images = $images;
      $json = json_encode($params);
    
      $is_post = true;
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_POST, $is_post);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
      $headers = array();
      $headers[] = "X-OCR-SECRET: ".$client_secret;
      $headers[] = "Content-Type:application/json; charset=utf-8";
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
      $response = curl_exec($ch);
      $err = curl_error($ch);
      $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
      curl_close ($ch);
    
      echo $status_code;
      if($status_code == 200) {
        echo $response;
      } else {
        echo "ERROR: ".$response;
      }
    ?>
    
    

    Error code

    HttpStatusCodeDescription
    400요청 매개변수가 유효하지 않거나 제약 조건에 문제가 있음.
    401잘못된 API secret key (X-OCR-API-KEY)
    500내부 서버 오류

    Error Response Body:

    {
      "code": "Error Code",
      "message": "error details message.",
      "path": "request API path",
      "timestamp": 1570776853475
    }
    
    ErrorCodeDescription
    0001유효하지 않은 URL.
    0002Secret key 유효성 검사 실패.
    0011유효하지 않은 요청 본문.
    0021지원되지 않는 프로토콜 버전.
    0022유효하지 않은 요청 도메인.
    0023API 요청 횟수가 상한에 도달함.
    0025이 API에 대한 호출이 요금 한도를 초과함.
    0500알 수 없는 서비스 오류.
    0501OCR 서비스 오류.

    이 문서가 도움이 되었습니까?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.