Fetch current mortgage rate data for display in a real estate application
domain: real-estate-general · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Identify a mortgage rate data source appropriate for your use case: Freddie Mac publishes weekly PMMS (Primary Mortgage Market Survey) averages for free; CFPB HMDA data provides historical loan rate data; commercial providers like Optimal Blue offer real-time lock data via paid API.
For Freddie Mac PMMS weekly data, fetch the published CSV or JSON from Freddie Mac's research data page; parse the 30-year and 15-year fixed rate and the week-ending date.
For a real-time rate feed, integrate with a mortgage pricing API (e.g., Polly, Optimal Blue, or a lender-specific API); these require a business relationship and return rates based on loan scenario inputs (loan amount, LTV, credit score, property type).
Cache the rate data with an appropriate TTL: weekly for PMMS data, minutes to hours for real-time lock rates.
Display rates with the appropriate context: PMMS rates are national averages and will differ from a consumer's actual rate; include the rate source and date prominently.
Compute a sample monthly payment using the formula: M = P[r(1+r)^n]/[(1+r)^n-1] where P is loan amount, r is monthly rate, and n is number of payments.
Known gotchas
Displaying specific rate quotes to consumers without a mortgage lending license may trigger regulatory issues in some states; clearly label rates as illustrative estimates, not offers.
Freddie Mac PMMS reflects rates for well-qualified borrowers with 20% down; actual consumer rates vary significantly by credit score, LTV, loan size, and property type.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?