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, error or, rarely, not_run (see below) — 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, a UTF-8 BOM is handled, and common spellings of a header (First Name, DOB, Zip Code) name their field. 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,
"duplicatesFolded": 0, "exclusionsIncluded": 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.Screening a list of people in a batch
A file of applicants or renters — first, middle and last name, full date of birth and a current address per row — is the common bulk shape. Send it as it is; each row is read the way such a row means it.
- A full
dobreads the surname exactly. Without anameStrategy, a row with a full date of birth usesexact, so “Lee” is not also read as LEEDS or LEEPER. - The address ranks; it does not filter. With a full
dob,address,city,zipcodeand thestatesent with them are a residence hint (residenceMode: "prefer"): records where the person lives sort first and say so inresidenceMatch, and the person’s records in other states, or on a record with no published address, still come back. SendresidenceMode: "filter"to restrict to the residence instead. - Each row says how strong its best match is.
matchSummary.bestMatchisdob_match,year_or_age_match_same_state,year_or_age_match,name_onlyorclear, with counts per tier, distinct people (peopleByTier) and the same-name records dropped because their date of birth contradicts yours. Records come back best tier first; each carriesmatchTierand apersonGroupshared by the same person across sources. - Name-only records are optional.
dobPolicy: "require"drops everyname_onlyrecord (no birth evidence, or only an uncorroborated year or age in another state);matchStates: ["dob_match"]keeps only full-date matches. The default keeps every record, labelled. middleNamebreaks ties. An agreeing middle name ranks a record higher; a conflicting one ranks it lower. It never removes a record.- Spreadsheet input is read as meant. CSV headers such as
First Name,last_name,DOB,Zip CodeorStreet Addressname the fields;MM/DD/YYYYdates are read as dates; a one-line"123 Main St, Springfield, IL 62701, USA"is split into its parts. A row that cannot be read isstatus: "error"with anerrorCode, and the rest of the file still runs. - Every row runs. A row the service could not reach in time is resent automatically. In the rare case some still could not run, they come back
status: "not_run"(not billed) and are listed inunfinished[]to resend. Batches of 100–200 rows answer fastest.
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. |
| unfinished | array of object | Present only when some rows could not be run in time (status: "not_run"): each row's index and the query it was sent with. Resend exactly these rows to complete the file; rows that ran are not repeated or re-billed. Rare: the API itself resends them for up to 14 minutes before answering. |
| unfinished[].index | integer | The row's position in your input. |
| unfinished[].query | object | The row as it was sent, with the batch-wide defaults applied. |
| 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", "not_run" | complete; error when the row failed validation or was refused; not_run when the batch could not reach the row in time — nothing was searched or billed, and the row is listed in unfinished[] to resend. Batch rows run cached only, so partial does not occur. |
| error | string | Present only on status: "error": the row's validation message. |
| errorCode | string | Present only on status: "error": the machine-readable code, the same one a single search answers for that query (guard_unbounded_query, invalid_dob, query_too_broad, …).Example "guard_unbounded_query" |
| 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. |
| matchSummary | MatchSummary | This row's identity picture over every record: read bestMatch for the row's verdict without paging. |
The MatchSummary object — one answer's identity picture
Counted over every record of one search or batch row, not one page, so a bulk caller reads each row's verdict without paging and can measure match quality from aggregates.
Returned or accepted by POST /v1/criminal/search, GET /v1/criminal/searches/{searchId}, POST /v1/criminal/batch.
| Field | Type | Description |
|---|---|---|
| bestMatch | string one of "dob_match", "year_or_age_match_same_state", "year_or_age_match", "name_only", "clear" | The strongest matchTier among the records, or clear when no record matched. Only dob_match confirms a full date of birth; name_only means every record is present on the name alone. |
| byTier | object | Records per matchTier; every tier is always listed.Example {"dob_match":2,"year_or_age_match_same_state":0,"year_or_age_match":1,"name_only":14} |
| byMatchState | object | Records per matchState; only the states that occurred are listed.Example {"dob_match":2,"year_match":1,"no_dob_age_year":14} |
| peopleByTier | object | Distinct people per matchTier, counting records that share a personGroup once: the same person found by several sources is one person here.Example {"dob_match":1,"year_or_age_match_same_state":0,"year_or_age_match":1,"name_only":14} |
| dobContradictedDropped | integer | Same-name records dropped because their birth evidence contradicts the query (a different full date or birth year, or an inconsistent age). Never served. |
| dobPolicyDropped | integer | Records dropped by dobPolicy: "require" (matchTier: "name_only"). |
| middleNameConflicts | integer | Served records whose published middle name conflicts with middleName. |
| byVerdict | object | Served records per identity.verdict: very_likely, likely, possible, unlikely, very_unlikely.Example {"very_likely":1,"likely":0,"possible":2,"unlikely":0,"very_unlikely":3} |
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