> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# Extract National Registration Identity Card

POST https://api.staple.io/v1/documents/extract/nric
Content-Type: multipart/form-data

Extract the structured data from a document using the NRIC model in Staple. The document would NOT be left in the queue specified for any further manipulation.

Reference: https://docs.staple.ai/api-reference/v1/documents/extract-national-registration-identity-card

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v1
  version: 1.0.0
paths:
  /v1/documents/extract/nric:
    post:
      operationId: extractNationalRegistrationIdentityCard
      summary: Extract National Registration Identity Card
      description: >-
        Extract the structured data from a document using the NRIC model in
        Staple. The document would NOT be left in the queue specified for any
        further manipulation.
      tags:
        - documents
      parameters:
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Documents_extractNationalRegistrationIdentityCard_Response_200
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: string
                  format: binary
                  description: File to upload
              required:
                - files
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    Documents_extractNationalRegistrationIdentityCard_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Documents_extractNationalRegistrationIdentityCard_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT obtained from the login endpoint.

```

## Examples



**Request**

```json
{
  "files": "<file: string>"
}
```

**Response**

```json
{
  "DOB": {
    "UICategory": "Basic Information",
    "UIName": "DOB",
    "UIType": "Date",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "page": null,
        "value": null
      }
    ]
  },
  "DocSize": [
    [
      1200,
      1600
    ]
  ],
  "ExpiryDate": {
    "UICategory": "Basic Information",
    "UIName": "Expiry Date",
    "UIType": "Date",
    "matches": [
      {
        "keyword": [
          807,
          731,
          1055,
          767,
          931,
          749,
          "Date of Application",
          "Date of Application"
        ],
        "match": "09-12-2015",
        "matchmulti": null,
        "page": 0,
        "value": [
          810,
          777,
          988,
          807,
          899,
          792,
          "09-12-2015",
          "09-12-2015"
        ]
      }
    ]
  },
  "Gender": {
    "UICategory": "Basic Information",
    "UIName": "Gender",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "page": null,
        "value": null
      }
    ]
  },
  "IssueDate": {
    "UICategory": "Basic Information",
    "UIName": "Issue Date",
    "UIType": "Date",
    "matches": [
      {
        "keyword": [
          806,
          825,
          976,
          849,
          891,
          837,
          "Date of Issue",
          "Date of Issue"
        ],
        "match": "15-12-2015",
        "matchmulti": null,
        "page": 0,
        "value": [
          809,
          864,
          979,
          895,
          894,
          879.5,
          "15-12-2015",
          "15-12-2015"
        ]
      }
    ]
  },
  "Name": {
    "UICategory": "Basic Information",
    "UIName": "Name",
    "UIType": "Text",
    "matches": [
      {
        "keyword": [
          497,
          546,
          569,
          569,
          533,
          557.5,
          "Name",
          "Name"
        ],
        "match": "PAUL DU LONG",
        "matchmulti": null,
        "page": 0,
        "value": [
          500,
          585,
          722,
          615,
          611,
          600,
          "PAUL DU LONG",
          "PAUL DU LONG"
        ]
      }
    ]
  },
  "Nationality": {
    "UICategory": "Basic Information",
    "UIName": "Nationality",
    "UIType": "Text",
    "matches": [
      {
        "keyword": null,
        "match": null,
        "page": null,
        "value": null
      }
    ]
  },
  "NricNumber": {
    "UICategory": "Basic Information",
    "UIName": "Nric Number",
    "UIType": "Text",
    "matches": [
      {
        "keyword": [
          500,
          732,
          540,
          754,
          520,
          743,
          "FIN",
          "FIN"
        ],
        "match": "G3236437W",
        "matchmulti": null,
        "page": 0,
        "value": [
          501,
          763,
          684,
          791,
          592.5,
          777,
          "G3236437W",
          "G3236437W"
        ]
      }
    ]
  },
  "SmallBoxes": [
    {
      "box": [
        592,
        294,
        985,
        335,
        788.5,
        314.5,
        "EMPLOYMENT PASS",
        "EMPLOYMENT PASS"
      ],
      "page": 0
    },
    {
      "box": [
        392,
        333,
        1198,
        383,
        795,
        358,
        "Employment of Foreign Manpower Act ( Chapter 91A )",
        "Employment of Foreign Manpower Act ( Chapter 91A )"
      ],
      "page": 0
    },
    {
      "box": [
        628,
        371,
        963,
        411,
        795.5,
        391,
        "Republic of Singapore",
        "Republic of Singapore"
      ],
      "page": 0
    },
    {
      "box": [
        179,
        423,
        301,
        452,
        240,
        437.5,
        "Employer",
        "Employer"
      ],
      "page": 0
    },
    {
      "box": [
        179,
        451,
        589,
        485,
        384,
        468,
        "OTONOMOS BCC PTE.LTD.",
        "OTONOMOS BCC PTE.LTD."
      ],
      "page": 0
    },
    {
      "box": [
        196,
        367,
        275,
        379,
        235.5,
        373,
        "MINISTRY OF",
        "MINISTRY OF"
      ],
      "page": 0
    },
    {
      "box": [
        197,
        378,
        275,
        393,
        236,
        385.5,
        "MANPOWER",
        "MANPOWER"
      ],
      "page": 0
    },
    {
      "box": [
        497,
        546,
        569,
        569,
        533,
        557.5,
        "Name",
        "Name"
      ],
      "page": 0
    },
    {
      "box": [
        500,
        585,
        722,
        615,
        611,
        600,
        "PAUL DU LONG",
        "PAUL DU LONG"
      ],
      "page": 0
    },
    {
      "box": [
        497,
        619,
        646,
        652,
        571.5,
        635.5,
        "Occupation",
        "Occupation"
      ],
      "page": 0
    },
    {
      "box": [
        501,
        655,
        895,
        693,
        698,
        674,
        "APPLICATION DEVELOPER",
        "APPLICATION DEVELOPER"
      ],
      "page": 0
    },
    {
      "box": [
        500,
        732,
        540,
        754,
        520,
        743,
        "FIN",
        "FIN"
      ],
      "page": 0
    },
    {
      "box": [
        501,
        763,
        684,
        791,
        592.5,
        777,
        "G3236437W",
        "G3236437W"
      ],
      "page": 0
    },
    {
      "box": [
        807,
        731,
        1055,
        767,
        931,
        749,
        "Date of Application",
        "Date of Application"
      ],
      "page": 0
    },
    {
      "box": [
        810,
        777,
        988,
        807,
        899,
        792,
        "09-12-2015",
        "09-12-2015"
      ],
      "page": 0
    },
    {
      "box": [
        806,
        825,
        976,
        849,
        891,
        837,
        "Date of Issue",
        "Date of Issue"
      ],
      "page": 0
    },
    {
      "box": [
        1062,
        856,
        1291,
        891,
        1176.5,
        873.5,
        "03336437W",
        "03336437W"
      ],
      "page": 0
    },
    {
      "box": [
        809,
        864,
        979,
        895,
        894,
        879.5,
        "15-12-2015",
        "15-12-2015"
      ],
      "page": 0
    },
    {
      "box": [
        805,
        896,
        987,
        932,
        896,
        914,
        "Date of Expiry",
        "Date of Expiry"
      ],
      "page": 0
    },
    {
      "box": [
        808,
        943,
        976,
        972,
        892,
        957.5,
        "15-12-2017",
        "15-12-2017"
      ],
      "page": 0
    },
    {
      "box": [
        1184,
        996,
        1383,
        1028,
        1283.5,
        1012,
        "L6323953",
        "L6323953"
      ],
      "page": 0
    }
  ],
  "num_pages": 1
}
```

**SDK Code**

```python Extract National Registration Identity Card
import requests

url = "https://api.staple.io/v1/documents/extract/nric"

files = { "files": "open('string', 'rb')" }
headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, files=files, headers=headers)

print(response.json())
```

```javascript Extract National Registration Identity Card
const url = 'https://api.staple.io/v1/documents/extract/nric';
const form = new FormData();
form.append('files', 'string');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Extract National Registration Identity Card
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v1/documents/extract/nric"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Extract National Registration Identity Card
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/documents/extract/nric")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java Extract National Registration Identity Card
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/documents/extract/nric")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Extract National Registration Identity Card
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/documents/extract/nric', [
  'multipart' => [
    [
        'name' => 'files',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Extract National Registration Identity Card
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/documents/extract/nric");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Extract National Registration Identity Card
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "files",
    "fileName": "string"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v1/documents/extract/nric")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```