OCR
OCR(Optical Character Recognition) ๋ชจ๋ธ์ ์ด๋ฏธ์ง์ PDF์์ ํ ์คํธ๋ฅผ ์ธ์ํ๊ณ ๋์งํธ ํ์์ผ๋ก ๋ณํํฉ๋๋ค. ์ด๋ฏธ์ง, ๋ฌธ์ ์ ํ ์คํธ๋ฅผ ์ถ์ถํฉ๋๋ค. ๋์ ์ ํ๋๋ก ํจ์จ์ ์ธ ๋ฌธ์ ์ฒ๋ฆฌ์ ๋ฐ์ดํฐ ๊ด๋ฆฌ๋ฅผ ๊ฐ๋ฅํ๊ฒ ํ๋ฉฐ, ๋์งํธํ๋ ํ๊ฒฝ์์ ์ ๋ณด ์ ๊ทผ์ฑ์ ๋์ฌ ์ค๋๋ค.
vailable Models
ocr-251030
ํ ์คํธ ์ธ์ ์ ํ๋๊ฐ ๋ฐ์ด๋๋ฉฐ, ๋ค์ํ ์ธ์ด์ ํ ์คํธ๋ฅผ ํจ์จ์ ์ผ๋ก ๋ณํํฉ๋๋ค. ๋ค์ํ ์ด๋ฏธ์ง ํฌ๋งท๊ณผ PDF ์ ํ์ ๋ฌธ์๋ฅผ ์ฒ๋ฆฌํ ์ ์์ต๋๋ค.
Request
Request Headers
Content-Type
multipart/form-data
x-api-key
UNIVA-API-KEY
curl -X POST 'https://aiplatform-api.rest.univa.co.kr/rest/v1/image/ocr' \
-H 'x-api-key: UNIVA-API-KEY' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@YOUR-FILE-PATH;type=image/png'const axios = require('axios')
const FormData = require('form-data')
const fs = require('fs')
const path = require('path')
const apiKey = 'UNIVA-API-KEY'
const url = 'https://aiplatform-api.rest.univa.co.kr/rest/v1/image/ocr'
const filePath = path.join(__dirname, 'YOUR-FILE-PATH')
const form = new FormData()
form.append('file', fs.createReadStream(filePath),
{contentType: 'image/png'}
)
axios
.post(url, form, {
headers: {
'x-api-key': apiKey,
...form.getHeaders(),
},
})
.then((response) => {
console.log('Status Code:', response.status)
console.log('Response Body:', response.data)
})
.catch((error) => {
console.error('Error:', error)
})Request Body (*required)
file*
object
ํ์ผ ๋ฐ์ดํฐ
- ์ด๋ฏธ์ง ํฌ๋งท : .jpg, .jpeg, .png, .webp
- ๋ฌธ์ ํฌ๋งท : .pdf
MIME (Multipurpose Internet Mail Extensions)
- .jpg : image/jpeg
- .jpeg : image/jpeg
- .png : image/png
- .webp : image/webp
- .pdf : application/pdf
Response
API ํธ์ถ์์ ๋ฐ์ํ๋ ์ค๋ฅ๋ API Error code ํ์ด์ง๋ฅผ ํ์ธํด์ฃผ์ธ์.
Last updated