Skip to content

Types

property_radar.types

Shared public typing contracts for PropertyRadar requests and responses.

Criterion

Bases: _RequiredCriterion

A generic PropertyRadar criteria object.

Criterion-specific values evolve independently in the vendor catalog, so this type preserves that value while enforcing the stable object shape.

ResponseEnvelope

Bases: TypedDict

Stable fields shared by documented PropertyRadar response envelopes.

totalCost arrives as a decimal string, as a JSON integer (a live preview sends 0) or as a JSON number with a fraction or an exponent, which JSON decoding gives as a float. The typed parsers check each form, reject negative, non-finite and over-long values, and return a Decimal.

StatusLabelsResponse

Bases: TypedDict

Response shapes selected by the status-label Layout parameter.

ImportItem

Bases: TypedDict

One item accepted by the list import matching endpoint.

Transaction history

The transaction-history module exposes the immutable field contract, structured current-owner identity model, provider limitations, billing evidence, and strict parser. Package-root imports are supported for every public symbol.

property_radar.transaction_history

Immutable typed parsing for PropertyRadar transaction-history responses.

TRANSACTION_HISTORY_FIELDS: tuple[TransactionHistoryField, ...] = ('DocTypeUI', 'Status', 'Purpose', 'LoanPosition', 'DocNumber', 'RecDate', 'Grantor', 'Grantee', 'Amount', 'LTVorDown', 'hasDocumentImage', 'isFirstCurrentOwnerRecord', 'isParentType', 'DocumentID') module-attribute

Official ordered positive fields for properties.transactions.

PROPERTY_PERSON_IDENTITY_FIELDS: tuple[PropertyPersonIdentityField, ...] = ('RadarID', 'PersonKey', 'PersonType', 'FirstName', 'MiddleName', 'LastName', 'Suffix', 'EntityName', 'OwnershipRole') module-attribute

Official fields for the bounded property-current-owner composition.

TRANSACTION_HISTORY_CONTRACT = _freeze_mapping({None: _CONTRACT_FINGERPRINT_SOURCE, 'contract_fingerprint': _fingerprint_contract(_CONTRACT_FINGERPRINT_SOURCE)}) module-attribute

Deeply immutable official schema catalog and strict parser policy.

TransactionParty dataclass

One structured provider identity without invented name information.

aliases is None for the current provider contract because no alias field is documented. A tuple remains available for a future provider-supplied alias source without conflating unavailable with empty.

__post_init__() -> None

Reject mutable or malformed identity containers.

__repr__() -> str

Return metadata only, never names or provider identifiers.

TransactionBillingEvidence dataclass

Immutable billing evidence for one transaction-history response.

total_result_count is the provider totalResultCount when the response supplied it, and None otherwise. It is never less than result_count.

__post_init__() -> None

Reject mutable or contradictory manually constructed evidence.

__repr__() -> str

Return non-personal billing metadata without the request identifier.

TransactionHistoryRecord dataclass

One immutable transaction with opaque group displays.

The official endpoint does not expose individual party boundaries. grantors and grantees are therefore None for parsed provider records, while the exact scalar displays remain available separately. The tuple-capable fields allow future structured provider parties without constraining either side to zero-or-one.

__post_init__() -> None

Reject mutable party and field containers.

__repr__() -> str

Return shape metadata without record values or party names.

TransactionHistory dataclass

Immutable transactions, current-owner identities, and billing evidence.

current_owners is None when no property-person response was composed or when a property-person preview withheld the owners, an empty tuple when the provider returned no owners, and an ordered tuple otherwise. These identities are property-level evidence and are deliberately not attached to a particular transaction party.

records_withheld is True only for a preview response that reported a positive resultCount or totalResultCount but returned no rows. records is then empty and billing keeps the provider counts.

current_owners_withheld is True only when a property-person preview (property_persons_purchase_requested=False) reported a positive resultCount or totalResultCount but returned no people. current_owners is then None: the owners exist but were not returned. This mirrors the transactions preview rule and has not been probed live.

The computed :attr:truncated property reports a response that returned fewer rows than the provider total. A withheld preview is never truncated.

truncated: bool property

Return whether the provider reported more rows than it returned.

True when the rows were not withheld and :attr:total_result_count is greater than the number of returned records. A truncated history is partial: the provider can limit a response, for example to its default page size, while totalResultCount reports every match. The property is computed from the stored values and is not a field.

total_cost: Decimal property

Return the quoted or returned provider cost.

quantity_free_remaining: int | None property

Return preview-only free quantity when supplied.

result_count: int property

Return the provider result count.

total_result_count: int property

Return the provider total count, or result_count without one.

purchase_requested: bool | None property

Return the known request purchase flag, or None.

billing_status: TransactionBillingStatus property

Return preview, charged, or unknown request status.

currency: str | None property

Return provider currency, currently unavailable.

request_id: str | None property

Return a sanitized official request identifier when available.

__post_init__() -> None

Reject mutable containers and contradictory withheld evidence.

__repr__() -> str

Return aggregate metadata without licensed record values.

