Redfin Scraper with Contacts | Enterprise Grade avatar

Redfin Scraper with Contacts | Enterprise Grade

Pricing

from $0.70 / 1,000 property listings

Go to Apify Store
Redfin Scraper with Contacts | Enterprise Grade

Redfin Scraper with Contacts | Enterprise Grade

Extract Redfin listings at scale with deep property detail, sold comps, rental data, agents, valuation signals, parcel history, schools, climate risks, and rich media. Built for enterprise-grade real estate intelligence, market monitoring, and automated analytics pipelines.

Pricing

from $0.70 / 1,000 property listings

Rating

5.0

(1)

Developer

Fatih Tahta

Fatih Tahta

Maintained by Community

Actor stats

2

Bookmarked

3

Total users

2

Monthly active users

5 days ago

Last modified

Share

Redfin Scraper | All-In-One

Slug: fatihtahta/redfin-scraper

Overview

Redfin Scraper | All-In-One collects structured Redfin listing intelligence, including for-sale homes, rental listings, sold comparables, prices, property facts, listing status, location details, media metadata, agents, amenities, history, valuation signals, parcel context, schools, and climate-related attributes when available. Redfin is a major residential real estate marketplace, and its public listing data is useful for market analysis, inventory monitoring, acquisition research, rental screening, and comparable-sales workflows. The actor converts public listing pages and market searches into repeatable JSON records that can be used in analytics tools, data warehouses, CRMs, and operational reporting systems. It is designed for consistent recurring data acquisition, with configurable geography, transaction type, filters, output volume, and optional detail enrichment. Use it when you need structured, automation-ready Redfin data without manually copying listing information into spreadsheets or internal systems.

Why Use This Actor

  • Market research and analytics teams: collect normalized listing, pricing, location, amenity, and comparable-sale data for market intelligence, underwriting, and trend analysis.
  • Product and content teams: populate internal tools, maps, directories, market pages, and editorial datasets with structured public real estate attributes.
  • Developers and data engineering teams: feed repeatable collection jobs into downstream systems, ETL pipelines, warehouses, search indexes, and monitoring workflows.
  • Lead generation and enrichment teams: build targeted property, owner-adjacent, broker, listing, and agent-context datasets for qualification and enrichment pipelines.
  • Monitoring and competitive tracking teams: schedule recurring runs to watch inventory movement, price changes, listing freshness, sale status, and geographic coverage.

Common Use Cases

  • Market intelligence: monitor active supply, sold comparables, rental availability, pricing bands, lot sizes, property types, and neighborhood signals.
  • Lead generation: build targeted prospect lists from public listings using location, price, asset profile, listing status, keyword, and amenity filters.
  • Competitive monitoring: track changes across markets, listing categories, price segments, new construction, foreclosure inventory, or Redfin-only listings.
  • Catalog and directory building: populate internal property databases with structured public listing records and consistent identifiers.
  • Data enrichment: add current public listing, valuation, school, climate, parcel, media, and agent attributes to CRM, BI, or analytics datasets.
  • Recurring reporting: schedule periodic runs for dashboards, alerts, underwriting queues, market briefs, and trend analysis.

Quick Start

  1. Choose the listing mode with deal_type: buy, rent, or sold.
  2. Enter one or more supported Redfin location values, such as city plus state, ZIP code, neighborhood, county, or market name. State-wide searches are not supported.
  3. Add only the filters needed for the first validation run, such as price range, bedrooms, property type, listing freshness, or sale status.
  4. Set a small limit to confirm that the dataset shape matches your use case.
  5. Run the actor in Apify Console and inspect the first dataset records.
  6. Increase coverage, enable enrich_data, add filters, or schedule recurring runs after the output is validated.

Input Parameters

The actor accepts one required geography list and optional controls for listing mode, price, size, property type, amenities, freshness, ownership costs, output volume, and enrichment.

