Key facts
- Search endpoint:
POST https://api.datafiniti.co/v4/properties/searchwith bearer-token auth. transactionsis a nested list of completed sales. Its entries includesaleDate,price, anddocumentType.- Filter for sold properties with
transactions.price:*and a date range such astransactions.saleDate:[2026-05-18 TO *]. - Datafiniti's docs say transaction records are typically available within 2 weeks after a property is marked as sold.
- A search without a download returns at most 10 records. Credits are charged per record returned, and 0 records cost nothing.
- Larger pulls use
"download": true, thenGET /v4/downloads/{id}until the status is "completed".
Datafiniti is a data-as-a-service provider that offers Property, People, Business, and Product data through a REST API, bulk downloads, and an MCP server. This guide covers one job: finding recent comparable sales for a property and turning them into a value range your product can show.
Who needs sales comps from an API?
- Proptech and listing products that show "recent sales nearby" or a price range on a property page.
- Investors and iBuyers screening deals before they order an appraisal or inspection.
- Lenders and underwriters sanity-checking a purchase price or an automated valuation.
- Agents' CMA tools that need sold prices outside a single MLS.
- AI agents that answer "what did similar homes near this address sell for?" and need sources they can cite.
Why are sales comps hard to build yourself?
A comp is a simple idea: similar homes, nearby, sold recently. Each part of that sentence is a data problem.
- Sales are recorded county by county. Deed records sit in thousands of county systems with different formats, fees, and update schedules.
- Not every recorded document is a sale. Deeds of trust, quit claims, and intrafamily transfers sit next to arm's-length sales. Mix them in and your median drops.
- Sales have to be joined to property facts. A deed rarely carries bedrooms, square footage, or year built. You need a property record to match it to.
- Listing data alone misses sales. Sold prices scraped from listing sites cover only homes that were listed online.
- Freshness matters. A comp set that is six months stale in a moving market gives a confident wrong answer.
What fields do you use for sales comps?
| Field | Type | What it tells you |
|---|---|---|
transactions | nested | List of transactional data after a sale is completed |
transactions.saleDate | date (example value) | When the sale happened |
transactions.price | number (example value) | Recorded sale price |
transactions.documentType | text | Recorded document, such as "Warranty Deed", "Quit Claim", or "Deed of Trust" |
transactions.type | text | Transaction type; the docs give "NHO" (new home owner) and "REFI" (refinance) as examples |
mostRecentSoldPriceAmount, mostRecentSoldPriceDate | float, date | The most recent "sale" price from the prices field, a listing-sourced cross-check |
propertyType | text | Property classification, such as "Single Family Dwelling" or "Condo" |
numBedroom, numBathroom | integer, float | Room counts for similarity |
floorSizeValue, floorSizeUnit | float, keyword | Living area and its unit, such as "sq ft" |
lotSizeValue, lotSizeUnit | integer, keyword | Lot size and its unit |
yearBuilt | integer | Year the property was built |
latitude, longitude | text | Coordinates for distance |
geoLocation | geo_shape | Coordinates for radius queries |
postalCode, city, province, country | keyword, text | Top-level location fields for filtering |
parcelNumbers | nested | Parcel numbers (number, account, year) for joining to your own records |
Transaction entries also carry buyer, seller, and lender names and loan details. You don't need any of them to compute comps, so drop them before you store or display results.
A trimmed record looks like this (fictional example data; name fields omitted):
How do I pull comps step by step?
Step 1: Define the comp area and size it
Start with the subject property's area and type. Use top-level location fields, a bedroom range, and a six-month sale window computed from today. Wrap the ZIP list in parentheses.
Check the size before you pay for records. The MCP tool df_count is free. Over REST, send "num_records": 1 and read num_found; that costs at most 1 credit.
If you have the subject's coordinates, Datafiniti's query syntax also supports a radius: geoLocation:[-80.8052,35.2101,1,mi] (longitude, latitude, distance, unit).
Step 2: Look at one record
Read one record before writing ranking code. Check which documentType values your county uses and whether floorSizeValue is populated.
Replace the date with one 180 days before today.
Step 3: Download the comp pool and keep qualifying sales
Searches without a download return at most 10 records, so pull the pool as a download. Set num_records to cap spend; you're charged for the records you download. The script keeps each property's latest sale inside the window, skips non-sale documents and refinances, and writes one row per comp.
The query matches properties that have a price and a sale date in the window. Those two conditions can come from different transactions, so the script re-checks the date and price on each entry.
Step 4: Rank comps against the subject and estimate a range
Score each comp on size, rooms, age, and distance, keep the closest six, and apply their price per square foot to the subject.
The weights are a starting point. Size and distance usually matter most; tune them against sales you already know.
Step 5: Put the comps to work
- Property pages: show the top comps with sale date, price, and distance, plus the middle price range.
- Deal screening: flag listings priced well above the comp range before anyone opens a spreadsheet.
- Underwriting checks: compare a contract price or automated value against comps and route outliers to review.
- Market pages: rerun weekly by ZIP code and publish median price per square foot with the sale count.
To catch new sales as they happen, see How to track property status changes with an API. To run comps for a list of your own addresses, start with How to match an address list to property records.
Can an AI agent pull sales comps?
Yes, for one-off lookups. Connect an MCP client to https://api.datafiniti.co/v4/mcp (Streamable HTTP) with your API token as a bearer header:
Use "data_type": "property" with df_count (free) to size the query and df_search (up to 50 records per call, charged like REST search) to read candidates. df_get_schema (free) lists field names. For a full pool, use df_start_download and df_download_status. Download result links are valid for 7 days.
Example prompt:
Using Datafiniti property data, find single-family homes in Charlotte, NC ZIP codes 28205 and 28209 with 3 to 4 bedrooms and a transaction sale date after May 18, 2026. Pull 20 of them. For each, take the latest sale with a price over $10,000 that isn't a quit claim or deed of trust, and compute price per square foot. Then list the six most similar to a 3-bed, 2-bath, 1,850 sq ft home built in 1998, and give me the median price per square foot. Don't include buyer or seller names.
What are the common gotchas?
- Filter per transaction, not per record.
transactions.price:* AND transactions.saleDate:[...]can match two different entries. Datafiniti's query docs put conditions for one sub-object inside curly brackets, as in{ brokers.emails:* AND brokers.phones:* }; test that form ontransactionsbefore relying on it, and re-check in code either way. - Not every document is a sale.
documentTypeincludes values such as "Quit Claim", "Deed of Trust", "Loan Modification", and "Intrafamily Transfer And Dissolution". Exclude them, and drop very low prices. - Refinances live in the same list. The docs show
transactions.typevalues such as "REFI". Skip them. - Property facts are current, not as of the sale.
floorSizeValueandnumBathroomdescribe the record now. A home renovated after it sold can look more valuable per square foot than it was. - Two kinds of sold price.
transactions.priceis the recorded sale.mostRecentSoldPriceAmountcomes from listing prices. Use the transaction for comps and the listing price as a cross-check. - Some markets will be thin. Some states don't put sale prices in public records. Check
num_foundper market before you promise coverage. - Recent sales lag. Datafiniti's docs say transaction records typically arrive within 2 weeks after a property is marked sold, so the last few weeks will be incomplete.
- Parenthesize OR groups. Write
postalCode:(28205 OR 28209). Without parentheses, ANDs and ORs combine in ways you didn't intend. - Use
statusHistory, notstatuses. If you also check listing status,statusesis deprecated.
Should you build, license, or buy sales data?
| Collect county records yourself | License a primary source (MLS/BBO feeds, county record vendors) | Datafiniti Property Data | |
|---|---|---|---|
| Suited to | A few counties | Markets where you hold a feed agreement | Many markets from one API |
| Property facts | You match deeds to property records | Depends on the feed | Transactions and property facts on one record |
| Non-sale documents | You classify every document | Depends on the feed | documentType and transactions.type to filter on |
| Ongoing work | Per-county collection and parsing | Contracts and per-feed integration | Query upkeep and your own ranking |
| Choose it when | Your scope is a handful of counties | You need contractual rights, MLS-only fields, or concessions | You want recorded sales joined to property facts without running collection |
Datafiniti isn't the right fit for every valuation job. A lending decision that requires an appraisal still needs a licensed appraiser. If you need MLS-only details such as seller concessions or days on market for every sale, a licensed MLS feed is the better source. And in markets where sale prices aren't public, any transaction-based comp set will be thin.
Frequently asked questions
What API can I use to get sold prices for comps?
Datafiniti Property Data. Search POST /v4/properties/search with a location plus transactions.price:* and a transactions.saleDate range, and read saleDate, price, and documentType from each record's transactions list.
How do I find homes that sold in the last six months?
Add a date range on transactions.saleDate, such as transactions.saleDate:[2026-05-18 TO *], to a location query. Compute the start date from today in your code.
How do I choose which comps are most similar?
Filter by propertyType and a numBedroom range in the query, then score candidates on square footage, bathrooms, yearBuilt, and distance. Keep the closest few and use the median price per square foot.
How fresh is the sales data?
Datafiniti's docs say homeowner contact details and transaction records are typically available within 2 weeks after a property is marked as sold.
Can I search for comps within a radius?
Yes. Datafiniti's query syntax supports geoLocation:[longitude,latitude,distance,unit], for example geoLocation:[-80.8052,35.2101,1,mi].
How much does it cost to pull comps?
Property searches charge credits per record returned, and nothing when 0 records are found. Size the query first with the free MCP tool df_count, then cap a download with num_records.
Pull your first comp set
Pull comps for one ZIP code with a free trial, or talk to us about volume and delivery.