Batch & CSV search
Up to 1000 cached lookups per call, JSON or CSV, row in and row out, with per-row fault isolation.
Livehttps://api.offendersearch.appSandboxhttps://sandbox.offendersearch.appOne row in, one result out
Bulk cached lookups: each row runs through the same cached engine as POST /v1/criminal/search, so results are identical to running them individually, and every result carries the same Record schema and the same envelope — counts, warnings, pagination, labelled status. Live verification is not offered in batch — there is no live block on a batch row, and a batch never fans out to a live source, so every row is cache-only and every status is complete or error, never partial.
- Three accepted body shapes. A bare JSON array of query objects, a JSON envelope
{ "queries": [...], ...defaults }whose non-querieskeys apply to every row, or atext/csvbody whose header row names query fields. - Input order is preserved. Each result carries its 0-based
index, so you can zip results back onto your own rows without matching on identity. - Rows are fault-isolated. A row that fails validation is returned with
status: "error"in place and never aborts the rest of the batch — and is not billed. - 1000 rows per call. A larger batch returns
413 batch_too_large; a batch of zero rows is a422 empty_batch.
meterEvents carries one criminal_call (quantity: 1) for each row that ran. A row that fails validation is not metered, so meterEvents can hold fewer entries than count.The JSON form
Post either a bare array of query objects, or an envelope { "queries": [...], ...defaults } whose non-queries keys are batch-wide defaults applied to every row. A per-row value overrides the default for that row — so nameStrategy: "prefix" at the envelope level applies to all rows unless a row sets its own. Each query object is flat — the fields from a query, not wrapped in { "query": … }.
curl -X POST https://api.offendersearch.app/v1/criminal/batch \
-H "X-API-Key: $OFFENDERSEARCH_KEY" \
-H "Content-Type: application/json" \
-d '[
{ "lastName": "Hamilton", "state": "TX" },
{ "firstName": "Alex", "state": "TX" }
]'{
"queries": [
{ "lastName": "Hamilton", "state": "TX" },
{ "lastName": "Example", "state": "IL", "firstName": "Chris" }
],
"include": ["sourceData"],
"nameStrategy": "prefix"
}The CSV form
Post a text/csv body whose header row names query fields, one query per line. Empty cells are dropped, and a UTF-8 BOM is handled. Unknown columns are ignored, so you can post a CSV export unchanged — a caseRef or note column is dropped rather than rejected. The endpoint still requires lastName per row.
curl -X POST https://api.offendersearch.app/v1/criminal/batch \
-H "X-API-Key: $OFFENDERSEARCH_KEY" \
-H "Content-Type: text/csv" \
--data-binary $'firstName,lastName,state,caseRef\nAlex,Hamilton,TX,FILE-0142\nJordan,,IL,FILE-0143\n'{
"count": 2,
"results": [
{ "index": 0, "status": "complete",
"counts": { "records": 12, "recordsReturned": 12, "sourcesQueried": 0,
"sourcesComplete": 0, "sourcesIncomplete": 0, "candidatesCapped": false,
"sourcesOnFile": 44, "sourcesPending": 27 },
"warnings": [], "page": 1, "perPage": 50, "totalPages": 1,
"sourceStatus": [], "cappedOmittedSources": [], "omittedFields": ["sourceData"],
"records": [ "… 12 records …" ],
"proof": { "status": "none" },
"coverage": { "scope": { "state": "TX", "county": null },
"sourcesOnFile": 44, "sourcesPending": 27, "pendingSources": [ "…" ] },
"legal": { "notice": "Not a consumer report. …" } },
{ "index": 1, "status": "error",
"error": "a lastName predicate is required — an unbounded query returns a lottery, not an answer",
"counts": { "records": 0, "recordsReturned": 0, "sourcesQueried": 0,
"sourcesComplete": 0, "sourcesIncomplete": 0, "candidatesCapped": false,
"sourcesOnFile": 0, "sourcesPending": 0 },
"records": [] }
],
"meterEvents": [ { "kind": "criminal_call", "quantity": 1, "chargeCeilingUsd": null } ]
}counts, exactly as a single search does — the unknown caseRef column was ignored. Row 1 has no surname, so it is status: "error" with the reason in place, and it is not billed: meterEvents holds one criminal_call, for the one row that ran, even though count is 2.Guardrails & unbounded rows
A batch is one HTTP call, but each row is a full search and each row is validated on its own. The whole-batch guardrails are size limits; the per-row guardrail is the same surname requirement as a single search.
| Limit | Value | Over-limit behaviour |
|---|---|---|
| Max rows | 1000 | 413 batch_too_large |
| Zero rows | — | 422 empty_batch |
| Unparseable body / no CSV header | — | 422 bad_batch |
status: "error", not a lottery. A row with no lastName would be an unbounded query, so the row is returned with status: "error", its index in place, zeroed counts, an empty records, and an error string — and it is not billed. The rest of the batch still runs. A bad row is a row you can fix and resubmit, never a failure that costs you the whole call.Criminal batch API request and response fields
Run up to 1,000 cached searches in one request, one result per row in input order. Each row that runs bills one criminal_call. Live verification is not available in a batch.
Request
Three forms are accepted: this envelope, a bare JSON array of Query objects, or text/csv with a header row of Query field names and one query per line.
| Field | Type | Description |
|---|---|---|
| queries required | array of Query | The rows, one Query object each, at most 1,000. A row that fails validation returns status: "error" and the others still run. |
| include optional | array of string one of "sourceData", "coverage", "exclusions" | Applied to every row, as on a search. |
| page optional · default 1 | integer | Page applied to each row's result. |
| perPage optional · default 50 | integer | Page size applied to each row's result. An integer from 1 to 200; a row with any other value comes back as an error row naming perPage. |
| nameStrategy optional | string one of "prefix", "exact" | Surname strategy applied to every row that does not set its own. |
| state optional | string | Any Query field can be given here as a default; state is the common one. |
Response
The batch ran. Rows that failed validation are reported in place.
| Field | Type | Description |
|---|---|---|
| count | integer | Number of entries in results[], equal to the number of input rows. |
| results | array of BatchRow | One result per row. |
| meterEvents | array of MeterEvent | One criminal_call per row that ran. Rows that failed validation are not billed. |
| Status | Code | When |
|---|---|---|
| 401 | — | Missing or invalid X-API-Key. Body: GatewayError. |
| 402 | — | Free trial used up, or no active subscription. Body: GatewayError. |
| 413 | batch_too_large | More than 1,000 rows. |
| 422 | bad_batch | The body is not valid JSON, not an array or {queries: [...]}, or a CSV without a header row. |
| 422 | empty_batch | No rows. |
| 422 | query_too_broad | The name and filters match more stored records than one search can read in full within its time budget. Refused rather than answered partially; the body also carries detail, saying what to add (a first name or a state). In a batch, that row comes back as an error row instead. |
| 503 | unavailable | Criminal Search could not be reached. Retry with backoff. |
| 504 | upstream_timeout | Criminal Search took longer than 65 seconds to answer. Retry, or narrow the query. |
The BatchRow object — one row's result
One row's result. A row that ran is the search envelope without searchId, meterEvents, usage and resolution, plus index. A row that failed validation carries only index, status: "error", error, zeroed counts and records: [].
Returned or accepted by POST /v1/criminal/batch.
| Field | Type | Description |
|---|---|---|
| index | integer | 0-based position of the row in your input. |
| status | string one of "complete", "partial", "error" | complete, or error when the row failed validation. Batch rows run cached only, so partial does not occur. |
| error | string | Present only on status: "error": the row's validation message. |
| counts | Counts | Totals for this row. |
| warnings | array of string | As on a search. A batch row runs cached, so it is []. |
| page | integer | The page returned for this row. |
| perPage | integer | The perPage for this row, echoed back. A row never carries more than 200 records. |
| totalPages | integer | Pages at this perPage. |
| sourceStatus | array of SourceStatus | [] on every batch row, which runs cached. |
| cappedOmittedSources | array of string | []; present for envelope parity. |
| omittedFields | array of string one of "sourceData" | As on a search. |
| records | array of CriminalRecord | This row's matched records. |
| proof | object | Always {"status": "none"}. |
| proof.status | string one of "none" | Always "none". |
| coverage | SearchCoverage | Coverage for this row's state or county. |
| legal | Legal | The not-a-consumer-report notice. |
Test criminal batch search in the sandbox
POST /v1/criminal/batch runs on the sandbox with a test key (os_test_…). Send the criminal test names as rows: each row gets the same answer it gets from POST /v1/criminal/search, in input order, never billed.
- Base URL
https://sandbox.offendersearch.appNothttps://api.offendersearch.app, which takes live keys only.- Test key
- In the dashboard, Developers → API keys → Create test key. Test keys begin
os_test_; send yours in theX-API-Keyheader.
curl -X POST "https://sandbox.offendersearch.app/v1/criminal/batch" \
-H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"firstName": "Clear",
"lastName": "Record"
},
{
"firstName": "Felony",
"lastName": "Record",
"dob": "1975-06-15"
}
]'Try it here
Pick a scenario, edit the request, and run it against the sandbox from this page. The explorer accepts os_test_ keys only and never reaches the live host, so nothing here is billed; the “production” code it copies is for your own backend with a live key.
Copy this request as code
Sandbox code uses your test key. Production code calls the live host and is billed per call; run it from your backend with an os_live_… key.
curl -X POST https://sandbox.offendersearch.app/v1/criminal/batch \
-H "X-API-Key: $OFFENDERSEARCH_TEST_KEY" \
-H "Content-Type: application/json" \
-d '[ { "firstName": "Clear", "lastName": "Record" }, { "firstName": "Felony", "lastName": "Record", "dob": "1975-06-15" } ]'Every test name: Criminal search test namesPostman collectionCriminal Search API sandbox