ParameterTypeDescriptionDefault
locationarray of stringsRequired. One or more city plus state, ZIP code, neighborhood, county, or market name values, for example Austin, TX, 90210, Brooklyn Heights, NY, or Orange County, CA. State-wide searches such as California are not supported.
deal_typestringListing mode. Allowed values: buy, rent, sold.buy
sale_statusarray of stringsFor-sale listing statuses to include. Allowed values: coming_soon, active, under_contract.["coming_soon", "active"]
sold_date_rangestringSold-comparable lookback window. Used only when deal_type is sold; ignored for buy and rent. Allowed values: last_1_week, last_1_month, last_3_months, last_6_months, last_1_year, last_2_years, last_3_years, last_5_years.last_3_months
min_priceintegerMinimum listing price in USD.
max_priceintegerMaximum listing price in USD.
min_bedroomstringMinimum bedroom count. Allowed values: Studio, 1, 2, 3, 4, 5+.
max_bedroomstringMaximum bedroom count. Allowed values: Studio, 1, 2, 3, 4, 5+.
min_bathroomstringMinimum bathroom count. Allowed values: 1+, 1.5+, 2+, 2.5+, 3+, 4+.
min_parkingstringMinimum parking spaces. Allowed values: 1+, 2+, 3+, 4+, 5+.
include_outdoor_parkingbooleanWhether outdoor parking should count toward the parking requirement.false
min_building_areaintegerMinimum interior area in square feet.
max_building_areaintegerMaximum interior area in square feet.
min_land_areastringMinimum lot size. Allowed values: no_min, 2000_sqft, 4500_sqft, 6500_sqft, 8000_sqft, 9500_sqft, 0.25_acres, 0.5_acres, 1_acres, 2_acres, 3_acres, 4_acres, 5_acres, 10_acres, 20_acres, 40_acres, 100_acres.no_min
max_land_areastringMaximum lot size. Allowed values: no_min, 2000_sqft, 4500_sqft, 6500_sqft, 8000_sqft, 9500_sqft, 0.25_acres, 0.5_acres, 1_acres, 2_acres, 3_acres, 4_acres, 5_acres, 10_acres, 20_acres, 40_acres, 100_acres.no_min
min_building_yearstringEarliest acceptable year built. Allowed values: 2026, 2025, 2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2010, 2005, 2000, 1990, 1980, 1970, 1960, 1950, 1940, 1920, 1900.
max_building_yearstringLatest acceptable year built. Allowed values: 2026, 2025, 2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2010, 2005, 2000, 1990, 1980, 1970, 1960, 1950, 1940, 1920, 1900.
min_storiesstringMinimum story count. Allowed values: 1, 2, 3, 4, 5, 10, 15, 20.
max_storiesstringMaximum story count. Allowed values: 1, 2, 3, 4, 5, 10, 15, 20.
property_typearray of stringsProperty classes to include. Allowed values: house, townhouse, condo, land, multi_family, mobile, co_op, other.
poolstringPool preference. Allowed values: private_pool, community_pool, private_or_community_pool, no_private_pool.
tour_optionsarray of stringsTour and open-house requirements. Allowed values: open_house_this_weekend, open_house_anytime, 3d_tour.
publication_datestringTime-on-market window. Allowed values: last_24_hours, last_3_days, last_7_days, last_14_days, last_30_days, over_7_days, over_14_days, over_30_days, over_45_days, over_60_days, over_90_days, over_180_days.
keywordstringText to search for in listing remarks, such as ADU, waterfront, fixer, or seller credit.
listing_typearray of stringsFor-sale listing categories. Allowed values: by_agent, foreclosures, by_owner, exclude_short_sales, new_construction, redfin_listings_only.["by_agent", "foreclosures", "by_owner", "new_construction"]
amenitiesarray of stringsHome-feature requirements. Allowed values: air_conditioning, basement_finished, basement_unfinished, waterfront, washer_dryer_hookup, has_view, pets_allowed, fireplace, primary_bedroom_on_main_floor, fixer_upper, rv_parking, guest_house, green_home, elevator, accessible_home.
min_walk_scoreintegerMinimum Walk Score from 1 to 100.
min_transit_scoreintegerMinimum Transit Score from 1 to 100.
min_bike_scoreintegerMinimum Bike Score from 1 to 100.
min_greatschools_scoreintegerMinimum GreatSchools rating from 1 to 10.
max_hoa_feestringMaximum monthly HOA fee in USD. Allowed values: no_fee, 25, 50, 75, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000, 1250, 1500, 1750, 2000, 2500, 3000, 3500, 4000, 4500, 5000.
max_property_taxstringMaximum annual property tax in USD. Allowed values: no_tax, 250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 8000, 10000, 12000, 14000, 16000, 20000, 24000.
enrich_databooleanCollect richer listing details when available, including remarks, amenities, schools, neighborhood scores, climate context, parcel metadata, valuation signals, and summaries.true
limitintegerMaximum number of listings to save. Minimum: 1. Leave empty when completeness is more important than a predictable output size.

