
Trulia.com Scraper
- epctex/trulia-scraper
- Modified
- Users 4
- Runs 247
- Created by
epctex
Scrape Trulia.com to crawl millions of real estate properties nationwide. Crawl real estate listings and extract descriptions, images, features, pricing, property details, neighborhood, nearby schools, and all other features. You can specify search terms, filters, and much more.
To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running Actors via the API in Apify Docs.
import { ApifyClient } from 'apify-client';
// Initialize the ApifyClient with API token
const client = new ApifyClient({
token: '<YOUR_API_TOKEN>',
});
// Prepare Actor input
const input = {
"startUrls": [
"https://www.trulia.com/p/ny/bronx/895-tiffany-st-bronx-ny-10459--2008893028",
"https://www.trulia.com/home/364-Ovington-Ave-Brooklyn-NY-11209-112508280",
"https://www.trulia.com/building/the-tides-at-arverne-by-the-sea-190-beach-69th-st-arverne-ny-11692-2355011519",
"https://www.trulia.com/sold/New_York,NY/",
"https://www.trulia.com/for_rent/New_York,NY/",
"https://www.trulia.com/for_sale/New_York,NY/p_oh/",
"https://www.trulia.com/for_sale/New_York,NY/2p_beds/50000p_price/APARTMENT,CONDO,COOP,SINGLE-FAMILY_HOME_type/fsbo_lt/"
],
"maxItems": 20,
"endPage": 1,
"extendOutputFunction": ($) => { return {} },
"customMapFunction": (object) => { return {...object} },
"proxy": {
"useApifyProxy": true
}
};
(async () => {
// Run the Actor and wait for it to finish
const run = await client.actor("epctex/trulia-scraper").call(input);
// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
console.dir(item);
});
})();