STR vs LTR Yields: Real Estate Data Scraping with Claude
Pull three datasets for the same area through Apify: for-sale listings and rental listings from the Zillow ZIP Code Search Scraper, and short-term rental comps from the Airbnb Scraper API (codepoetry). Claude then matches each property to rentals and Airbnb listings with the same bedroom count, works out gross and net yield for long-term (LTR) and short-term (STR) letting, and flags the outliers. One ZIP code costs about 50 cents in Apify usage. The output is a screening table, not an appraisal.
Most "should this be an Airbnb?" answers compare a nightly rate with a monthly rent and stop there. The useful version compares both against the purchase price, after costs, using comps that match the property. That is three scrapes and some arithmetic, and Claude can do both in one chat.
Let Claude run the analysis for you
Paste this into Claude (Desktop, Cowork or claude.ai) with the Apify connector added. Claude asks for your market and assumptions one at a time, runs a small priced test, and builds the full comps table only after you approve. The rest of this post explains each step it takes.
Claude interviews you about the market and your assumptions, checks the Apify connector, runs a priced five-listing test, then builds the yield table after you confirm.
- Asks for ZIP codes, budget, property type, bedrooms and your cost assumptions, one question at a time
- Checks that the Apify connector is connected and tells you how to add it if not
- Runs a five-result test of each scraper and shows you the real cost
- Builds the per-property STR vs LTR table and flags outliers, after you approve the full run
Help me compare short-term rental (Airbnb) and long-term rental yields for
properties for sale in one area. Work through this with me step by step.
1. Interview me. Ask one question at a time and wait for each answer:
- the US ZIP codes to analyse (one to three to start)
- my maximum purchase price, property types (house, condo, townhouse)
and bedroom counts
- my assumptions, and offer these defaults if I have none, labelled as
assumptions: LTR vacancy 5%, LTR costs 30% of collected rent, STR
platform and management fees 25% of revenue, STR fixed costs $9,000
a year
- a typical stay to price Airbnb comps on (check-in and check-out
dates), and whether my Apify plan is Free or paid
2. Check your tools. Confirm you can use the Apify connector's call-actor
and get-dataset-items tools. If you can't, stop and tell me to add
Apify's MCP server as a connector and sign in to Apify, then wait until
I say it's done.
3. Run a small test first. Tell me what it will cost, then run:
- maxcopell/zillow-zip-search with zipCodes, forSaleByAgent true,
forSaleByOwner false, forRent false, sold false, priceMax set to my
budget, resultsLimit 5
- the same Actor with forSaleByAgent false and forRent true,
resultsLimit 5
- codepoetry/airbnb-scraper with location_queries set to the city,
room_types ["Entire home/apt"], my check_in/check_out, currency USD,
calendar_months 3, max_listings 5
Show me a few rows of each and the actual cost of the three runs.
4. Once I approve, run the full scrape (up to 100 for-sale results, 50
rental results and 50 Airbnb listings per ZIP) and build a table with
one row per for-sale property:
- price, bedrooms, days on Zillow, price change, tax assessed value
- LTR rent: median of rental-card prices for the same bedroom count
(parse "$1,299+" as 1299 and say these are asking "from" prices)
- STR revenue: median price_per_night x median occupancy_rate x 365,
using Airbnb comps with the same bedrooms within 3 km of the
property (use latitude/longitude on both sides)
- gross and net yield for LTR and STR, using my assumptions, with the
formulas written out under the table
- flags: fewer than 3 comps on either side, list price below tax
assessed value, 90+ days on Zillow or a price cut, and STR net yield
more than 2 points above LTR net yield
Label occupancy as calendar-implied and an upper bound on bookings.
Never invent a number that isn't in the data, and say this is a
screening table, not an appraisal.
5. Don't run anything that spends money without asking me first.
Claude asks before each change it makes. Read each step before you approve it.
The data stack
Three scrapes cover the core comparison. Two more are optional.
| Need | Source | Actor | Key fields (as returned in our test) |
|---|---|---|---|
| For-sale listings | Zillow | Zillow ZIP Code Search Scraper | listingPrice.amount, bedrooms, bathrooms, livingArea, homeType, daysOnZillow, priceChange, taxAssessedValue, coordinates |
| Long-term rents | Zillow | Same Actor, forRent: true | units[].price (e.g. "$1,299+"), units[].beds, cardType, coordinates |
| Short-term revenue | Airbnb | Airbnb Scraper API (codepoetry) | price_per_night, occupancy_rate, blocked_days, availability_days_total, bedrooms, latitude/longitude |
| Second listing source (optional) | Realtor.com | Realtor Scraper | Search by city or URL, mode: "BUY", with optional detail pages |
| Off-market leads (optional) | Google Maps | Google Maps Scraper | Property managers and small landlords by category |
The ZIP Code Search Actor is the right Zillow entry point for this job: it takes a list of ZIP codes directly, so you work ZIP by ZIP instead of building search URLs. Its search output does not include a Zestimate or rent Zestimate, so long-term rents come from rental listings rather than Zillow's estimate.
What a test run returns
This is real output from a test run on 2026-10-21, five results per scrape, for ZIP 37206 (East Nashville, Tennessee). Street addresses and listing names are removed.
For sale (forSaleByAgent: true, priceMax: 600000):
| Beds / baths | Type | List price | Days on Zillow | Price change | Tax assessed |
|---|---|---|---|---|---|
| 2 / 1 | Single family | $350,000 | 7 | −$25,000 | $563,200 |
| 4 / 2 | Single family | $420,000 | 151 | −$59,900 | $548,600 |
| 2 / 2 | Townhouse | $425,000 | 7 | none | $311,400 |
| 2 / 2 | Single family | $478,000 | 5 | none | $478,000 |
| 3 / 2 | Single family | $529,700 | 4 | none | $459,700 |
For rent (forRent: true): all five results were apartment buildings, each quoting a "from" price per bedroom count. The two-bedroom prices were $1,299+, $1,719+, $1,734+, $1,890+ and $2,297+, a median of $1,734.
Airbnb (Nashville, TN, entire homes, two bedrooms minimum, calendar_months: 3): the five two-bedroom listings had price_per_night of $207, $247, $272, $301 and $449 (median $272) and occupancy_rate from 0.165 to 0.408 (median 0.291).
Three things in that output change how you run the full analysis:
- Neighbourhood names can return nothing. The same Airbnb run with
"East Nashville, Nashville, TN"returned zero listings. Search the city, then filter comps by distance using the coordinates both Actors return. That is what the setup prompt does. - Without dates, Airbnb prices one specific night. With no
check_in/check_out, every record came back priced for the same one-night Friday stay (20 November). A Friday rate overstates a year-round average, so pass a typical stay, or several across the seasons, and average them. - Rental cards are floors. Apartment buildings show the cheapest unit of each size with a
+. A median of "from" prices understates the typical rent, and it says nothing about single-family rentals. Treat LTR income from these cards as conservative.
The yield maths
Every number in the comparison comes from one of these formulas. The data supplies price, rent, nightly rate and occupancy. You supply the assumptions; the defaults below are placeholders, not market figures.
| Quantity | Formula |
|---|---|
| LTR gross yield | monthly rent × 12 ÷ purchase price |
| LTR net yield | monthly rent × 12 × (1 − vacancy) × (1 − LTR cost share) ÷ purchase price |
| STR gross revenue | median price_per_night × median occupancy_rate × 365 |
| STR gross yield | STR gross revenue ÷ purchase price |
| STR net yield | (STR gross revenue × (1 − fee share) − STR fixed costs) ÷ purchase price |
| Assumption | Placeholder | What it should cover |
|---|---|---|
| LTR vacancy | 5% | Empty months between tenants |
| LTR cost share | 30% of collected rent | Property tax, insurance, repairs, letting or management |
| STR fee share | 25% of revenue | Platform fees and a co-host or manager |
| STR fixed costs | $9,000 a year | Utilities, supplies, cleaning not covered by guest fees, furnishing wear, insurance |
STR revenue uses calendar-implied occupancy: the share of the next few months' nights already blocked on each comp's calendar. We explain how it is measured, and why it is an upper bound on bookings, in the Airbnb comp pricing guide. Note also that the calendar window runs from the run date, so a run in October measures October to January. In a seasonal market, repeat the run in other months before you trust an annual figure.
Worked example from the test data, for the 2-bed, $350,000 house, with the placeholder assumptions:
- LTR: $1,734 × 12 = $20,808 a year. Gross yield 5.9%. Net: $20,808 × 0.95 × 0.70 = $13,837, or 4.0%.
- STR: $272 × 0.291 × 365 = $28,890 a year. Gross yield 8.3%. Net: $28,890 × 0.75 − $9,000 = $12,668, or 3.6%.
The short-term let wins on gross yield by more than two points and loses on net. That reversal is the reason to model costs at all. It is also fragile: the STR side rests on five comps priced on a Friday night, and the LTR side on apartment "from" prices. With the full 50-comp set and a typical stay, either side can move.
If you would rather run the numbers yourself, this script reproduces the table from the three datasets exported as JSON. We ran it against the test data above.
# STR vs LTR yield per for-sale property. Python 3, standard library only.
import json
from statistics import median
# Assumptions: replace every one with your own numbers.
LTR_VACANCY = 0.05 # share of the year the unit sits empty
LTR_COST_SHARE = 0.30 # tax, insurance, repairs, management, as a share of collected rent
STR_FEE_SHARE = 0.25 # platform + co-host/management, as a share of STR revenue
STR_FIXED_COSTS = 9_000 # utilities, supplies, furnishing wear, insurance, per year
sale = json.load(open("zillow_sale.json")) # maxcopell/zillow-zip-search, forSaleByAgent
rent = json.load(open("zillow_rent.json")) # maxcopell/zillow-zip-search, forRent
stays = json.load(open("airbnb.json")) # codepoetry/airbnb-scraper
def asking_rent(price):
# Rental cards quote "from" prices such as "$1,299+": a floor, not an average.
return int(price.replace("$", "").replace(",", "").rstrip("+"))
def ltr_rent(beds):
rents = [asking_rent(u["price"]) for b in rent for u in b.get("units", [])
if u.get("beds") == str(beds) and not u.get("roomForRent")]
return median(rents) if rents else None
def str_comps(beds):
comps = [s for s in stays if s.get("bedrooms") == beds and s.get("price_per_night")]
if not comps:
return None, None
return (median(s["price_per_night"] for s in comps),
median(s["occupancy_rate"] for s in comps))
for home in sale:
price = home["listingPrice"]["amount"]
beds = home["bedrooms"]
rent_m = ltr_rent(beds)
adr, occ = str_comps(beds)
if not rent_m or not adr:
continue
ltr_gross = rent_m * 12
ltr_net = ltr_gross * (1 - LTR_VACANCY) * (1 - LTR_COST_SHARE)
str_gross = adr * occ * 365
str_net = str_gross * (1 - STR_FEE_SHARE) - STR_FIXED_COSTS
print(f"{beds}bd ${price:,}: LTR gross {ltr_gross / price:.1%} net {ltr_net / price:.1%} | "
f"STR gross {str_gross / price:.1%} net {str_net / price:.1%}")
On the test data it prints the three two-bedroom properties and skips the 3- and 4-bed homes, which had no comps in a five-result sample:
2bd $350,000: LTR gross 5.9% net 4.0% | STR gross 8.3% net 3.6%
2bd $425,000: LTR gross 4.9% net 3.3% | STR gross 6.8% net 3.0%
2bd $478,000: LTR gross 4.4% net 2.9% | STR gross 6.0% net 2.7%
The script compares every property with comps citywide. The setup prompt goes one step further and keeps only Airbnb comps within 3 km, which matters in a city where nightly rates vary by neighbourhood.
Flagging outliers
A yield table with 100 rows is only useful if it tells you which five to look at. The flags in the setup prompt, and what each one caught in the test data:
- Not enough comps. Fewer than three rentals or Airbnb listings with the same bedroom count means the yield is noise. In the test, both the 3-bed and the 4-bed home had none.
- List price below tax assessed value. The 2-bed listed at $350,000 is assessed at $563,200. Assessments are not market values and lag in both directions, so this is a question to ask, not a bargain signal.
- Stale or cut listings. 90+ days on Zillow, or any price cut. The 4-bed had sat for 151 days and dropped $59,900, which usually means more room to negotiate.
- A large STR premium. If STR net yield beats LTR net yield by more than two points, check the comps before believing it: a few high-priced or calendar-blocked listings can carry the whole result.
Covering a whole metro
Portals limit how many results one search returns, so a single citywide search samples the market instead of covering it. Split the area into ZIP codes. The ZIP Code Search Actor takes them as a list:
{
"zipCodes": ["37206", "37207", "37216"],
"forSaleByAgent": true,
"forSaleByOwner": false,
"forRent": false,
"sold": false,
"priceMax": 600000,
"resultsLimit": 100
}
Run it a second time with forRent: true for the rental side, then deduplicate on zpid if ZIP boundaries overlap in your source list. The US Census Bureau publishes ZIP Code Tabulation Areas if you need every ZIP in a metro.
For pipelines that hit Zillow and Realtor.com at volume, blocking and retries become the main problem. Our Zillow and Realtor.com scraping pipeline guide covers that side.
Off-market leads
Portals only show listed inventory. For off-market deals, the usual route is direct outreach to property management companies and small landlords. The Google Maps Scraper collects them by category ("property management", "apartment rental") with phone numbers and websites. Extracting emails from Google Maps covers the contact side. Check the marketing and privacy rules where you are before you contact anyone.
What it costs
Both Actors charge per result, at a lower rate on paid Apify plans. Prices from each Actor's pricing tab, checked 2026-10-21:
| Actor | Free plan | Starter |
|---|---|---|
| Zillow ZIP Code Search Scraper | $0.0024 per result | $0.002 per result |
| Airbnb Scraper API (codepoetry) | $0.003 per listing (from 2026-10-22) | $0.0015 per listing |
| Realtor Scraper (optional) | $0.01 per search, $0.001 per result and per detail page | same |
Our three five-result tests cost about 2 cents. A full single-ZIP analysis of 100 for-sale results, 50 rental results and 50 Airbnb listings comes to about $0.51 on the free plan (150 × $0.0024 + 50 × $0.003) or $0.38 on Starter. Each extra stay window you price on Airbnb adds another 50 listings.
Before you rely on it
- It is a screen, not an appraisal. The table tells you which listings deserve a closer look. Price a deal on inspected condition, real rent comps from a local agent, and your lender's numbers.
- Check whether short-term letting is allowed. Many cities require a permit for STRs, limit them by zone or ban non-owner-occupied ones, and HOAs and condo boards can prohibit them outright. A strong STR yield on a property that can't legally be let short-term is worth nothing. The Airbnb record has a
licensefield, but it was empty on all five test listings, so do not rely on it. - Occupancy is calendar-implied. A blocked night can be a booking or the host closing the date, and nights further out fill later. See the method and its limits.
- Your assumptions drive the answer. The example flips from "STR wins" to "LTR wins" on costs alone. Replace the placeholders with quotes for insurance, management and cleaning in your market.
- Terms of service. Zillow, Realtor.com and Airbnb all restrict automated access in their terms. Collecting public listing data for your own investment research is common practice, but redistributing it is a different matter. Our web scraping legal guide covers the main rules.
For a broader look at what property data is useful for beyond yield, see web scraping for real estate. To dig into nightly rates, reviews and calendars on their own, see how to scrape Airbnb prices, reviews and availability.
A single ZIP and the setup prompt above is enough to see whether STR beats LTR in your target market, for well under a dollar of usage. Create a free Apify account →
Work out both against the purchase price. LTR gross yield is monthly rent × 12 ÷ price. STR gross revenue is the median nightly rate of comparable Airbnb listings × their median calendar-implied occupancy × 365. Then subtract costs: vacancy and running costs for LTR, platform and management fees plus fixed costs for STR. STR often wins on gross yield and loses or ties on net, so always compare net.
Claude can collect the data and do the arithmetic. With the Apify connector it runs the Zillow and Airbnb scrapers, matches each for-sale property to rentals and Airbnb comps with the same bedroom count, computes gross and net yields from your assumptions, and flags outliers. It cannot inspect a property, verify local short-term rental rules or replace an appraisal.
Use comparable listings nearby. Codepoetry's Airbnb Scraper API returns each listing's nightly rate for the stay you specify and an occupancy_rate read from its availability calendar. Multiply the comps' median rate by their median occupancy and by 365. Calendar-implied occupancy is an upper bound on bookings, and a single stay window does not capture seasonality, so price several windows across the year.
Not in the search output of the Zillow ZIP Code Search Scraper used here. It returns list price, bedrooms, bathrooms, living area, days on Zillow, price changes and tax assessed value. For rents, run the same Actor with forRent set to true and use the rental listings' asking prices.
Zillow, Realtor.com and Airbnb all restrict automated access in their terms of service. Collecting publicly visible listing data at a reasonable rate for your own investment research is widely practised; republishing or reselling it is a different legal category. Check the rules that apply to you, and see a lawyer for commercial use.
