rentcast-proxy
Version, currently main branch1 version
- main branchlatestJun 2, 2025
github.com/robcole/rentcast-proxy
A typed API wrapper and proxy for Rentcast API with caching
1 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
rentcast-proxy:
github: robcole/rentcast-proxy
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.16.3- License
- MIT
- Author
- Your Name
- Target
rentcast-proxyfrom src/rentcast-proxy.cr
Dependencies
Runtime Dependencies
Development Dependencies
- ameba~> 1.6.0github: crystal-ameba/amebadev
- spec-kemal~> 1.0.0github: kemalcr/spec-kemaldev
README
Rentcast API Proxy
A typed API wrapper and proxy for the Rentcast API built in Crystal with caching and SQLite persistence.
Features
- Typed API Wrapper: Fully typed Crystal models for all Rentcast API responses
- Caching: SQLite-based caching with configurable TTL (default: 7 days)
- Proxy Server: Kemal-based proxy that mirrors Rentcast API structure
- Error Handling: Intelligent caching that skips 404s and other errors
- Auto-cleanup: Background process to remove expired cache entries
Installation
- Install dependencies:
shards install
- Set your Rentcast API key:
export RENTCAST_API_KEY="your_api_key_here"
- Build the application:
crystal build src/rentcast-proxy.cr --release
Usage
Running the Proxy Server
./rentcast-proxy
The server will start on http://localhost:3000 and automatically:
- Initialize the SQLite database for caching
- Start the cache cleanup scheduler
- Mirror the Rentcast API endpoints
Available Endpoints
All endpoints mirror the Rentcast API structure:
GET /v1/properties- Search property recordsGET /v1/properties/:id- Get property by IDGET /v1/avm/rent/long-term- Get rent estimatesGET /v1/avm/value- Get value estimatesGET /health- Health check endpoint
Cache Headers
The proxy adds cache status headers to responses:
X-Cache: HIT- Response served from cacheX-Cache: MISS- Response fetched from Rentcast API
Example Usage
# Search properties in a city
curl "http://localhost:3000/v1/properties?city=Austin&state=TX&limit=10"
# Get property by ID
curl "http://localhost:3000/v1/properties/12345"
# Get rent estimate
curl "http://localhost:3000/v1/avm/rent/long-term?address=123 Main St&city=Austin&state=TX"
Configuration
- Cache TTL: Default 7 days (604800 seconds)
- Database: SQLite database stored as
cache.db - Port: 3000 (configurable in code)
- Cleanup: Runs every hour to remove expired cache entries
Development
Format code before committing:
crystal tool format src/ spec/
Run tests:
crystal spec
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Jun 2, 2025
- Crystal
>= 1.16.3- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/robcole/rentcast-proxy
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 15, 2026
- Versions
- 1