Choosing Inputs

Start with deal_type and location; together they define the baseline listing universe. Add multiple locations when you want the same mode and filters applied across several markets in one run. Use narrower filters such as property_type, price range, bedroom count, lot size, listing freshness, sale status, amenities, and score thresholds when you need a targeted dataset. Leave optional filters empty when the goal is discovery or market coverage. Use limit for validation and sampling first, then increase it after confirming that the output quality and field coverage match your workflow. Enable enrich_data when downstream systems need a fuller diligence record rather than a lightweight search-result export.

Example Inputs

Active for-sale inventory sample

{
"deal_type": "buy",
"location": ["Chicago, IL"],
"sale_status": ["active"],
"property_type": ["house", "townhouse"],
"min_price": 250000,
"max_price": 750000,
"limit": 25
}

Rental supply monitor

{
"deal_type": "rent",
"location": ["Austin, TX", "Dallas, TX"],
"min_bedroom": "2",
"max_price": 3500,
"tour_options": ["3d_tour"],
"limit": 30
}

Recently listed comp-focused run

{
"deal_type": "buy",
"location": ["90210"],
"publication_date": "last_7_days",
"property_type": ["condo"],
"min_bathroom": "2+",
"enrich_data": true,
"limit": 15
}

Output

Output destination

The actor writes normalized Redfin records to the default Apify dataset. Current public rows use one record family: property_listing.

Record envelope and stable identifiers

Each dataset item represents one public Redfin property listing, rental listing, or sold comparable. Use record_id as the primary idempotency key. If a downstream system needs source-specific keys, use entity.external_ids.listing_id, entity.external_ids.property_id, entity.external_ids.rental_id, or entity.url as fallbacks.

source_context preserves provenance: the Redfin source, source/search URL, listing URL when available, resolved location, page index, and search filters used for the row.

Example: Redfin property listing record