parse_transaction_history(envelope: Mapping[str, object], *, purchase_requested: bool | None = None, property_persons: Mapping[str, object] | None = None, radar_id: str | None = None, request_id: str | None = None, property_persons_purchase_requested: bool | None = None) -> TransactionHistory

Parse official transaction and optional property-person envelopes.

The parser never infers party boundaries from Grantor or Grantee. When property_persons is supplied, its ordered identities are exposed separately as current-owner evidence after every returned RadarID is checked against radar_id.

resultCount must equal the number of returned rows. One exception applies only when purchase_requested is exactly False: a preview may withhold its rows, so an empty results list with a positive resultCount or totalResultCount gives no records and records_withheld=True. The optional totalResultCount must be an exact nonnegative integer that is not less than resultCount. When it is greater than the number of returned rows and the rows were not withheld, :attr:TransactionHistory.truncated is True: the history is partial.

The property-person response follows the same count rules. It may carry resultCount and totalResultCount, and each count that is present must equal the number of returned people, with one exception. When property_persons_purchase_requested is exactly False and the response has no people, a positive count means that the preview withheld the owners: current_owners is None and current_owners_withheld is True. Counts that are all 0 give no owners, and such a preview without any count fails closed. This mirrors the transactions preview rule and has not been probed live.

Parameters:

Name Type Description Default
envelope Mapping[str, object]

Decoded JSON returned by properties.transactions when requesting :data:TRANSACTION_HISTORY_FIELDS.

required
purchase_requested bool | None

The request's exact Purchase choice. Use None for a detached response whose request context is unknown.

None
property_persons Mapping[str, object] | None

Optional decoded response from properties.persons using :data:PROPERTY_PERSON_IDENTITY_FIELDS.

None
radar_id str | None

Exact property identifier used for both requests. Required when property_persons is supplied.

None
request_id str | None

Official correlation identifier when a success response source supplies one. Unsafe shapes are discarded.

None
property_persons_purchase_requested bool | None

The Purchase choice of the properties.persons request, exactly True or False. Use None (the default) when it is unknown; the count rules then apply without the preview exception. It may be set only together with property_persons.

None

Returns:

Type Description
TransactionHistory

Immutable transaction records, optional ordered current-owner

TransactionHistory

identities, and typed billing evidence.

Raises:

Type Description
InvalidResponseError

If either envelope violates the bound contract, or if property_persons_purchase_requested is not None or a boolean, or is set without property_persons.

Buyer-transfer match

The buyer-transfer module exposes a fixed request scope, immutable property/location and broad property-type evidence, explicit provider limitations, billing evidence, and a strict zero-or-one parser.

property_radar.buyer_transfer

Typed buyer/grantee search linkage with immutable property location.

Only a non-billable Purchase=0 preview carries the residential PropertyType criterion. That criterion follows the official API reference and has not been live-probed on Purchase=0. A preview's matched=False also covers a non-residential or Unknown transfer that the provider dropped under the criterion. A paid Purchase=1 request carries no PropertyType criterion, and a paid result classifies the property from the returned PType.

BUYER_TRANSFER_PROPERTY_FIELDS: tuple[BuyerTransferPropertyField, ...] = ('RadarID', 'PType', 'Address', 'City', 'State', 'ZipFive', 'County', 'FIPS', 'APN', 'Latitude', 'Longitude') module-attribute

Ordered public fields requested for one purchased buyer-transfer match.

BUYER_TRANSFER_PREVIEW_FIELDS: tuple[BuyerTransferPropertyField, ...] = ('RadarID',) module-attribute

Fields requested by a non-billable Purchase=0 buyer-transfer preview.

RadarID is the only free field of a Purchase=0 property search. Requesting any other field of BUYER_TRANSFER_PROPERTY_FIELDS makes the preview return no record.

BUYER_TRANSFER_RESIDENTIAL_PTYPE_CODES: tuple[str, ...] = ('SFR', 'CND', 'MFR', 'APT', 'RES') module-attribute

Official PType codes of the PropertyType criterion on every preview request.

The codes map, in order, to the residential response PType names Single Family, Condominium, Multi-Family 2-4, Multi-Family 5+ and Other Res. A paid Purchase=1 request carries no PropertyType criterion.

BUYER_TRANSFER_MATCH_CONTRACT = _freeze_mapping({None: _CONTRACT_FINGERPRINT_SOURCE, 'contract_fingerprint': _fingerprint_payload(_CONTRACT_FINGERPRINT_SOURCE)}) module-attribute

Deeply immutable buyer-transfer linkage and parser contract.

BUYER_TRANSFER_HISTORICAL_MATCH_CONTRACT = _freeze_mapping({None: _HISTORICAL_CONTRACT_FINGERPRINT_SOURCE, 'contract_fingerprint': _fingerprint_payload(_HISTORICAL_CONTRACT_FINGERPRINT_SOURCE)}) module-attribute

Versioned historical request and strict API 5.3.1.0 response contract.

BuyerTransferRecordingDateRange dataclass

An inclusive finite recording-date range subject to caller authorization.

