Registry API reference.
Local JSON API at /api/v1. All original spreadsheet columns are returned in raw, with source URL, source file, sheet, and row number. No external enrichment is performed.
If ONG_API_KEY is configured, every API request requires Authorization: Bearer YOUR_KEY.
Endpoints
| METHOD | ENDPOINT | PURPOSE |
|---|---|---|
| GET | /organizations | Search and filter organizations |
| GET | /organizations/{id} | Complete organization, contacts, people and source |
| GET | /organizations/{id}/expand | Typed entity expansion plan with relationship labels |
| GET | /people | Search explicitly published person mentions |
| GET | /people/{id} | Source mention and organization reference |
| GET | /supporting-records | Search name reservation workbook rows |
| GET | /status | Counts, column coverage, sources, sync history and settings |
| POST | /sync | Start a background sync (202); already running (409) |
| POST | /settings | Set sync_interval_hours: 0 disables; 1–8760 enables |
| GET | /openapi.json | Machine-readable OpenAPI specification |
History & synchronization logbook
GET /api/v1/sync-files returns paginated file checks, SHA-256 comparisons, change counts and errors; filter by run_id. GET /api/v1/sync-runs returns all run reports. GET /api/v1/organizations/{id}/history returns full revisions and before/after field changes. GET /api/v1/supporting-records/{id}/history returns reservation-row source snapshots. These endpoints accept limit and offset.
Search accepts lifecycle=current|historical|all|recent (default current). Recent means observed changes within 30 days. Disappeared records are retained as historical, and removed fields remain in revision history. Historical does not mean legally dissolved. File archives are kept by SHA-256; unchanged fields do not create new record revisions.
Search parameters
q: search value. field: all, name, person, phone, email, domain, address, registration_number. county and category: optional filters. limit: 1–200, default 25. offset: default 0. exact: true for exact name/registry/address matches.
All-fields search uses SQLite FTS5, case-insensitive and insensitive to Romanian diacritics. Every query token must match a word prefix. Name and registry queries support substrings. Address queries normalize punctuation and match every address token, including the country name Romania. Email, phone, and domain queries use exact normalized contact values. Phone queries accept Romanian national or international notation. People search returns distinct source mentions rather than asserting unique identities.
Historical people backfill
POST /api/v1/historical-import accepts {"preset":"associations-2016-part-1"} or a local file encoded as {"filename":"old.csv","snapshot_date":"2016-03-01","category":"associations","file_base64":"..."}. The response is 202 or 409 when another import is running. Only built-in official remote sources are allowed. CSV/XLSX uploads work directly; original binary XLS requires requirements-historical.txt.
GET /api/v1/historical-imports lists completed batches. GET /api/v1/historical-records?q=... searches complete old source rows with limit/offset pagination. Historical people are searchable through /people?lifecycle=historical and retain the snapshot date, source role, and organization evidence reference. Current registry records are preserved.
Try a query
Run a query to see the JSON response.
Examples
curl 'http://127.0.0.1:8010/api/v1/organizations?q=educatie&field=all'
curl 'http://127.0.0.1:8010/api/v1/organizations?q=Bucuresti&field=address'
curl 'http://127.0.0.1:8010/api/v1/organizations?q=office%40example.ro&field=email'
curl 'http://127.0.0.1:8010/api/v1/people?q=Popescu'
curl -X POST http://127.0.0.1:8010/api/v1/sync
curl -X POST -H 'Content-Type: application/json' \
-d '{"sync_interval_hours":168}' http://127.0.0.1:8010/api/v1/settingsScheduling is implemented by the local application and requires the server to remain running. Failed category imports preserve their previous snapshot; a partially successful run is recorded as partial. Cached original workbooks remain under data/downloads.