{
"record_type": "property_listing",
"record_id": "215957479",
"source_context": {
"fingerprint": "f3c6c5e5f80f60b3708c",
"source_name": "Redfin",
"source_domain": "www.redfin.com",
"source_url": "https://www.redfin.com/stingray/api/gis?region_id=29470&region_type=6&page_number=1&status=1",
"detail_url": "https://www.redfin.com/IL/Harwood-Heights/6602-W-Montrose-Ave-60706/home/13471557",
"listing_url": "https://www.redfin.com/IL/Harwood-Heights/6602-W-Montrose-Ave-60706/home/13471557",
"seed_id": "37324f8303afa29e0bc0",
"seed_type": "search",
"seed_value": "Chicago, IL",
"resolved_location": "Chicago",
"resolved_location_url": "https://www.redfin.com/city/29470/IL/Chicago",
"page_index": 1,
"search": {
"deal_type": "buy",
"sale_status": ["active"],
"sort_by": "recommended",
"listing_type": ["by_agent", "foreclosures", "by_owner", "new_construction"]
}
},
"entity": {
"title": "6602 W Montrose Ave Harwood Heights IL 60706",
"url": "https://www.redfin.com/IL/Harwood-Heights/6602-W-Montrose-Ave-60706/home/13471557",
"status": "Active",
"external_ids": {
"property_id": "13471557",
"listing_id": "215957479",
"mls_id": "12656480",
"data_source_id": "68",
"market_id": "6",
"business_market_id": "12",
"fips": "17031",
"apn": "13184040130000"
}
},
"listing": {
"deal_type": "buy",
"mls_status": "Active",
"search_status_id": 1,
"property_status": {
"display_value": "Active",
"definition": "This listing is for sale and the sellers are accepting offers."
},
"description": {
"listing_remarks": "Charming and updated Cape Cod-style home with hardwood floors, a newer kitchen, and a detached 2-car garage.",
"ai_summary": "Cape Cod-style home with updated interiors, private patio, and convenient transit access.",
"short_description": "Charming and updated Cape Cod-style home with hardwood floors..."
}
},
"pricing": {
"price": 395000,
"sold_price": 77500,
"price_per_sqft": 294,
"hide_sale_price": false,
"is_hoa_frequency_known": true,
"price_info": {
"amount": 395000,
"label": "Price",
"display_level": 1,
"data_source_id": 68
}
},
"location": {
"address": "6602 W Montrose Ave, Harwood Heights, IL 60706",
"street": "6602 W Montrose Ave",
"city": "Harwood Heights",
"state": "IL",
"postal_code": "60706",
"country_code": "US",
"area": "Harwood Heights",
"coordinates": {
"latitude": 41.960325,
"longitude": -87.7919485
},
"show_address_on_map": true,
"timezone": "US/Central"
},
"property": {
"beds": 3,
"baths": 2,
"full_baths": 2,
"stories": 1,
"sqft": 1343,
"garage_spaces": 2,
"parking_spaces": 2,
"public_facts": {
"property_type_name": "Single Family Residential",
"year_built": 1939,
"lot_sq_ft": 2500,
"apn": "13184040130000"
},
"key_facts": ["Newer kitchen", "Recessed lighting", "Hardwood floors"]
},
"availability": {
"sold_at": "1992-07-10T07:00:00+00:00",
"sold_date": "Jul 10, 1992",
"days_on_market": 1,
"time_on_redfin": 21919287
},
"media": {
"photo_count": 38,
"photo_format": "webp",
"primary_photo_url": "https://ssl.cdn-redfin.com/photo/68/bigphoto/480/12656480_0.jpg",
"has_virtual_tour": false,
"has_video_tour": false,
"has_3d_tour": false
},
"contact_details": {
"contact_phone": "(224) 507-5311",
"contact_phone_url": "tel:+12245075311",
"recommended_agent_phone": "(773) 733-0425"
},
"relationships": {
"listing_agents": [
{
"agent_name": "Gerard Scheffler",
"broker_name": "Home Gallery Realty Corp."
}
],
"listing_source": {
"data_source_id": 68,
"data_source_name": "MRED as Distributed by MLS Grid"
},
"recommended_agent": {
"full_name": "BJ Tregoning",
"job_title": "Redfin Agent",
"brokerage_name": "Redfin",
"license_number": "475118019",
"average_rating_for_customer_display": 5.0,
"num_reviews": 21
}
},
"metrics": {
"property_history": [
{
"event_description": "Listed",
"price": 395000,
"source": "MRED as Distributed by MLS Grid"
}
],
"tax_info": {
"roll_year": 2023,
"taxes_due": 4275.94
},
"valuation": {
"automated_valuation": {
"predicted_value": 395162.12,
"section_preview_text": "$395,162"
},
"rental_estimate": {
"predicted_value": 2330,
"preview_text": "$2,292 - $2,392 / mo"
}
},
"scores": {
"location": {
"walk_score": 74,
"bike_score": 62
}
}
},
"attributes": {
"amenities": {
"selected": {
"Style": "Cape Cod",
"Parking": "2 car garage"
},
"highlight_tags": ["HARDWOOD FLOORS", "NEWER KITCHEN", "DETACHED 2-CAR GARAGE"]
},
"parcel": {
"info": {
"fips_code": "17031",
"apn": "13184040130000"
}
},
"flags": {
"is_hot": false,
"is_redfin": false,
"remarks_access_level": 1
}
}
}

Field Reference

Redfin property_listing record

record_type (string, required): Stable row discriminator. Listing, rental, and sold-comparable rows use property_listing.

record_id (string, required): Best available stable row key, selected from Redfin listing, property, rental, MLS, or fingerprint identifiers.

source_context (object, required): Provenance and crawl context. Includes source_name, source_domain, source_url, source_api_url, detail_url, listing_url, seed metadata, resolved Redfin geography, page index, and search filters.

entity (object, required): Public listing entity. Includes title, url, status, and external_ids such as property_id, listing_id, mls_id, data_source_id, market_id, fips, apn, and rental/feed identifiers when available.

