SERP API
ForSaleByOwner
The same /v1/search endpoint with engine=forsalebyowner returns the homes owners list themselves on ForSaleByOwner as JSON: for sale or sold, for a US city or a whole state, 50 a page.
Send the API key in the X-API-Key header, or as the api_key query parameter (Authentication). ForSaleByOwner searches can also run as async tasks with pingback_url.
Parameters
| Field | Type | Description |
|---|---|---|
engine | string | required Set it to forsalebyowner.Values:forsalebyowner |
q | string | required The place: a US city and state (Houston, TX) or a state by its name (texas). Up to 120 characters. location works too.Example: Houston, TX |
type | string | optional Homes for sale, or sold. status works too. Any other value answers 400 invalid_type.Values:for_salesoldDefault: for_sale |
page | integer | optional The page of listings, from 1 to 30: ForSaleByOwner answers no deeper (1,500 homes a search). Each page has up to 50; search_information.total_pages says how many there are.Default: 1 |
num_pages | integer | optional How many pages to fetch in this call, from 1 to 5, starting at page. Each page fetched costs one credit; page + num_pages - 1 can be at most 30.Default: 1 |
sort | string | optional The order of the homes in this call (all its pages together). newest and oldest follow listing_date. Left out: ForSaleByOwner's own order.Values:price_ascprice_descnewestoldest |
response_type | string | optional json: the listings. html: ForSaleByOwner's raw answer for the fetched pages as text in html, without listings. both: the listings and html.Values:jsonhtmlbothDefault: json |
pingback_url | string | optional Queue the search and get the answer later; see Async tasks. |
Several pages in one call
One call fetches 1 to 5 pages (
num_pages) starting at page, 50 listings each. A state can hold more homes than page 30 reaches: search its cities one by one for the rest.What comes back
| Field | Type | Description |
|---|---|---|
search_metadata | object | About this request. |
id | string | A unique id for the search. |
status | string | Success when ForSaleByOwner answered. |
created_at | string | When the search ran, in ISO 8601 (UTC). |
pages | integer | Pages fetched in this call. |
credits_charged | integer | Credits this request cost: one per page fetched. |
task_id | string | Only for async tasks: the task the result belongs to. |
search_parameters | object | What the search used: engine, q, type, page, num_pages (when above 1), sort (when given) and response_type. |
search_information | object | About the listings. |
total_results | integer | How many homes match the place and type. |
page, per_page, total_pages | integer | This page, listings a page (50) and the pages you can ask for (up to 30, even when more homes match). |
pages_fetched | integer | Pages this call fetched. |
results_on_page | integer | How many listings this answer has (all fetched pages). |
listings | array | The homes, each with position (1, 2, 3... counted across pages, so page 2 starts at 51) and the fields below. |
property_id, source_key, mls_number, source | string | ForSaleByOwner's id for the listing, its source key, the MLS number when there is one, and where the listing comes from. |
url | string | The listing on ForSaleByOwner. |
street_address, city, state, zipcode, county, country, neighborhood | string | Where the home is: street, city, two-letter state, ZIP code, county, country (always US) and neighborhood. |
latitude, longitude | number | The home on the map. |
price, currency | integer / string | The asking price in whole US dollars; currency is always USD. |
bedrooms, bathrooms | number | Bedrooms and bathrooms (0 for land). |
living_area, living_area_unit | integer / string | The home's size, in sqft. |
lot_size, lot_size_type | number / string | The lot's size and its unit as the site gives it (sqFootage or acres), when listed. |
property_type, property_sub_type, source_property_type | string | The kind of home (House, Multi-Family, Land...) and the source's own types. |
year_built, stories | integer | The year it was built and its floors (0 when the listing does not say). |
listing_status, source_status | string | The listing's status (Active...) on ForSaleByOwner and at its source. |
is_new_construction, is_price_reduced, is_under_contract | boolean | Flags on the listing. |
image_url, photo_count, virtual_tour_url | string / integer | The main photo, how many photos there are, and a virtual tour link when there is one. |
description | string | The listing's text, up to 500 characters. |
owner_name, brokerage_name | string | The seller's contact name and the name shown as the seller, as the owner wrote them. |
listing_date, activated_date, updated_date | string | When the home was listed, went live and last changed. |
pool, fireplace, fenced_yard | boolean | Present when the listing says so. |
sold_date | string | type=sold only: the date the home sold. |
html | string | response_type html or both: ForSaleByOwner's raw answer for the fetched pages, as text. |
Sold homes in a whole state, second page
Request
curl -G "https://api.scraperdata.com/v1/search" \
-H "X-API-Key: YOUR_API_KEY" \
--data-urlencode "engine=forsalebyowner" \
--data-urlencode "q=texas" \
--data-urlencode "type=sold" \
--data-urlencode "page=2"Errors
Errors never cost credits. Every error code is on the Errors page; these are the ForSaleByOwner ones:
| Field | Type | Description |
|---|---|---|
missing_query, invalid_query | 400 | No q, or one longer than 120 characters. |
invalid_type | 400 | type (or status) is not for_sale or sold. |
invalid_page | 400 | page is not a whole number from 1 to 30. |
invalid_num_pages | 400 | num_pages is not 1 to 5, or page + num_pages - 1 goes past page 30. |
invalid_sort | 400 | sort is not price_asc, price_desc, newest or oldest. |
invalid_filter | 400 | bedrooms, min_price or max_price was sent: ForSaleByOwner searches do not take them. |
invalid_response_type | 400 | response_type is not json, html or both. |
no_results | 404 | ForSaleByOwner does not know the place, has no homes there, or the page is past the last one. Check the city and state. |
upstream_error, upstream_unavailable, upstream_timeout | 502 / 503 / 504 | ForSaleByOwner could not be reached in time. Retry in a few seconds. |
404 Not Found
{
"error": {
"code": "no_results",
"message": "ForSaleByOwner has no listings for this place. Check the spelling of the place (like Austin, TX). You were not charged."
},
"charged": false
}Credits
Each page fetched costs one credit (50 listings a page, up to 5 pages a call). Failed searches, places with no listings and pages past the last one are free.