UNPKG

@carapis/api

Version:

Universal TypeScript/JavaScript client for CARAPIS Vehicles API - Access automotive data from 25+ global marketplaces including Cars.com, AutoScout24, Encar, Auto.ru, and more. Enterprise-grade automotive data extraction with real-time vehicle listings, p

1,661 lines (1,655 loc) 141 kB
type AuthToken = string | undefined; interface Auth { /** * Which part of the request do we use to send the auth? * * @default 'header' */ in?: "header" | "query" | "cookie"; /** * Header or query parameter name. * * @default 'Authorization' */ name?: string; scheme?: "basic" | "bearer"; type: "apiKey" | "http"; } interface SerializerOptions<T> { /** * @default true */ explode: boolean; style: T; } type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited"; type ObjectStyle = "form" | "deepObject"; type QuerySerializer = (query: Record<string, unknown>) => string; type BodySerializer = (body: any) => any; interface QuerySerializerOptions { allowReserved?: boolean; array?: SerializerOptions<ArrayStyle>; object?: SerializerOptions<ObjectStyle>; } interface Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never> { /** * Returns the final request URL. */ buildUrl: BuildUrlFn; connect: MethodFn; delete: MethodFn; get: MethodFn; getConfig: () => Config; head: MethodFn; options: MethodFn; patch: MethodFn; post: MethodFn; put: MethodFn; request: RequestFn; setConfig: (config: Config) => Config; trace: MethodFn; } interface Config$1 { /** * Auth token or a function returning auth token. The resolved value will be * added to the request payload as defined by its `security` array. */ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken; /** * A function for serializing request body parameter. By default, * {@link JSON.stringify()} will be used. */ bodySerializer?: BodySerializer | null; /** * An object containing any HTTP headers that you want to pre-populate your * `Headers` object with. * * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} */ headers?: RequestInit["headers"] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>; /** * The request method. * * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} */ method?: "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE"; /** * A function for serializing request query parameters. By default, arrays * will be exploded in form style, objects will be exploded in deepObject * style, and reserved characters are percent-encoded. * * This method will have no effect if the native `paramsSerializer()` Axios * API function is used. * * {@link https://swagger.io/docs/specification/serialization/#query View examples} */ querySerializer?: QuerySerializer | QuerySerializerOptions; /** * A function validating request data. This is useful if you want to ensure * the request conforms to the desired shape, so it can be safely sent to * the server. */ requestValidator?: (data: unknown) => Promise<unknown>; /** * A function transforming response data before it's returned. This is useful * for post-processing data, e.g. converting ISO strings into Date objects. */ responseTransformer?: (data: unknown) => Promise<unknown>; /** * A function validating response data. This is useful if you want to ensure * the response conforms to the desired shape, so it can be safely passed to * the transformers and returned to the user. */ responseValidator?: (data: unknown) => Promise<unknown>; } type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>; type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>; type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>; declare class Interceptors<Interceptor> { _fns: (Interceptor | null)[]; constructor(); clear(): void; getInterceptorIndex(id: number | Interceptor): number; exists(id: number | Interceptor): boolean; eject(id: number | Interceptor): void; update(id: number | Interceptor, fn: Interceptor): number | false | Interceptor; use(fn: Interceptor): number; } interface Middleware<Req, Res, Err, Options> { error: Pick<Interceptors<ErrInterceptor<Err, Res, Req, Options>>, "eject" | "use">; request: Pick<Interceptors<ReqInterceptor<Req, Options>>, "eject" | "use">; response: Pick<Interceptors<ResInterceptor<Res, Req, Options>>, "eject" | "use">; } type ResponseStyle = "data" | "fields"; interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<RequestInit, "body" | "headers" | "method">, Config$1 { /** * Base URL for all requests made by this client. */ baseUrl?: T["baseUrl"]; /** * Fetch API implementation. You can use this option to provide a custom * fetch instance. * * @default globalThis.fetch */ fetch?: (request: Request) => ReturnType<typeof fetch>; /** * Please don't use the Fetch client for Next.js applications. The `next` * options won't have any effect. * * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. */ next?: never; /** * Return the response data parsed in a specified format. By default, `auto` * will infer the appropriate method from the `Content-Type` response header. * You can override this behavior with any of the {@link Body} methods. * Select `stream` if you don't want to parse response data at all. * * @default 'auto' */ parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text"; /** * Should we return only data or multiple fields (data, error, response, etc.)? * * @default 'fields' */ responseStyle?: ResponseStyle; /** * Throw an error instead of returning it in the response? * * @default false */ throwOnError?: T["throwOnError"]; } interface RequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{ responseStyle: TResponseStyle; throwOnError: ThrowOnError; }> { /** * Any body that you want to add to your request. * * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} */ body?: unknown; path?: Record<string, unknown>; query?: Record<string, unknown>; /** * Security mechanism(s) to use for the request. */ security?: ReadonlyArray<Auth>; url: Url; } interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<TResponseStyle, ThrowOnError, Url> { serializedBody?: string; } type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = ThrowOnError extends true ? Promise<TResponseStyle extends "data" ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : { data: TData extends Record<string, unknown> ? TData[keyof TData] : TData; request: Request; response: Response; }> : Promise<TResponseStyle extends "data" ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData; error: undefined; } | { data: undefined; error: TError extends Record<string, unknown> ? TError[keyof TError] : TError; }) & { request: Request; response: Response; }>; interface ClientOptions$1 { baseUrl?: string; responseStyle?: ResponseStyle; throwOnError?: boolean; } type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>; type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>; type BuildUrlFn = <TData extends { body?: unknown; path?: Record<string, unknown>; query?: Record<string, unknown>; url: string; }>(options: Pick<TData, "url"> & Options$1<TData>) => string; type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn> & { interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>; }; interface TDataShape { body?: unknown; headers?: unknown; path?: unknown; query?: unknown; url: string; } type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>; type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = OmitKeys<RequestOptions<TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> & Omit<TData, "url">; type PaginatedV1BrandList = { count: number; next?: string | null; previous?: string | null; results: Array<V1Brand>; }; type PaginatedV1SourceList = { count: number; next?: string | null; previous?: string | null; results: Array<V1Source>; }; type PaginatedV1VehicleListList = { count: number; next?: string | null; previous?: string | null; results: Array<V1VehicleList>; }; type PaginatedV1VehicleModelList = { count: number; next?: string | null; previous?: string | null; results: Array<V1VehicleModel>; }; /** * API information response */ type V1ApiInfoResponse = { name: string; version: string; description: string; endpoints: { [key: string]: unknown; }; features: Array<string>; rate_limits: { [key: string]: unknown; }; data_sources: Array<{ [key: string]: unknown; }>; support_email?: string; documentation_url?: string; status: string; uptime?: string; }; /** * Brand information serializer */ type V1Brand = { readonly id: number; /** * Brand Code */ code: string; /** * Brand Name */ name: string; readonly slug: string; /** * Country of Origin */ country_origin?: string; logo_url?: string; readonly total_models: number; readonly total_vehicles: number; readonly vehicle_count: number; readonly created_at: string; readonly updated_at: string; }; /** * Brand comparison statistics serializer */ type V1BrandComparisonStats = { brands: Array<{ [key: string]: unknown; }>; comparison_count: number; }; /** * Price trends analysis serializer */ type V1PriceTrends = { by_fuel_type: { [key: string]: unknown; }; by_body_type: { [key: string]: unknown; }; by_year_range: { [key: string]: unknown; }; analysis: { [key: string]: unknown; }; }; /** * Quality insights serializer */ type V1QualityInsights = { investment_grades: { [key: string]: unknown; }; risk_levels: { [key: string]: unknown; }; brand_quality_ranking: Array<{ [key: string]: unknown; }>; insights: { [key: string]: unknown; }; }; /** * Source information serializer */ type V1Source = { readonly id: number; /** * Source Code * Unique identifier for the parser source (e.g., 'encar', 'che168') */ code: string; /** * Source Name * Human-readable name (e.g., 'Encar Korea', 'Che168 China') */ name: string; /** * Country where this source operates */ country: string; readonly flag_emoji: string; /** * Main website URL of the source */ website_url?: string; /** * Default Currency * * `KRW` - ₩ Korean Won * * `USD` - $ US Dollar * * `JPY` - ¥ Japanese Yen * * `EUR` - € Euro * * `CNY` - ¥ Chinese Yuan * * `RUB` - ₽ Russian Ruble * * `other` - Other */ currency?: "KRW" | "USD" | "JPY" | "EUR" | "CNY" | "RUB" | "other"; timezone?: string; /** * Total number of vehicles from this source */ readonly total_vehicles: number; /** * Number of currently active vehicles */ readonly active_vehicles: number; readonly last_parsed_at: string | null; readonly created_at: string; readonly updated_at: string; }; /** * Main statistics response serializer */ type V1Statistics = { overview: { [key: string]: unknown; }; price_statistics: { [key: string]: unknown; }; year_statistics: { [key: string]: unknown; }; top_brands: Array<{ [key: string]: unknown; }>; top_sources: Array<{ [key: string]: unknown; }>; quality_distribution: { [key: string]: unknown; }; }; /** * Complete vehicle serializer for detail views. * Includes all available information and related data. */ type V1VehicleDetail = { readonly id: string; /** * Original listing ID from source */ listing_id: string; /** * Direct URL to the listing */ source_url?: string; readonly source_name: string; readonly source_country: string; readonly source_flag: string; readonly source_currency: string; readonly brand_name: string; readonly brand_country: string; readonly brand_logo: string; readonly model_name: string; readonly model_segment: string; readonly full_name: string; title?: string; year?: number | null; price?: number; /** * * `KRW` - ₩ Korean Won * * `USD` - $ US Dollar * * `JPY` - ¥ Japanese Yen * * `EUR` - € Euro * * `CNY` - ¥ Chinese Yuan * * `RUB` - ₽ Russian Ruble * * `other` - Other */ price_currency?: "KRW" | "USD" | "JPY" | "EUR" | "CNY" | "RUB" | "other"; /** * Convert price to USD using currency service */ readonly price_usd: number; /** * Mileage (km) */ mileage?: number; /** * Engine Volume (cc) */ engine_volume?: number | null; /** * * `gasoline` - ⛽ Gasoline * * `diesel` - 🛢️ Diesel * * `hybrid` - 🔋 Hybrid * * `plug_hybrid` - 🔌 Plug-in Hybrid * * `electric` - ⚡ Electric * * `hydrogen` - 💨 Hydrogen * * `cng` - 💨 CNG * * `lpg` - 🔥 LPG * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ fuel_type?: "gasoline" | "diesel" | "hybrid" | "plug_hybrid" | "electric" | "hydrogen" | "cng" | "lpg" | "other" | "unknown" | ""; /** * * `manual` - Manual * * `auto` - Automatic * * `cvt` - CVT * * `semi_auto` - Semi-Auto * * `dct` - DCT * * `other` - Other * * `unknown` - Unknown */ transmission?: "manual" | "auto" | "cvt" | "semi_auto" | "dct" | "other" | "unknown" | ""; /** * * `sedan` - 🚗 Sedan * * `hatchback` - 🚙 Hatchback * * `coupe` - 🏎️ Coupe * * `convertible` - 🏎️ Convertible * * `suv` - 🚐 SUV * * `wagon` - 🚛 Wagon * * `pickup` - 🛻 Pickup * * `van` - 🚐 Van * * `minivan` - 🚌 Minivan * * `crossover` - 🚙 Crossover * * `truck` - 🚚 Truck * * `bus` - 🚌 Bus * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ body_type?: "sedan" | "hatchback" | "coupe" | "convertible" | "suv" | "wagon" | "pickup" | "van" | "minivan" | "crossover" | "truck" | "bus" | "other" | "unknown" | ""; /** * * `white` - ⚪ White * * `black` - ⚫ Black * * `gray` - 🔘 Gray * * `silver` - 🔘 Silver * * `red` - 🔴 Red * * `blue` - 🔵 Blue * * `yellow` - 🟡 Yellow * * `green` - 🟢 Green * * `brown` - 🟤 Brown * * `purple` - 🟣 Purple * * `orange` - 🟠 Orange * * `pink` - 🩷 Pink * * `gold` - 🟡 Gold * * `beige` - 🟤 Beige * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ color?: "white" | "black" | "gray" | "silver" | "red" | "blue" | "yellow" | "green" | "brown" | "purple" | "orange" | "pink" | "gold" | "beige" | "other" | "unknown" | ""; location?: string; dealer_name?: string; /** * * `active` - ✅ Active * * `sold` - 💰 Sold * * `reserved` - ⏳ Reserved * * `inactive` - ❌ Inactive */ status?: "active" | "sold" | "reserved" | "inactive"; /** * * `A+` - A+ (Excellent) * * `A` - A (Very Good) * * `A-` - A- (Good Plus) * * `B+` - B+ (Good) * * `B` - B (Above Average) * * `B-` - B- (Average Plus) * * `C+` - C+ (Average) * * `C` - C (Below Average) * * `C-` - C- (Poor Plus) * * `D` - D (Poor) * * `F` - F (Avoid) */ investment_grade?: "A+" | "A" | "A-" | "B+" | "B" | "B-" | "C+" | "C" | "C-" | "D" | "F" | ""; /** * * `very_low` - Very Low * * `low` - Low * * `medium` - Medium * * `high` - High * * `very_high` - Very High */ risk_level?: "very_low" | "low" | "medium" | "high" | "very_high" | ""; llm_confidence?: number | null; llm_analysis_date?: string | null; readonly has_major_issues: string; accident_count?: number; owner_count?: number; readonly photos: Array<V1VehiclePhoto>; /** * Get total photos count */ readonly photos_count: number; /** * Get count of similar vehicles */ readonly similar_count: number; readonly created_at: string; readonly updated_at: string; /** * When this vehicle was last parsed from source */ parsed_at?: string | null; }; /** * Serializer for vehicle data export (CSV, Excel). * Includes all essential fields in flat structure. */ type V1VehicleExport = { /** * Original listing ID from source */ listing_id: string; readonly source_name: string; readonly brand_name: string; readonly model_name: string; readonly full_name: string; year?: number | null; price?: number; /** * * `KRW` - ₩ Korean Won * * `USD` - $ US Dollar * * `JPY` - ¥ Japanese Yen * * `EUR` - € Euro * * `CNY` - ¥ Chinese Yuan * * `RUB` - ₽ Russian Ruble * * `other` - Other */ price_currency?: "KRW" | "USD" | "JPY" | "EUR" | "CNY" | "RUB" | "other"; /** * Convert price to USD using currency service */ readonly price_usd: number; /** * Mileage (km) */ mileage?: number; /** * * `gasoline` - ⛽ Gasoline * * `diesel` - 🛢️ Diesel * * `hybrid` - 🔋 Hybrid * * `plug_hybrid` - 🔌 Plug-in Hybrid * * `electric` - ⚡ Electric * * `hydrogen` - 💨 Hydrogen * * `cng` - 💨 CNG * * `lpg` - 🔥 LPG * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ fuel_type?: "gasoline" | "diesel" | "hybrid" | "plug_hybrid" | "electric" | "hydrogen" | "cng" | "lpg" | "other" | "unknown" | ""; /** * * `manual` - Manual * * `auto` - Automatic * * `cvt` - CVT * * `semi_auto` - Semi-Auto * * `dct` - DCT * * `other` - Other * * `unknown` - Unknown */ transmission?: "manual" | "auto" | "cvt" | "semi_auto" | "dct" | "other" | "unknown" | ""; /** * * `sedan` - 🚗 Sedan * * `hatchback` - 🚙 Hatchback * * `coupe` - 🏎️ Coupe * * `convertible` - 🏎️ Convertible * * `suv` - 🚐 SUV * * `wagon` - 🚛 Wagon * * `pickup` - 🛻 Pickup * * `van` - 🚐 Van * * `minivan` - 🚌 Minivan * * `crossover` - 🚙 Crossover * * `truck` - 🚚 Truck * * `bus` - 🚌 Bus * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ body_type?: "sedan" | "hatchback" | "coupe" | "convertible" | "suv" | "wagon" | "pickup" | "van" | "minivan" | "crossover" | "truck" | "bus" | "other" | "unknown" | ""; /** * * `white` - ⚪ White * * `black` - ⚫ Black * * `gray` - 🔘 Gray * * `silver` - 🔘 Silver * * `red` - 🔴 Red * * `blue` - 🔵 Blue * * `yellow` - 🟡 Yellow * * `green` - 🟢 Green * * `brown` - 🟤 Brown * * `purple` - 🟣 Purple * * `orange` - 🟠 Orange * * `pink` - 🩷 Pink * * `gold` - 🟡 Gold * * `beige` - 🟤 Beige * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ color?: "white" | "black" | "gray" | "silver" | "red" | "blue" | "yellow" | "green" | "brown" | "purple" | "orange" | "pink" | "gold" | "beige" | "other" | "unknown" | ""; location?: string; dealer_name?: string; /** * * `A+` - A+ (Excellent) * * `A` - A (Very Good) * * `A-` - A- (Good Plus) * * `B+` - B+ (Good) * * `B` - B (Above Average) * * `B-` - B- (Average Plus) * * `C+` - C+ (Average) * * `C` - C (Below Average) * * `C-` - C- (Poor Plus) * * `D` - D (Poor) * * `F` - F (Avoid) */ investment_grade?: "A+" | "A" | "A-" | "B+" | "B" | "B-" | "C+" | "C" | "C-" | "D" | "F" | ""; /** * * `very_low` - Very Low * * `low` - Low * * `medium` - Medium * * `high` - High * * `very_high` - Very High */ risk_level?: "very_low" | "low" | "medium" | "high" | "very_high" | ""; accident_count?: number; owner_count?: number; /** * * `active` - ✅ Active * * `sold` - 💰 Sold * * `reserved` - ⏳ Reserved * * `inactive` - ❌ Inactive */ status?: "active" | "sold" | "reserved" | "inactive"; readonly created_at: string; }; /** * Lightweight vehicle serializer for list views. * Optimized for performance with minimal data. */ type V1VehicleList = { readonly id: string; /** * Original listing ID from source */ listing_id: string; readonly source_name: string; readonly source_country: string; readonly source_flag: string; readonly brand_name: string; readonly model_name: string; readonly full_name: string; title?: string; year?: number | null; price?: number; /** * * `KRW` - ₩ Korean Won * * `USD` - $ US Dollar * * `JPY` - ¥ Japanese Yen * * `EUR` - € Euro * * `CNY` - ¥ Chinese Yuan * * `RUB` - ₽ Russian Ruble * * `other` - Other */ price_currency?: "KRW" | "USD" | "JPY" | "EUR" | "CNY" | "RUB" | "other"; /** * Convert price to USD using currency service */ readonly price_usd: number; /** * Mileage (km) */ mileage?: number; /** * * `gasoline` - ⛽ Gasoline * * `diesel` - 🛢️ Diesel * * `hybrid` - 🔋 Hybrid * * `plug_hybrid` - 🔌 Plug-in Hybrid * * `electric` - ⚡ Electric * * `hydrogen` - 💨 Hydrogen * * `cng` - 💨 CNG * * `lpg` - 🔥 LPG * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ fuel_type?: "gasoline" | "diesel" | "hybrid" | "plug_hybrid" | "electric" | "hydrogen" | "cng" | "lpg" | "other" | "unknown" | ""; /** * * `manual` - Manual * * `auto` - Automatic * * `cvt` - CVT * * `semi_auto` - Semi-Auto * * `dct` - DCT * * `other` - Other * * `unknown` - Unknown */ transmission?: "manual" | "auto" | "cvt" | "semi_auto" | "dct" | "other" | "unknown" | ""; /** * * `sedan` - 🚗 Sedan * * `hatchback` - 🚙 Hatchback * * `coupe` - 🏎️ Coupe * * `convertible` - 🏎️ Convertible * * `suv` - 🚐 SUV * * `wagon` - 🚛 Wagon * * `pickup` - 🛻 Pickup * * `van` - 🚐 Van * * `minivan` - 🚌 Minivan * * `crossover` - 🚙 Crossover * * `truck` - 🚚 Truck * * `bus` - 🚌 Bus * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ body_type?: "sedan" | "hatchback" | "coupe" | "convertible" | "suv" | "wagon" | "pickup" | "van" | "minivan" | "crossover" | "truck" | "bus" | "other" | "unknown" | ""; /** * * `white` - ⚪ White * * `black` - ⚫ Black * * `gray` - 🔘 Gray * * `silver` - 🔘 Silver * * `red` - 🔴 Red * * `blue` - 🔵 Blue * * `yellow` - 🟡 Yellow * * `green` - 🟢 Green * * `brown` - 🟤 Brown * * `purple` - 🟣 Purple * * `orange` - 🟠 Orange * * `pink` - 🩷 Pink * * `gold` - 🟡 Gold * * `beige` - 🟤 Beige * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ color?: "white" | "black" | "gray" | "silver" | "red" | "blue" | "yellow" | "green" | "brown" | "purple" | "orange" | "pink" | "gold" | "beige" | "other" | "unknown" | ""; location?: string; dealer_name?: string; /** * * `A+` - A+ (Excellent) * * `A` - A (Very Good) * * `A-` - A- (Good Plus) * * `B+` - B+ (Good) * * `B` - B (Above Average) * * `B-` - B- (Average Plus) * * `C+` - C+ (Average) * * `C` - C (Below Average) * * `C-` - C- (Poor Plus) * * `D` - D (Poor) * * `F` - F (Avoid) */ investment_grade?: "A+" | "A" | "A-" | "B+" | "B" | "B-" | "C+" | "C" | "C-" | "D" | "F" | ""; /** * * `very_low` - Very Low * * `low` - Low * * `medium` - Medium * * `high` - High * * `very_high` - Very High */ risk_level?: "very_low" | "low" | "medium" | "high" | "very_high" | ""; readonly has_major_issues: string; /** * Get main photo information with proxied URL */ readonly main_photo: { [key: string]: unknown; } | null; /** * Get total photos count */ readonly photos_count: number; readonly created_at: string; readonly updated_at: string; }; /** * Vehicle model information serializer */ type V1VehicleModel = { readonly id: number; /** * Model Code */ code: string; /** * Model Name */ name: string; readonly slug: string; brand: number; readonly brand_name: string; readonly brand_country: string; /** * Primary Body Type * * `sedan` - 🚗 Sedan * * `hatchback` - 🚙 Hatchback * * `coupe` - 🏎️ Coupe * * `convertible` - 🏎️ Convertible * * `suv` - 🚐 SUV * * `wagon` - 🚛 Wagon * * `pickup` - 🛻 Pickup * * `van` - 🚐 Van * * `minivan` - 🚌 Minivan * * `crossover` - 🚙 Crossover * * `truck` - 🚚 Truck * * `bus` - 🚌 Bus * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ body_type?: "sedan" | "hatchback" | "coupe" | "convertible" | "suv" | "wagon" | "pickup" | "van" | "minivan" | "crossover" | "truck" | "bus" | "other" | "unknown" | ""; /** * Market Segment * e.g., Compact, Mid-size, Luxury */ segment?: string; readonly total_vehicles: number; readonly vehicle_count: number; readonly created_at: string; readonly updated_at: string; }; /** * Lightweight photo serializer for API responses with image proxy support */ type V1VehiclePhoto = { /** * UUID for image proxy URLs */ readonly uuid: string; /** * * `exterior` - 🚗 Exterior * * `interior` - 🪑 Interior * * `engine` - 🔧 Engine * * `trunk` - 📦 Trunk * * `wheel` - ⚙️ Wheel * * `dashboard` - 📊 Dashboard * * `damage` - ⚠️ Damage * * `document` - 📄 Document * * `other` - ❓ Other */ photo_type?: "exterior" | "interior" | "engine" | "trunk" | "wheel" | "dashboard" | "damage" | "document" | "other"; /** * Display order of the photo */ sequence?: number; /** * Is Main Photo */ is_main?: boolean; /** * Get proxied photo URL */ readonly url: string | null; /** * Get proxied thumbnail URL */ readonly thumbnail_url: string | null; /** * Width (px) */ width?: number | null; /** * Height (px) */ height?: number | null; }; /** * Serializer for vehicle statistics responses */ type V1VehicleStats = { total_count: number; avg_price: number | null; avg_price_usd: number | null; avg_mileage: number | null; avg_year: number | null; by_fuel_type: { [key: string]: unknown; }; by_transmission: { [key: string]: unknown; }; by_body_type: { [key: string]: unknown; }; by_color: { [key: string]: unknown; }; by_brand: { [key: string]: unknown; }; by_investment_grade: { [key: string]: unknown; }; by_risk_level: { [key: string]: unknown; }; price_ranges: { [key: string]: unknown; }; year_distribution: { [key: string]: unknown; }; quality_metrics: { [key: string]: unknown; }; }; type VehiclesApiImageRetrieveData = { body?: never; path: { image_uuid: string; }; query?: never; url: "/api/vehicles_api/image/{image_uuid}/"; }; type VehiclesApiImageRetrieveResponses = { /** * No response body */ 200: unknown; }; type VehiclesApiV1RetrieveData = { body?: never; path?: never; query?: never; url: "/api/vehicles_api/v1/"; }; type VehiclesApiV1RetrieveResponses = { 200: V1ApiInfoResponse; }; type VehiclesApiV1RetrieveResponse = VehiclesApiV1RetrieveResponses[keyof VehiclesApiV1RetrieveResponses]; type VehiclesApiV1BrandsListData = { body?: never; path?: never; query?: { code?: string; code__icontains?: string; /** * Country of origin contains */ country_origin?: string; /** * Has models */ has_models?: boolean; /** * Has vehicles */ has_vehicles?: boolean; /** * Is active */ is_active?: boolean; name__icontains?: string; /** * A page number within the paginated result set. */ page?: number; /** * Number of results to return per page. */ page_size?: number; /** * A search term. */ search?: string; }; url: "/api/vehicles_api/v1/brands/"; }; type VehiclesApiV1BrandsListResponses = { 200: PaginatedV1BrandList; }; type VehiclesApiV1BrandsListResponse = VehiclesApiV1BrandsListResponses[keyof VehiclesApiV1BrandsListResponses]; type VehiclesApiV1BrandsModelsListData = { body?: never; path: { brand_id: string; }; query?: { /** * A page number within the paginated result set. */ page?: number; /** * Number of results to return per page. */ page_size?: number; /** * A search term. */ search?: string; }; url: "/api/vehicles_api/v1/brands/{brand_id}/models/"; }; type VehiclesApiV1BrandsModelsListResponses = { 200: PaginatedV1VehicleModelList; }; type VehiclesApiV1BrandsModelsListResponse = VehiclesApiV1BrandsModelsListResponses[keyof VehiclesApiV1BrandsModelsListResponses]; type VehiclesApiV1BrandsModelsVehiclesListData = { body?: never; path: { brand_id: string; model_id: string; }; query?: { /** * Which field to use when ordering the results. */ ordering?: string; /** * A page number within the paginated result set. */ page?: number; /** * Number of results to return per page. */ page_size?: number; /** * A search term. */ search?: string; }; url: "/api/vehicles_api/v1/brands/{brand_id}/models/{model_id}/vehicles/"; }; type VehiclesApiV1BrandsModelsVehiclesListResponses = { 200: PaginatedV1VehicleListList; }; type VehiclesApiV1BrandsModelsVehiclesListResponse = VehiclesApiV1BrandsModelsVehiclesListResponses[keyof VehiclesApiV1BrandsModelsVehiclesListResponses]; type VehiclesApiV1BrandsModelsVehiclesRetrieveData = { body?: never; path: { brand_id: string; id: string; model_id: string; }; query?: never; url: "/api/vehicles_api/v1/brands/{brand_id}/models/{model_id}/vehicles/{id}/"; }; type VehiclesApiV1BrandsModelsVehiclesRetrieveResponses = { 200: V1VehicleList; }; type VehiclesApiV1BrandsModelsVehiclesRetrieveResponse = VehiclesApiV1BrandsModelsVehiclesRetrieveResponses[keyof VehiclesApiV1BrandsModelsVehiclesRetrieveResponses]; type VehiclesApiV1BrandsModelsVehiclesCacheInfoRetrieveData = { body?: never; path: { brand_id: string; model_id: string; }; query?: never; url: "/api/vehicles_api/v1/brands/{brand_id}/models/{model_id}/vehicles/cache-info/"; }; type VehiclesApiV1BrandsModelsVehiclesCacheInfoRetrieveResponses = { 200: V1VehicleList; }; type VehiclesApiV1BrandsModelsVehiclesCacheInfoRetrieveResponse = VehiclesApiV1BrandsModelsVehiclesCacheInfoRetrieveResponses[keyof VehiclesApiV1BrandsModelsVehiclesCacheInfoRetrieveResponses]; type VehiclesApiV1BrandsModelsRetrieveData = { body?: never; path: { brand_id: string; id: string; }; query?: never; url: "/api/vehicles_api/v1/brands/{brand_id}/models/{id}/"; }; type VehiclesApiV1BrandsModelsRetrieveResponses = { 200: V1VehicleModel; }; type VehiclesApiV1BrandsModelsRetrieveResponse = VehiclesApiV1BrandsModelsRetrieveResponses[keyof VehiclesApiV1BrandsModelsRetrieveResponses]; type VehiclesApiV1BrandsModelsCacheInfoRetrieveData = { body?: never; path: { brand_id: string; }; query?: never; url: "/api/vehicles_api/v1/brands/{brand_id}/models/cache-info/"; }; type VehiclesApiV1BrandsModelsCacheInfoRetrieveResponses = { 200: V1VehicleModel; }; type VehiclesApiV1BrandsModelsCacheInfoRetrieveResponse = VehiclesApiV1BrandsModelsCacheInfoRetrieveResponses[keyof VehiclesApiV1BrandsModelsCacheInfoRetrieveResponses]; type VehiclesApiV1BrandsVehiclesListData = { body?: never; path: { brand_id: string; }; query?: { /** * Which field to use when ordering the results. */ ordering?: string; /** * A page number within the paginated result set. */ page?: number; /** * Number of results to return per page. */ page_size?: number; /** * A search term. */ search?: string; }; url: "/api/vehicles_api/v1/brands/{brand_id}/vehicles/"; }; type VehiclesApiV1BrandsVehiclesListResponses = { 200: PaginatedV1VehicleListList; }; type VehiclesApiV1BrandsVehiclesListResponse = VehiclesApiV1BrandsVehiclesListResponses[keyof VehiclesApiV1BrandsVehiclesListResponses]; type VehiclesApiV1BrandsVehiclesRetrieveData = { body?: never; path: { brand_id: string; id: string; }; query?: never; url: "/api/vehicles_api/v1/brands/{brand_id}/vehicles/{id}/"; }; type VehiclesApiV1BrandsVehiclesRetrieveResponses = { 200: V1VehicleList; }; type VehiclesApiV1BrandsVehiclesRetrieveResponse = VehiclesApiV1BrandsVehiclesRetrieveResponses[keyof VehiclesApiV1BrandsVehiclesRetrieveResponses]; type VehiclesApiV1BrandsVehiclesCacheInfoRetrieveData = { body?: never; path: { brand_id: string; }; query?: never; url: "/api/vehicles_api/v1/brands/{brand_id}/vehicles/cache-info/"; }; type VehiclesApiV1BrandsVehiclesCacheInfoRetrieveResponses = { 200: V1VehicleList; }; type VehiclesApiV1BrandsVehiclesCacheInfoRetrieveResponse = VehiclesApiV1BrandsVehiclesCacheInfoRetrieveResponses[keyof VehiclesApiV1BrandsVehiclesCacheInfoRetrieveResponses]; type VehiclesApiV1BrandsRetrieveData = { body?: never; path: { /** * A unique integer value identifying this Brand. */ id: number; }; query?: never; url: "/api/vehicles_api/v1/brands/{id}/"; }; type VehiclesApiV1BrandsRetrieveResponses = { 200: V1Brand; }; type VehiclesApiV1BrandsRetrieveResponse = VehiclesApiV1BrandsRetrieveResponses[keyof VehiclesApiV1BrandsRetrieveResponses]; type VehiclesApiV1BrandsCacheInfoRetrieveData = { body?: never; path?: never; query?: never; url: "/api/vehicles_api/v1/brands/cache-info/"; }; type VehiclesApiV1BrandsCacheInfoRetrieveResponses = { 200: V1Brand; }; type VehiclesApiV1BrandsCacheInfoRetrieveResponse = VehiclesApiV1BrandsCacheInfoRetrieveResponses[keyof VehiclesApiV1BrandsCacheInfoRetrieveResponses]; type VehiclesApiV1SourcesListData = { body?: never; path?: never; query?: { code?: string; code__icontains?: string; /** * Country contains */ country?: string; /** * Default Currency * Currency * * * `KRW` - ₩ Korean Won * * `USD` - $ US Dollar * * `JPY` - ¥ Japanese Yen * * `EUR` - € Euro * * `CNY` - ¥ Chinese Yuan * * `RUB` - ₽ Russian Ruble * * `other` - Other */ currency?: "CNY" | "EUR" | "JPY" | "KRW" | "RUB" | "USD" | "other"; /** * Has vehicles */ has_vehicles?: boolean; /** * Is active */ is_active?: boolean; name__icontains?: string; /** * A page number within the paginated result set. */ page?: number; /** * Number of results to return per page. */ page_size?: number; /** * A search term. */ search?: string; }; url: "/api/vehicles_api/v1/sources/"; }; type VehiclesApiV1SourcesListResponses = { 200: PaginatedV1SourceList; }; type VehiclesApiV1SourcesListResponse = VehiclesApiV1SourcesListResponses[keyof VehiclesApiV1SourcesListResponses]; type VehiclesApiV1SourcesRetrieveData = { body?: never; path: { /** * A unique integer value identifying this Parser Source. */ id: number; }; query?: never; url: "/api/vehicles_api/v1/sources/{id}/"; }; type VehiclesApiV1SourcesRetrieveResponses = { 200: V1Source; }; type VehiclesApiV1SourcesRetrieveResponse = VehiclesApiV1SourcesRetrieveResponses[keyof VehiclesApiV1SourcesRetrieveResponses]; type VehiclesApiV1SourcesVehiclesListData = { body?: never; path: { source_id: string; }; query?: { /** * Which field to use when ordering the results. */ ordering?: string; /** * A page number within the paginated result set. */ page?: number; /** * Number of results to return per page. */ page_size?: number; /** * A search term. */ search?: string; }; url: "/api/vehicles_api/v1/sources/{source_id}/vehicles/"; }; type VehiclesApiV1SourcesVehiclesListResponses = { 200: PaginatedV1VehicleListList; }; type VehiclesApiV1SourcesVehiclesListResponse = VehiclesApiV1SourcesVehiclesListResponses[keyof VehiclesApiV1SourcesVehiclesListResponses]; type VehiclesApiV1SourcesVehiclesRetrieveData = { body?: never; path: { id: string; source_id: string; }; query?: never; url: "/api/vehicles_api/v1/sources/{source_id}/vehicles/{id}/"; }; type VehiclesApiV1SourcesVehiclesRetrieveResponses = { 200: V1VehicleList; }; type VehiclesApiV1SourcesVehiclesRetrieveResponse = VehiclesApiV1SourcesVehiclesRetrieveResponses[keyof VehiclesApiV1SourcesVehiclesRetrieveResponses]; type VehiclesApiV1SourcesVehiclesCacheInfoRetrieveData = { body?: never; path: { source_id: string; }; query?: never; url: "/api/vehicles_api/v1/sources/{source_id}/vehicles/cache-info/"; }; type VehiclesApiV1SourcesVehiclesCacheInfoRetrieveResponses = { 200: V1VehicleList; }; type VehiclesApiV1SourcesVehiclesCacheInfoRetrieveResponse = VehiclesApiV1SourcesVehiclesCacheInfoRetrieveResponses[keyof VehiclesApiV1SourcesVehiclesCacheInfoRetrieveResponses]; type VehiclesApiV1SourcesCacheInfoRetrieveData = { body?: never; path?: never; query?: never; url: "/api/vehicles_api/v1/sources/cache-info/"; }; type VehiclesApiV1SourcesCacheInfoRetrieveResponses = { 200: V1Source; }; type VehiclesApiV1SourcesCacheInfoRetrieveResponse = VehiclesApiV1SourcesCacheInfoRetrieveResponses[keyof VehiclesApiV1SourcesCacheInfoRetrieveResponses]; type VehiclesApiV1StatisticsBrandComparisonRetrieveData = { body?: never; path?: never; query?: never; url: "/api/vehicles_api/v1/statistics/brand_comparison/"; }; type VehiclesApiV1StatisticsBrandComparisonRetrieveResponses = { 200: V1BrandComparisonStats; }; type VehiclesApiV1StatisticsBrandComparisonRetrieveResponse = VehiclesApiV1StatisticsBrandComparisonRetrieveResponses[keyof VehiclesApiV1StatisticsBrandComparisonRetrieveResponses]; type VehiclesApiV1StatisticsMarketOverviewRetrieveData = { body?: never; path?: never; query?: never; url: "/api/vehicles_api/v1/statistics/market_overview/"; }; type VehiclesApiV1StatisticsMarketOverviewRetrieveResponses = { 200: V1Statistics; }; type VehiclesApiV1StatisticsMarketOverviewRetrieveResponse = VehiclesApiV1StatisticsMarketOverviewRetrieveResponses[keyof VehiclesApiV1StatisticsMarketOverviewRetrieveResponses]; type VehiclesApiV1StatisticsPriceTrendsRetrieveData = { body?: never; path?: never; query?: never; url: "/api/vehicles_api/v1/statistics/price_trends/"; }; type VehiclesApiV1StatisticsPriceTrendsRetrieveResponses = { 200: V1PriceTrends; }; type VehiclesApiV1StatisticsPriceTrendsRetrieveResponse = VehiclesApiV1StatisticsPriceTrendsRetrieveResponses[keyof VehiclesApiV1StatisticsPriceTrendsRetrieveResponses]; type VehiclesApiV1StatisticsQualityInsightsRetrieveData = { body?: never; path?: never; query?: never; url: "/api/vehicles_api/v1/statistics/quality_insights/"; }; type VehiclesApiV1StatisticsQualityInsightsRetrieveResponses = { 200: V1QualityInsights; }; type VehiclesApiV1StatisticsQualityInsightsRetrieveResponse = VehiclesApiV1StatisticsQualityInsightsRetrieveResponses[keyof VehiclesApiV1StatisticsQualityInsightsRetrieveResponses]; type VehiclesApiV1UrlsTestRetrieveData = { body?: never; path?: never; query?: never; url: "/api/vehicles_api/v1/urls-test/"; }; type VehiclesApiV1UrlsTestRetrieveResponses = { /** * No response body */ 200: unknown; }; type VehiclesApiV1VehiclesListData = { body?: never; path?: never; query?: { accident_count?: number; accident_count__lte?: number; /** * Body type * * * `sedan` - 🚗 Sedan * * `hatchback` - 🚙 Hatchback * * `coupe` - 🏎️ Coupe * * `convertible` - 🏎️ Convertible * * `suv` - 🚐 SUV * * `wagon` - 🚛 Wagon * * `pickup` - 🛻 Pickup * * `van` - 🚐 Van * * `minivan` - 🚌 Minivan * * `crossover` - 🚙 Crossover * * `truck` - 🚚 Truck * * `bus` - 🚌 Bus * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ body_type?: "bus" | "convertible" | "coupe" | "crossover" | "hatchback" | "minivan" | "other" | "pickup" | "sedan" | "suv" | "truck" | "unknown" | "van" | "wagon"; /** * Multiple body types * * * `sedan` - 🚗 Sedan * * `hatchback` - 🚙 Hatchback * * `coupe` - 🏎️ Coupe * * `convertible` - 🏎️ Convertible * * `suv` - 🚐 SUV * * `wagon` - 🚛 Wagon * * `pickup` - 🛻 Pickup * * `van` - 🚐 Van * * `minivan` - 🚌 Minivan * * `crossover` - 🚙 Crossover * * `truck` - 🚚 Truck * * `bus` - 🚌 Bus * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ body_types?: Array<"bus" | "convertible" | "coupe" | "crossover" | "hatchback" | "minivan" | "other" | "pickup" | "sedan" | "suv" | "truck" | "unknown" | "van" | "wagon">; /** * Brand code */ brand?: string; /** * Filter by brand code (e.g., 'BMW') */ brand_code?: string; /** * Color * * * `white` - ⚪ White * * `black` - ⚫ Black * * `gray` - 🔘 Gray * * `silver` - 🔘 Silver * * `red` - 🔴 Red * * `blue` - 🔵 Blue * * `yellow` - 🟡 Yellow * * `green` - 🟢 Green * * `brown` - 🟤 Brown * * `purple` - 🟣 Purple * * `orange` - 🟠 Orange * * `pink` - 🩷 Pink * * `gold` - 🟡 Gold * * `beige` - 🟤 Beige * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ color?: "beige" | "black" | "blue" | "brown" | "gold" | "gray" | "green" | "orange" | "other" | "pink" | "purple" | "red" | "silver" | "unknown" | "white" | "yellow"; /** * Multiple colors * * * `white` - ⚪ White * * `black` - ⚫ Black * * `gray` - 🔘 Gray * * `silver` - 🔘 Silver * * `red` - 🔴 Red * * `blue` - 🔵 Blue * * `yellow` - 🟡 Yellow * * `green` - 🟢 Green * * `brown` - 🟤 Brown * * `purple` - 🟣 Purple * * `orange` - 🟠 Orange * * `pink` - 🩷 Pink * * `gold` - 🟡 Gold * * `beige` - 🟤 Beige * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ colors?: Array<"beige" | "black" | "blue" | "brown" | "gold" | "gray" | "green" | "orange" | "other" | "pink" | "purple" | "red" | "silver" | "unknown" | "white" | "yellow">; /** * Source country */ country?: string; /** * Created after date */ created_after?: string; /** * Created before date */ created_before?: string; /** * Dealer name contains */ dealer?: string; /** * Maximum engine volume (cc) */ engine_volume_max?: number; /** * Minimum engine volume (cc) */ engine_volume_min?: number; /** * Fuel type */ fuel_type?: string; /** * Multiple fuel types (comma-separated) * * * `gasoline` - ⛽ Gasoline * * `diesel` - 🛢️ Diesel * * `hybrid` - 🔋 Hybrid * * `plug_hybrid` - 🔌 Plug-in Hybrid * * `electric` - ⚡ Electric * * `hydrogen` - 💨 Hydrogen * * `cng` - 💨 CNG * * `lpg` - 🔥 LPG * * `other` - ❓ Other * * `unknown` - ❓ Unknown */ fuel_types?: Array<"cng" | "diesel" | "electric" | "gasoline" | "hybrid" | "hydrogen" | "lpg" | "other" | "plug_hybrid" | "unknown">; /** * Has LLM analysis */ has_analysis?: boolean; /** * Has main photo */ has_main_photo?: boolean; /** * Has major issues */ has_major_issues?: boolean; /** * Has photos */ has_photos?: boolean; /** * High quality vehicles only (A grades) */ high_quality?: boolean; /** * Investment grade */ investment_grade?: string; /** * Multiple investment grades * * * `A+` - A+ (Excellent) * * `A` - A (Very Good) * * `A-` - A- (Good Plus) * * `B+` - B+ (Good) * * `B` - B (Above Average) * * `B-` - B- (Average Plus) * * `C+` - C+ (Average) * * `C` - C (Below Average) * * `C-` - C- (Poor Plus) * * `D` - D (Poor) * * `F` - F (Avoid) */ investment_grades?: Array<"A" | "A+" | "A-" | "B" | "B+" | "B-" | "C" | "C+" | "C-" | "D" | "F">; listing_id?: string; listing_id__icontains?: string; /** * Location contains */ location?: string; /** * Low risk vehicles only */ low_risk?: boolean; /** * Maximum mileage */ mileage_max?: number; /** * Mileage (km) * Mileage range */ mileage_range_max?: number; /** * Mileage (km) * Mileage range */ mileage_range_min?: number; /** * Filter by model ID */ model?: number; /** * Filter by model code */ model_code?: string; /** * Sort field */ ordering?: string; owner_count?: number; owner_count__lte?: number; /** * Page number for pagination */ page?: number; /** * Number of results per page (max 100) */ page_size?: number; /** * Parsed after date */ parsed_after?: string; /** * Maximum price */ price_max?: number; /** * Minimum price */ price_min?: number; /** * Price range */ price_range_max?: number; /** * Price range */ price_range_min?: number; /** * Maximum price in USD */ price_usd_max?: number; /** * Minimum price in USD */ price_usd_min?: number; /** * Risk level * * * `very_low` - Very Low * * `low` - Low * * `medium` - Medium * * `high` - High * * `very_high` - Very High */ risk_level?: "high" | "low" | "medium" | "very_high" | "very_low