__post_init__() -> None

Reject open, non-date, and reversed ranges.

__repr__() -> str

Describe the range without exposing recording dates.

BuyerTransferMatchCriteria dataclass

Bounded criteria for linking one buyer/grantee query to one property.

__post_init__() -> None

Validate exact caller-normalized criteria and bounded windows.

__repr__() -> str

Return query-shape metadata without names or property identity.

BuyerTransferProperty dataclass

One immutable property identity and location returned for the match.

is_residential: bool | None property

Classify residential use from PType or the preview's type criterion.

A preview record matched under the residential PropertyType criterion without a returned PType is residential. That criterion follows the official API reference and has not been live-probed on Purchase=0, and a preview's matched=False also covers a non-residential or Unknown transfer that the provider dropped under it. A paid or unknown result classifies the property from the returned PType: the documented broad property type decides, and Unknown or a missing PType stays unknown.

__post_init__() -> None

Validate immutable field order and documented primitive shapes.

__repr__() -> str

Return completeness metadata without property values.

BuyerTransferLinkage dataclass

Provider evidence that one Buyer criterion returned one property.

__post_init__() -> None

Validate scope identity and explicit unavailable linkage fields.

__repr__() -> str

Return linkage shape without identity or fingerprint values.

BuyerTransferBillingEvidence dataclass

Immutable billing evidence for one exact buyer-transfer search.

__post_init__() -> None

Validate billing state and exact-target result cardinality.

In a preview, result_count counts purchased rows (zero, or the returned record) while total_result_count counts matches. Charged and unknown evidence keeps both counts equal.

__repr__() -> str

Return non-personal billing metadata.

BuyerTransferResponseError

Bases: InvalidResponseError

A rejected buyer-transfer record with valid, privacy-safe billing data.

Both buyer-transfer parsers raise it for every rejection of the returned record. They validate the envelope, the counts and totalCost first, so billing_evidence keeps the cost and counts of a charged request. The message holds only the reason code. The error pickles and copies with its billing evidence.

__init__(message: str, *, billing_evidence: BuyerTransferBillingEvidence) -> None

Attach immutable billing evidence without retaining the response.

__reduce__() -> tuple[Any, ...]

Rebuild through __init__ with the same billing evidence and state.

BuyerTransferMatchResult dataclass

One exact buyer/grantee criterion outcome and its billing evidence.

A preview's matched=False also covers a non-residential or Unknown transfer that the provider dropped under the preview's residential PropertyType criterion. That criterion follows the official API reference and has not been live-probed on Purchase=0. A paid result classifies the property from the returned PType.

matched: bool property

Return whether the provider linked the Buyer criterion to a property.

__post_init__() -> None

Bind the linkage and billing evidence to one public contract.

__repr__() -> str

Return outcome metadata without provider or person values.

build_buyer_transfer_match_criteria(criteria: BuyerTransferMatchCriteria, *, preview: bool = False) -> tuple[Criterion, ...]

Build the exact public PropertyRadar criteria for one property match.

The default builds the criteria of a paid Purchase=1 request, the 0.4.1 list with the exact RadarID criterion last. A paid result classifies the property from the returned PType.

With preview=True the non-billable Purchase=0 preview also restricts the match to residential property types with the official PropertyType criterion, placed just before RadarID, which stays last. That criterion follows the official API reference and has not been live-probed on Purchase=0. So a preview's matched=False also covers a non-residential or Unknown transfer that the provider dropped under it.

Raises:

Type Description
TypeError

If criteria is not BuyerTransferMatchCriteria or preview is not exactly a boolean.

buyer_transfer_scope_fingerprint(criteria: BuyerTransferMatchCriteria) -> str

Return a stable digest of the exact bounded request scope.

The digest binds the paid request's criteria, the preview's PropertyType criterion under a key of its own and both constant field sets, so the preview and the purchased parse of the same criteria share one value.

parse_buyer_transfer_match(envelope: Mapping[str, object], *, criteria: BuyerTransferMatchCriteria, purchase_requested: bool | None = None) -> BuyerTransferMatchResult

Parse one exact Buyer-criterion property-search response.

The linkage means only that PropertyRadar returned the exact property for its documented Buyer Name (Grantee) criterion and the supplied bounded windows. It does not invent a transaction identifier, exact-name matching semantics, or party boundaries.

With purchase_requested=False the parser also accepts the provider's bare zero-hit preview {"results": []} and preview counts, where resultCount counts purchased rows and totalResultCount counts matches. Charged and unknown parses keep the exact count rule.

A preview carries the residential PropertyType criterion, which follows the official API reference and has not been live-probed on Purchase=0. A returned preview PType must be residential, and a preview's matched=False also covers a non-residential or Unknown transfer that the provider dropped under the criterion. A paid or unknown parse classifies the property from the returned PType alone.

Raises:

Type Description
BuyerTransferResponseError

If the returned record is rejected after the envelope, the counts and totalCost were validated. Its billing_evidence carries that cost and those counts.

InvalidResponseError

If any earlier part of the response or an argument violates the contract.