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§
- Change
Item - A single item in the changes result array.
dataisserde_json::Valuebecause the structure varies between sources. - Changes
Meta - Pagination metadata for changes feed.
- Changes
Response - Response from
get_changes(). - Client
- Client for the auto-api.com car listings API.
- Meta
- Pagination metadata for offers.
- Offer
Data - Common offer data fields shared across all sources.
Since each source may have additional fields, deserialize from
OfferItem.datainto this or into your own struct. - Offer
Item - A single item in the offers result array.
dataisserde_json::Valuebecause the structure varies between sources. - Offers
Params - Parameters for
get_offers(). Use..Default::default()for optional fields. - Offers
Response - Response from
get_offers()andget_offer().
Enums§
- Error
- Error type for all client operations.