Skip to content
Implementation

Examples for calling the published routes.

The snippets below show cURL requests, matching Node.js fetch calls, and a typed TypeScript helper for the routes published in this repository.

Formats

cURL + Node.js

Client focus

Server-safe fetch

Error strategy

Code-aware handling

cURL and Node.js examples

GNU BashTerminal smoke tests (cURL)
curl -s https://utils.api.orb3x.com/api/nif/004813023LA040curl -s -X POST https://utils.api.orb3x.com/api/translate \  -H "Content-Type: application/json" \  -d '{"text":"Preciso de ajuda","to":"en"}'curl -s "https://utils.api.orb3x.com/api/exchange/aoa?amount=250000"

Typed TypeScript helper

TypeScriptShared client utility
type ApiError = {  error?: {    code?: string;    message?: string;  };  code?: string;  message?: string;};export async function callApi<T>(input: RequestInfo, init?: RequestInit): Promise<T> {  const response = await fetch(input, init);  if (!response.ok) {    const error = (await response.json().catch(() => ({}))) as ApiError;    throw new Error(error.error?.code ?? error.code ?? "REQUEST_FAILED");  }  return (await response.json()) as T;}

Workflow patterns

  • Customer onboarding: verify the taxpayer record before activating an account in your back-office flow.
  • Localization pipeline: translate user-facing content and store both the translated text and detected source language.
  • Pricing dashboard: request base rates once, then use unitRates or convertedRates depending on how much control the UI needs.
  • Support tooling: surface upstream error codes to internal agents so they can distinguish bad input from provider outages quickly.

Production hardening

  • Wrap calls in a shared client with typed success and error shapes.
  • Emit metrics for timeout, bad response, not found, and invalid input rates separately.
  • Keep retry logic close to the client boundary so product code does not reimplement it per feature.
  • Record ratesDate and sourceLanguage when those fields matter for auditability or editorial review.