Skip to content

AddressVerify-io/addressverify-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AddressVerify Rust SDK

Official Rust client for the AddressVerify API — validate U.S. residential addresses, classify home types, and get estimated property values in real time.

crates.io docs.rs CI license

  • 🏠 Address validation — confirm an address is a real, deliverable U.S. residence
  • 🏷️ Home-type classificationSINGLE_FAMILY, MULTI_FAMILY, APARTMENT, CONDO, TOWNHOUSE, MANUFACTURED, LOT
  • 💰 Property values — estimated home value, plus optional expanded property data
  • 🦀 Typedserde-derived response types; ergonomic request builder

Installation

cargo add addressverify

Or in Cargo.toml:

[dependencies]
addressverify = "0.1"

Get an API key

Create a free account at app.addressverify.io and copy your API key from the dashboard. The free tier includes 100 calls/month.

Quick start

use addressverify::Client;

fn main() -> Result<(), addressverify::Error> {
    let client = Client::new(std::env::var("ADDRESSVERIFY_API_KEY").unwrap());

    // Single-line address
    let result = client.verify("123 Main St, New York, NY 10001").send()?;

    println!("{}", result.address_valid); // true
    println!("{}", result.home_type);     // SINGLE_FAMILY
    println!("{}", result.home_value);    // 273900

    Ok(())
}

Multi-line address

use addressverify::Address;

let result = client
    .verify_parts(Address {
        street: "20 Marie St".into(),
        city: "Iberia".into(),
        state: "MO".into(),
        zip: "65486".into(),
    })
    .send()?;

Expanded property data

Chain .expanded(true) to receive parsed address components, property details, tax assessment, and listing data (available on all plans at no extra cost):

let result = client
    .verify("20 Marie St, Iberia, MO 65486")
    .expanded(true)
    .send()?;

if let Some(property) = result.property_info {
    println!("{} bedrooms", property.bedrooms); // 4
}

Error handling

A non-2xx response returns Error::Api { status, message, body }:

use addressverify::Error;

match client.verify("not a real address").send() {
    Ok(result) => println!("{result:?}"),
    Err(Error::Api { status, message, .. }) => {
        eprintln!("API error {status}: {message}"); // e.g. 422
    }
    Err(e) => eprintln!("{e}"),
}
Status Meaning
400 Bad Request — invalid or missing parameters
401 Unauthorized — invalid API key
422 Invalid address (e.g. missing street number)
429 Too Many Requests — rate limit exceeded

Configuration

let client = Client::new("YOUR_API_KEY")
    .with_base_url("https://api.addressverify.io"); // optional override

The client is built on reqwest's blocking client with rustls TLS (no system OpenSSL needed).

Roadmap

  • Home Verify (homeowner + person & property lookup, …/isHomeOwner/homeOwner) — coming to the SDK. Already available on the REST API.

Links

License

MIT © AddressVerify

About

Official Rust SDK for the AddressVerify API — validate residential addresses, classify home types, and get property values.

Topics

Resources

License

Stars

21 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages