Skip to main content

Crate parcllabs

Crate parcllabs 

Source
Expand description

Rust SDK for the Parcl Labs API.

Provides async access to U.S. housing market data including market search, housing metrics, and price feeds.

§Example

use parcllabs::{ParclClient, SearchParams};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = ParclClient::new()?;

    // Search for markets
    let params = SearchParams::new().query("Los Angeles").limit(5);
    let markets = client.search().markets(params).await?;
    let la_market = &markets.items[0];
    println!("Found: {} (parcl_id: {})", la_market.name, la_market.parcl_id);

    // Get housing metrics
    let events = client
        .market_metrics()
        .housing_event_counts(la_market.parcl_id, None)
        .await?;

    for event in events.items.iter().take(3) {
        println!("{}: {} sales", event.date, event.sales.unwrap_or(0));
    }

    Ok(())
}

Re-exports§

pub use endpoints::for_sale_metrics::ForSaleMetricsParams;
pub use endpoints::investor_metrics::InvestorMetricsParams;
pub use endpoints::market_metrics::MetricsParams;
pub use endpoints::new_construction_metrics::NewConstructionMetricsParams;
pub use endpoints::portfolio_metrics::PortfolioMetricsParams;
pub use endpoints::property::EventHistoryParams;
pub use endpoints::property::PropertySearchParams;
pub use endpoints::rental_metrics::RentalMetricsParams;
pub use endpoints::search::SearchParams;
pub use error::ParclError;
pub use error::Result;
pub use models::*;

Modules§

endpoints
error
models
Response types for the Parcl Labs API.

Structs§

ParclClient
Main client for interacting with the Parcl Labs API.
RetryConfig
Configuration for automatic retry on rate-limited (429) responses.