listing (object, optional): Listing-mode and status fields such as deal_type, mls_status, home_status, search_status_id, Redfin/MLS display-status objects, and description fields including listing remarks, marketing remarks, AI summary, short description, and public meta tags.

pricing (object, optional): Current price, sold price, price per square foot, HOA, rent range, sale-price visibility flags, and Redfin price-display metadata.

location (object, optional): Structured address, area label, city, state, postal code, country code, latitude/longitude, map-display flag, and timezone.

property (object, optional): Bedroom, bathroom, story, square-footage, lot-size, year-built, parking, pool, property-type identifiers, public facts, detailed property facts, and key listing facts.

availability (object, optional): Sold dates, days on market, Redfin exposure timing, open-house information, and rental availability/details when available.

media (object, optional): Photo references, photo count, photo format, primary image URL, static map URL, captions, badges, and virtual/video/3D tour flags.

contact_details (object, optional): Public contact phone fields, recommended-agent phone fields, listing-agent email, and device-specific phone values when Redfin provides them.

relationships (object, optional): Listing agents, listing broker, selling broker, listing source, and recommended Redfin agent profile details.

metrics (object, optional): Property history, tax history, latest tax summary, automated valuation, rental estimate, location scores, neighborhood statistics, popularity, climate risks, and school data.

attributes (object, optional): Amenity groups, selected amenities, highlight tags, parcel/zoning/boundary data, public listing flags, and remaining source-specific values that do not fit a stronger normalized group.

Data Quality, Guarantees, And Handling

  • Structured records: results are normalized into predictable JSON objects for downstream use.
  • Best-effort extraction: fields may vary by region, session, availability, listing type, and Redfin interface changes.
  • Optional fields: null-check optional fields in downstream code, especially detailed amenities, media, schools, tax, parcel, valuation, and climate data.
  • Deduplication: use record_id as the primary idempotency key, with entity.url or entity.external_ids.property_id + entity.external_ids.listing_id as fallbacks.
  • Freshness: results reflect the publicly available data at run time.
  • Repeated runs: use the recommended idempotency key when syncing data into warehouses, CRMs, search indexes, or other systems.

Tips For Best Results

  • Start with a small limit to validate the output shape before scaling up.
  • Use one location item and one deal_type per run when you need cleaner segmentation, or add several location items when the same filters should apply across multiple markets.
  • Leave optional filters empty when the goal is broad discovery.
  • Add price, bedroom, property type, listing freshness, and amenity filters gradually to understand how each field changes coverage.
  • Enable enrich_data for diligence, comp analysis, enrichment, or listing-detail workflows.
  • Schedule recurring runs for monitoring workflows instead of relying on manual one-off jobs.
  • Use record_id or entity.url for deduplication when storing results over time.

How to Run on Apify

  1. Open the Actor in Apify Console.
  2. Configure the available input fields for the target location, listing mode, filters, and enrichment needs.
  3. Set the maximum number of outputs to collect with limit.
  4. Click Start and wait for the run to finish.
  5. Open the dataset and review the first records.
  6. Download results in JSON, CSV, Excel, or other supported formats.

Scheduling & Automation

Scheduling

Automated Data Collection

Schedule runs to keep Redfin market, listing, and comparable-sale datasets fresh without manually starting each collection. Use recurring schedules for dashboards, alerts, enrichment jobs, and monitoring workflows.

  • Navigate to Schedules in Apify Console
  • Create a new schedule, such as daily, weekly, or custom cron
  • Configure input parameters
  • Enable notifications for run completion
  • Add webhooks for automated processing

Integration Options

  • BI dashboards: monitor pricing, inventory, availability, listing freshness, property type mix, and geographic coverage over time.
  • Data warehouses: store normalized Redfin records for historical trend analysis, comp modeling, and operational reporting.
  • CRM enrichment: sync public listing, agent, location, property, and valuation attributes into account or lead records.
  • Google Sheets or Airtable: review sampled listings, enrichment queues, or market segments in lightweight operational workflows.
  • Webhooks: trigger validation, notification, ingestion, or alert workflows after each completed run.
  • Data enrichment pipelines: join Redfin records with internal property, lead, CRM, or investment datasets using stable identifiers and addresses.

Export Formats And Downstream Use

