Skip to main content

Crate auto_api_client

Crate auto_api_client 

Source
Expand description

§auto-api-client

Rust client for auto-api.com — car listings API across multiple marketplaces.

§Usage

use auto_api_client::{Client, OffersParams};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new("your-api-key");

    let offers = client.get_offers("encar", &OffersParams {
        page: 1,
        brand: Some("BMW".into()),
        ..Default::default()
    }).await?;

    println!("Got {} offers", offers.result.len());
    Ok(())
}

Structs§

ChangeItem
A single item in the changes result array. data is serde_json::Value because the structure varies between sources.
ChangesMeta
Pagination metadata for changes feed.
ChangesResponse
Response from get_changes().
Client
Client for the auto-api.com car listings API.
Meta
Pagination metadata for offers.
OfferData
Common offer data fields shared across all sources. Since each source may have additional fields, deserialize from OfferItem.data into this or into your own struct.
OfferItem
A single item in the offers result array. data is serde_json::Value because the structure varies between sources.
OffersParams
Parameters for get_offers(). Use ..Default::default() for optional fields.
OffersResponse
Response from get_offers() and get_offer().

Enums§

Error
Error type for all client operations.