autotrader-connect-api
Version:
Production-ready TypeScript wrapper for Auto Trader UK Connect APIs
124 lines • 3.52 kB
TypeScript
/**
* Valuations module for AutoTrader API
* Handles vehicle valuation endpoints and operations
*/
/**
* Vehicle valuation request parameters
*/
export interface ValuationRequest {
registration?: string;
make: string;
model: string;
variant?: string;
year: number;
mileage: number;
condition?: 'Excellent' | 'Good' | 'Fair' | 'Poor';
serviceHistory?: 'Full' | 'Partial' | 'None';
postcode?: string;
}
/**
* Vehicle valuation response
*/
export interface ValuationResponse {
vehicleDetails: {
make: string;
model: string;
variant: string;
year: number;
mileage: number;
};
valuations: {
trade: {
value: number;
confidence: 'High' | 'Medium' | 'Low';
range: {
min: number;
max: number;
};
};
retail: {
value: number;
confidence: 'High' | 'Medium' | 'Low';
range: {
min: number;
max: number;
};
};
private: {
value: number;
confidence: 'High' | 'Medium' | 'Low';
range: {
min: number;
max: number;
};
};
};
marketData: {
averagePrice: number;
marketPosition: 'Above Average' | 'Average' | 'Below Average';
similarVehiclesCount: number;
daysToSell: number;
};
adjustments: Array<{
factor: string;
impact: number;
description: string;
}>;
lastUpdated: string;
}
/**
* Get vehicle valuation
* @param request Valuation request parameters
* @returns Promise resolving to valuation data
*/
export declare function getValuation(request: ValuationRequest): Promise<ValuationResponse>;
/**
* Get quick valuation by registration
* @param registration Vehicle registration number
* @param mileage Current mileage
* @param postcode Optional postcode for location-based pricing
* @returns Promise resolving to quick valuation
*/
export declare function getQuickValuation(registration: string, mileage: number, postcode?: string): Promise<ValuationResponse>;
/**
* Get batch valuations for multiple vehicles
* @param requests Array of valuation requests
* @returns Promise resolving to array of valuations
*/
export declare function getBatchValuations(requests: ValuationRequest[]): Promise<ValuationResponse[]>;
/**
* Get historical valuation data
* @param request Valuation request parameters
* @param period Period for historical data ('6m', '1y', '2y', '5y')
* @returns Promise resolving to historical valuation data
*/
export declare function getHistoricalValuation(request: ValuationRequest, period?: '6m' | '1y' | '2y' | '5y'): Promise<{
vehicle: ValuationRequest;
history: Array<{
date: string;
tradeValue: number;
retailValue: number;
privateValue: number;
marketEvents?: string[];
}>;
trends: {
trade: {
trend: 'up' | 'down' | 'stable';
change: number;
};
retail: {
trend: 'up' | 'down' | 'stable';
change: number;
};
private: {
trend: 'up' | 'down' | 'stable';
change: number;
};
};
forecast: Array<{
months: number;
estimatedValue: number;
confidence: 'High' | 'Medium' | 'Low';
}>;
}>;
//# sourceMappingURL=valuations.d.ts.map