Criminal Records API · v1.0.0

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.app

One 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-queries keys apply to every row, or a text/csv body 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 a 422 empty_batch.
Each row is billed as one call. A 1,000-row batch is 1,000 calls — 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": … }.

Bare array
POST /v1/criminal/batch
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" }
      ]'
Envelope with batch-wide defaults
queries + defaults
{
  "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.

Request — a two-row CSV, second row has no surname
POST /v1/criminal/batch (text/csv)
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'
Response — one envelope per row, in order
200 OK
{
  "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 } ]
}
Read each row’s own result. Row 0 ran and carries a full envelope with its own 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.

LimitValueOver-limit behaviour
Max rows1000413 batch_too_large
Zero rows—422 empty_batch
Unparseable body / no CSV header—422 bad_batch
An unbounded row surfaces as 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

POST/v1/criminal/batchAuth: X-API-Key

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

Body · application/json

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.

FieldTypeDescription
queries
required
array of QueryThe 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
integerPage applied to each row's result.
perPage
optional · default 50
integerPage 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
stringAny Query field can be given here as a default; state is the common one.

Response

200 · application/json

The batch ran. Rows that failed validation are reported in place.

FieldTypeDescription
count
integerNumber of entries in results[], equal to the number of input rows.
results
array of BatchRowOne result per row.
meterEvents
array of MeterEventOne criminal_call per row that ran. Rows that failed validation are not billed.
Errors
StatusCodeWhen
401—Missing or invalid X-API-Key. Body: GatewayError.
402—Free trial used up, or no active subscription. Body: GatewayError.
413batch_too_largeMore than 1,000 rows.
422bad_batchThe body is not valid JSON, not an array or {queries: [...]}, or a CSV without a header row.
422empty_batchNo rows.
422query_too_broadThe 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.
503unavailableCriminal Search could not be reached. Retry with backoff.
504upstream_timeoutCriminal 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.

FieldTypeDescription
index
integer0-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
stringPresent only on status: "error": the row's validation message.
counts
CountsTotals for this row.
warnings
array of stringAs on a search. A batch row runs cached, so it is [].
page
integerThe page returned for this row.
perPage
integerThe perPage for this row, echoed back. A row never carries more than 200 records.
totalPages
integerPages 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 CriminalRecordThis row's matched records.
proof
objectAlways {"status": "none"}.
proof.status
string
one of "none"
Always "none".
coverage
SearchCoverageCoverage for this row's state or county.
legal
LegalThe 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.app Not https://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 the X-API-Key header.
POST /v1/criminal/batch
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.

Create a test key under Dashboard → API keys. Live keys are refused here.
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" } ]'

Product overview