# 개인정보 마스킹(주민등록번호)



이미지파일에서 주민등록번호를 인식하여 가립니다.



인증: Authorization: Bearer $APICK_API_KEY

본문 있는 REST 요청: multipart/form-data. GET 본문 및 MCP JSON-RPC 규격은 해당 명세를 따릅니다.

인증키는 서버에 보관하세요. 모든 예제는 정적 자료입니다.



## POST /rest/hide_rrn 응답 필드

## API 요청: POST /rest/hide_rrn



### 입력

- `image` (file, 필수): 이미지 파일

- `type` (string, 필수): 가림 처리 타입 (1: 주민등록번호 전체, 2: 뒷자리 전체, 3: 뒷자리 첫 숫자 제외, 4: 주민등록번호+주소)



### 응답 명세

```json

{
  "type": "object",
  "properties": {}
}

```

### curl

```curl

curl --fail-with-body --request POST 'https://apick.app/rest/hide_rrn' \
  --header "Authorization: Bearer $APICK_API_KEY" \
  --form 'image=@/C:/Users/user/Desktop/sample_idcard.png' \
  --form-string 'type=3' \
  --dump-header response.headers --output result.bin
# response.headers의 Content-Type을 확인한 뒤 파일을 사용하세요.

```

### Node.js (서버 ESM)

```javascript

import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("image", new Blob([await readFile("/C:/Users/user/Desktop/sample_idcard.png")]), "sample_idcard.png");
form.append("type", "3");
const response = await fetch("https://apick.app/rest/hide_rrn", {
  method: "POST",
  headers: { Authorization: "Bearer " + process.env.APICK_API_KEY },
  body: form,
  signal: AbortSignal.timeout(120_000),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
if ((response.headers.get("content-type") || "").includes("json")) {
  throw new Error(JSON.stringify(await response.json()));
}
const { writeFile } = await import("node:fs/promises");
await writeFile("result.bin", new Uint8Array(await response.arrayBuffer()));

```

### python

```python

import os
import requests
parts = [
    ("image", ("sample_idcard.png", open("/C:/Users/user/Desktop/sample_idcard.png", "rb"))),
    ("type", (None, "3")),
]
response = requests.request("POST", "https://apick.app/rest/hide_rrn",
    headers={"Authorization": "Bearer " + os.environ["APICK_API_KEY"]},
    files=parts,
    timeout=(10, 120), stream=True)
response.raise_for_status()
if "json" in response.headers.get("Content-Type", ""):
    raise RuntimeError(response.json())
with open("result.bin", "wb") as output:
    for chunk in response.iter_content(65536):
        output.write(chunk)

```

### php

```php

<?php
$headers = ["Authorization: Bearer " . getenv("APICK_API_KEY")];
$form = [
    'image' => new CURLFile('/C:/Users/user/Desktop/sample_idcard.png'),
    'type' => '3',
];
$curl = curl_init('https://apick.app/rest/hide_rrn');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_POSTFIELDS => $form,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($curl);
if ($body === false) { throw new RuntimeException(curl_error($curl)); }
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$type = curl_getinfo($curl, CURLINFO_CONTENT_TYPE) ?: "";
curl_close($curl);
if ($status >= 400) { throw new RuntimeException($body); }
if (strpos($type, "json") !== false) { throw new RuntimeException($body); }
file_put_contents('result.bin', $body);

```

## 코드·오류

## 상세 기능·요금

업로드 용량 제한: 50MB 첨부 이미지 합계는 최대 50MB입니다. 서버가 판독 가능한 크기로 최적화하며, 지나치게 큰 해상도는 정확도를 높이지 않고 처리시간만 늘릴 수 있습니다. 제한을 초과하면 HTTP 413과 REQUEST_TOO_LARGE 오류가 반환되며 과금되지 않습니다. Method URL POST https://apick.app/rest/hide_rrn

## 상세 요청

Header 이름 필수 설명 Authorization O Bearer 인증키

## 상세 응답

Header 이름 필수 설명 success O API 서버 정상 응답 여부 cost O API 호출 요금 ms O API 응답 시간 Content-Type O 응답 바디 데이터 타입 Content-Disposition O 파일명(output 고정) Body 이름 타입 설명 png 형식의 바이너리 데이터

## 상세 코드·정책

오류 응답 실패 응답은 data.success: 0, api.cost: 0을 유지하며 data.error_code로 원인을 구분합니다. HTTP / 오류 코드설명 422IDENTITY_TEXT_UNREADABLE 글자가 일부 가려졌거나 선명하지 않아 필요한 정보를 정확히 인식할 수 없습니다. 문서 전체와 글자가 선명하게 보이는 이미지를 업로드해 주세요. 400IDENTITY_DOCUMENT_MISMATCH 주민등록번호가 포함된 올바른 문서 이미지를 업로드해 주세요. 424IDENTITY_PROCESSING_FAILED 이미지 처리 중 오류가 발생했습니다. 잠시 후 다시 시도해 주세요.

## 상세 예제

결과 예시 [이미지] 요청 예시 form-data 전체 예제 보기 응답 예시 {PNG 형식의 바이너리 데이터}