Apify datasets can be exported or consumed by downstream systems for operational and analytical workflows.

  • JSON: for APIs, applications, and data pipelines
  • CSV or Excel: for spreadsheet workflows and manual review
  • API access: for automated ingestion into internal systems
  • BI and warehouses: for reporting, dashboards, and historical analysis

Performance

Estimated run times:

  • Small runs (< 1,000 outputs): ~3-5 minutes
  • Medium runs (1,000-5,000 outputs): ~5-15 minutes
  • Large runs (5,000+ outputs): ~15-30 minutes

Execution time varies based on filters, result volume, and how much information is returned per record. Highly filtered runs can finish faster, while broad discovery or detail-rich records may take longer.

Limitations

  • Availability depends on what https://www.redfin.com publicly exposes at run time.
  • Some optional fields may be missing on sparse records, rental records, sold records, or listings with limited public detail.
  • Very broad searches may take longer or require higher limit values.
  • Target-side changes can affect field availability, labels, or naming.
  • Regional, account, source, or availability differences may change visible results.
  • Detail-rich records depend on the public information available for each listing.

Troubleshooting

  • No results returned: check filter strictness, location spelling, deal_type, sale status, and whether Redfin has matching public records.
  • Fewer results than expected: broaden filters, raise limit, or verify that the target location contains enough matching listings.
  • Some fields are empty: optional fields depend on what each record publicly provides.
  • Run takes longer than expected: reduce scope, lower limit for validation, or split broad collection into smaller locations or segments.
  • Output changed: compare the current output with the field reference and report a small sample if support is needed.

FAQ

What data does this actor collect?

It collects public Redfin listing data, including listing identifiers, URLs, prices, property facts, addresses, media metadata, transaction status, amenities, agents, history, valuation, parcel context, schools, and climate-related attributes when available.

Can I filter by location, date, price, or other criteria?

Yes. The schema supports location, deal_type, price range, bedrooms, bathrooms, parking, area, lot size, year built, stories, property type, pool preference, tour options, listing freshness, keywords, listing type, amenities, neighborhood score thresholds, HOA fees, property taxes, limit, and enrichment.

Why did I receive fewer results than my limit?

The limit is a maximum, not a guarantee. The final count depends on matching public listings, filters, listing mode, geography, and data availability at run time.

Can I schedule recurring runs?

Yes. Use Apify schedules to run the actor daily, weekly, or on a custom cron schedule for monitoring, reporting, and enrichment workflows.

How do I avoid duplicates across runs?

Use record_id as the primary idempotency key. If needed, use entity.url or a composite key such as entity.external_ids.property_id + entity.external_ids.listing_id.

Can I export the data to CSV, Excel, or JSON?

Yes. Apify datasets can be downloaded in JSON, CSV, Excel, and other supported formats, or consumed programmatically through API access.

Does this actor collect private data?

No. The actor is intended for publicly available Redfin listing information. Users are responsible for ensuring their use of the data complies with applicable laws, regulations, and terms.

Should I enable enrich_data?

Enable enrich_data when you need richer listing-level context such as remarks, amenities, media captions, schools, parcel details, valuation, or climate-risk context. Leave it disabled for faster sampling or high-level market review.

What should I include when reporting an issue?

Include the input used with sensitive values redacted, the run ID, expected versus actual behavior, and a small output sample if it helps illustrate the issue.

Compliance & Ethics

Responsible Data Collection

This actor collects publicly available real estate listing information from https://www.redfin.com for legitimate business purposes, including:

  • Real estate research and market analysis
  • Property, listing, and comparable-sales monitoring
  • Data enrichment, operational reporting, and internal analytics

This section is informational and not legal advice. Users are responsible for evaluating whether their collection and use of the data complies with applicable laws, regulations, contracts, and platform terms.

Best Practices

  • Use collected data in accordance with applicable laws, regulations, and the target site’s terms
  • Respect individual privacy and personal information
  • Use data responsibly and avoid disruptive or excessive collection
  • Do not use this actor for spamming, harassment, or other harmful purposes
  • Follow relevant data protection requirements where applicable, including GDPR and CCPA

Support

For help, use the Issues tab or the actor page. Include the input used with sensitive values redacted, the run ID, expected versus actual behavior, and a small output sample when it is useful for diagnosis.