SDK Overview
Official Loom API SDKs for Node.js / TypeScript and Python provide typed clients, retries, and consistent error handling. You can also use the REST API directly with the x-tenant-api-key header.
JavaScript / TypeScript
Package: loomapi-js
GitHub: loomapi/loomapi-js
Install
npm install loomapi-js
Usage
import { LoomAPI, LoomAPIError } from 'loomapi-js';
const client = new LoomAPI({
apiKey: process.env.LOOM_API_KEY,
baseURL: 'https://api.loomapi.com', // optional
});
// Start a verification
const { verificationId, sessionUrl } = await client.startVerification({
userAgent: 'Mozilla/5.0...',
ip: '192.168.1.1',
});
// Check status
const status = await client.getVerificationStatus({ verificationId });
if (status.status === 'completed' && status.token) {
// Validate token
const { valid, over18 } = await client.validateToken({ token: status.token });
}
Error handling:
try {
await client.startVerification({ userAgent: '...', ip: '...' });
} catch (err) {
if (err instanceof LoomAPIError) {
console.error(err.errorCode, err.statusCode, err.requestId);
}
}
Python
Package: loomapi-python
GitHub: loomapi/loomapi-python
Install
pip install loomapi-python
Usage
from loomapi import LoomAPI, LoomAPIError
client = LoomAPI(
api_key='your-api-key',
base_url='https://api.loomapi.com', # optional
)
# Start a verification
verification = client.start_verification(
user_agent='Mozilla/5.0...',
ip='192.168.1.1',
)
verification_id = verification['verificationId']
# Check status
status = client.get_verification_status(verification_id)
if status['status'] == 'completed' and status.get('token'):
# Validate token
result = client.validate_token(status['token'])
if result['valid'] and result['over18']:
print('User verified and over 18')
Error handling:
try:
client.start_verification(user_agent='...', ip='...')
except LoomAPIError as e:
print(e.error_code, e.status_code, e.request_id)
REST API (no SDK)
You can integrate with any HTTP client using the same base URL and x-tenant-api-key header:
- Quickstart — 10-minute flow with curl
- cURL examples — copy-paste curl commands
- Node.js examples — fetch-based Node.js code
- Verification — full endpoint reference
Base URL: https://api.loomapi.com
Authentication: x-tenant-api-key: YOUR_TENANT_API_KEY
# Start a verification session
curl -X POST https://api.loomapi.com/verify/start \
-H "x-tenant-api-key: YOUR_TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
See Verify endpoint, Webhooks, and Rate limits for full details.