# Rentexa Lab > Free calculator to analyse a Spanish buy-to-let investment: purchase costs, mortgage, rental income, expenses, taxes and a deal score from 0 to 100. A new analysis can be opened already filled in by adding query parameters to the URL, for example with the data of a property listing (Idealista, Fotocasa, etc.). ## How to build a prefilled link - Start from the origin you fetched this file from, followed by `/` (production: `https://lab.rentexa.ai/`). - Add one query parameter per value you know and leave the rest out; missing parameters keep the default value. - URL-encode every value (a space is `%20`, `í` is `%C3%AD`). - Numbers are plain decimals with `.` as the decimal separator: no thousands separator, no currency symbol, no spaces (`245000`, `1100.5`). - Percentages and interest rates are fractions: 0.8 = 80%, 0.035 = 3.5%. - Enum values must match exactly, including accents and case. - Invalid values are discarded and the user is told which ones; unknown parameters are ignored. - Opening the link saves nothing: the user reviews the values and saves the analysis themselves. - Do not invent values. Leave out anything that neither the listing nor the user states. The only exception is `monthlyRent`, which you may estimate if you can look up comparable rentals; if you cannot look up comparable rentals, leave it out. - Listing details without a parameter are ignored: rooms, bathrooms, size (m²), floor, lift, orientation, energy certificate, photos. ## What to tell the user with the link - Which values you converted (e.g. monthly community fees × 12, percentages turned into euros) and which ones you estimated. - That `monthlyRent` must be filled in if you left it out. - If the user did not mention financing, that a mortgage is assumed by default (`financedPct=0.8`, `mortgageYears=30`, `mortgageType=fixed`, `annualInterestRate=0.03`), and ask whether they will finance the purchase. For a cash purchase, send `financedPct=0`. - That purchase costs left out (`notaryCost`, `registryCost`, `mortgageGestoria`, `mortgageTasacion`, `mortgageOther`) stay at 0, so the total cost of the operation is understated until they fill them in. ## Parameters | Parameter | Format | Default | Description | | --- | --- | --- | --- | | `purchasePrice` | number >= 0, euros | `0` | Purchase price of the property (the listing price). | | `notaryCost` | number >= 0, euros | `0` | Notary fees for the purchase. | | `registryCost` | number >= 0, euros | `0` | Land registry fees for the purchase. | | `renovationCost` | number >= 0, euros | `0` | Planned renovation cost. | | `furnitureCost` | number >= 0, euros | `0` | Furniture cost. | | `agencyFee` | number >= 0, euros | `0` | Real estate agency fee paid by the buyer, in euros including VAT (IVA). Convert a percentage of the price into euros: 3% + 21% VAT on 320000 is 11616. | | `region` | one of: `Andalucía`, `Aragón`, `Asturias`, `Baleares`, `Canarias`, `Cantabria`, `Castilla - La Mancha`, `Castilla León`, `Cataluña`, `Ceuta`, `Comunidad de Madrid`, `Comunidad Valenciana`, `Extremadura`, `Galicia`, `La Rioja`, `Melilla`, `Murcia`, `Navarra`, `País Vasco` | `Comunidad de Madrid` | Spanish autonomous community where the property is (sets the transfer tax, ITP). Always set it: map the province of the listing to its community. If you cannot tell the province, ask the user instead of leaving it out (the default would apply Comunidad de Madrid rates). | | `financedPct` | fraction from 0 to 1 (0.08 = 8%) | `0.8` | Share of the purchase price financed by the mortgage, as a fraction: 0.8 means 80%. Use 0 for a cash purchase (no mortgage). | | `mortgageYears` | whole number from 1 to 50, years | `30` | Mortgage term. | | `mortgageType` | one of: `fixed`, `variable` | `fixed` | Mortgage interest type. `fixed` uses annualInterestRate; `variable` uses euribor + differential. | | `annualInterestRate` | fraction from -1 to 1 (0.035 = 3.5%) | `0.03` | Yearly interest rate of a fixed mortgage. | | `euribor` | fraction from -1 to 1 (0.035 = 3.5%) | `0.025` | Euribor rate for a variable mortgage. | | `differential` | fraction from -1 to 1 (0.035 = 3.5%) | `0.02` | Spread over Euribor for a variable mortgage. | | `mortgageGestoria` | number >= 0, euros | `0` | Mortgage paperwork agency (gestoría) cost. | | `mortgageTasacion` | number >= 0, euros | `0` | Property appraisal (tasación) cost. | | `financingInsurance` | number >= 0, euros | `0` | Yearly insurance linked to the mortgage (life, unemployment, etc.). | | `mortgageOther` | number >= 0, euros | `0` | Other one-off financing costs. | | `monthlyRent` | number >= 0, euros | `0` | Expected rent per month. Sale listings do not include it. Use the figure the user gives you; otherwise estimate it only if you can look up comparable rentals in the same area, and tell the user it is an estimate. If you cannot, leave it out and tell the user to fill it in. | | `communityPerYear` | number >= 0, euros | `0` | Community fees (gastos de comunidad) per year. Listings usually show them per month: multiply by 12. | | `homeInsurance` | number >= 0, euros | `0` | Home insurance per year. | | `nonPaymentInsurancePctOnRent` | fraction from 0 to 1 (0.08 = 8%) | `0.05` | Rent default insurance cost as a share of yearly rent. | | `maintenancePctOnRent` | fraction from 0 to 1 (0.08 = 8%) | `0.08` | Maintenance cost as a share of yearly rent. | | `ibiYear` | number >= 0, euros | `0` | Property tax (IBI) per year. | | `municipalTaxesYear` | number >= 0, euros | `0` | Other municipal taxes per year (e.g. rubbish collection). | | `vacancyPctOnRent` | fraction from 0 to 1 (0.08 = 8%) | `0` | Expected vacancy as a share of the year; rounded to whole months (one month = 1/12 ≈ 0.0833). | | `managementPctOnRent` | fraction from 0 to 1 (0.08 = 8%) | `0` | Property management fee as a share of yearly rent. | | `nonDeductibleExpenses` | number >= 0, euros | `0` | Yearly expenses that are not tax deductible. | | `salaryBand` | one of: `0€ -12.450€`, `12.450€ - 20.200€`, `20.200€ - 35.200€`, `35.200€ - 60.000€`, `Más de 60.000€` | `20.200€ - 35.200€` | Buyer's gross yearly salary band, used to estimate income tax. | | `tenantPrimaryResidence` | `true` or `false` | `true` | Whether the property will be the tenant's primary residence (enables the rental income tax reduction). | | `spanishResident` | `true` or `false` | `true` | Whether the buyer is a tax resident in Spain. | | `europeanResident` | `true` or `false` | `true` | Only used when spanishResident=false: whether the buyer is a tax resident in another EU/EEA country. Someone living in an EU country is usually tax resident there; confirm with the user if unsure. | | `cadastralConstructionValue` | number >= 0, euros | `0` | Cadastral value of the building (valor catastral de la construcción), from the IBI receipt. | | `cadastralLandValue` | number >= 0, euros | `0` | Cadastral value of the land (valor catastral del suelo), from the IBI receipt. | | `source` | absolute `http://` or `https://` URL, URL-encoded | — | Original listing. Shown to the user as a link; it is not saved. | ## Examples - Sale listing in Valencia (community fees of 60 €/month, no rent known) with the original listing linked: `/?purchasePrice=245000®ion=Comunidad%20Valenciana&communityPerYear=720&ibiYear=380&source=https%3A%2F%2Fwww.idealista.com%2Finmueble%2F12345678%2F` - Variable-rate mortgage financing 70% over 25 years in Andalucía, with the rent the user expects: `/?purchasePrice=180000®ion=Andaluc%C3%ADa&financedPct=0.7&mortgageYears=25&mortgageType=variable&euribor=0.025&differential=0.008&monthlyRent=850`