Dokumentasi API
Panduan lengkap integrasi API SI PINDAI
Getting Started
Mulai gunakan API dalam 5 menit
1. Dapatkan API Key
Login ke dashboard dan copy API key Anda
API Key: dex_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2. Buat Request Pertama
const response = await fetch('https://sipindai.com/api/v1/extract/ktp', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'multipart/form-data'
},
body: formData
});
Butuh Bantuan? Tim support kami siap membantu 24/7
Authentication
Cara autentikasi API request Anda
Bearer Token
Gunakan API key sebagai Bearer token di header request
Authorization: Bearer dex_live_your_api_key_here
Contoh Request dengan cURL
curl -X POST https://sipindai.com/api/v1/extract/ktp \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@document.pdf"
API Endpoints
Daftar endpoint yang tersedia
POST /v1/extract/{document}
Ekstrak data ID - KTP dari dokumen
POST https://sipindai.com/api/v1/extract/ktp
Ekstrak data ID - KK dari dokumen
POST https://sipindai.com/api/v1/extract/kk
Ekstrak data NPWP dari dokumen
POST https://sipindai.com/api/v1/extract/npwp
Ekstrak data PASSPORT dari dokumen
POST https://sipindai.com/api/v1/extract/passport
GET /v1/balance
Cek saldo akun Anda
GET https://sipindai.com/api/v1/balance
GET /v1/history
Lihat riwayat ekstraksi
GET https://sipindai.com/api/v1/history
Code Examples
Contoh implementasi di berbagai bahasa
JavaScript / Node.js
const FormData = require('form-data');
const fs = require('fs');
const form = new FormData();
form.append('file', fs.createReadStream('document.pdf'));
const response = await fetch('https://sipindai.com/api/v1/extract/ktp', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
},
body: form
});
const data = await response.json();
console.log(data);
Python
import requests
url = "https://sipindai.com/api/v1/extract/ktp"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
files = {"file": open("document.pdf", "rb")}
response = requests.post(url, headers=headers, files=files)
print(response.json())
PHP
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sipindai.com/api/v1/extract/ktp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY"
],
CURLOPT_POSTFIELDS => [
'file' => new CURLFile('document.pdf')
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;