Parametri di ricerca — GET /cars
Combinateli liberamente in una sola chiamata. La risposta porta total, page, count e results[], quindi potete paginare su total senza una seconda richiesta.
| parameter | what it does |
|---|---|
| manufacturer | Brand, as Encar writes it: BMW, Hyundai, Kia, Genesis, Mercedes-Benz, Audi. |
| model | Model name, e.g. X5 (G05). Partial names match, and a generation name narrows further: model=The New Carnival returns that generation alone, not the whole nameplate. |
| q | Free-text search across brand, model and badge. Aliases: keyword, search. |
| fuel | diesel · gasoline · hybrid · electric · lpg. |
| transmission | automatic · manual. |
| color | Exterior colour. |
| seats | Seat count: 5, 7, 9. Several at once as seats=7,9. The two ends are ranges, not counts — 2 means two seats or fewer and 10 means ten or more, which is how the source files them. A car's own figure comes back as details.seats from /car. |
| yearFrom / yearTo | Model year bounds, as plain years: 2018, 2024. |
| mileageFrom / mileageTo | Odometer bounds in kilometres. |
| priceFrom / priceTo | Price bounds in EUR — converted for you, not won. |
| sort | priceAsc or priceDesc. Left out, results come back newest first. |
| page | Page index, zero-based. Default 0. |
| count | Listings per page. Default 24, maximum 500. |
I parametri sconosciuti vengono ignorati anziché rifiutati: aggiungere un filtro che il vostro piano non supporta non romperà un'integrazione esistente, semplicemente non restringerà il risultato.
Un esempio svolto
BMW X5 diesel sotto i 40.000 €, prima le più economiche, 24 per pagina. L'intera query è l'URL.
curl -H "x-api-key: avg_free_..." \
"https://api.encar-api.com/api/cars?manufacturer=BMW&model=X5\
&fuel=diesel&priceTo=40000&sort=priceAsc&count=24"Ottieni la tua chiave API
Gratis · 100 richieste al giorno
Da leggere dopo
I dati arrivano da una fonte coreana, quindi quattro di questi campi vengono letti male per impostazione predefinita. Ogni errore è silenzioso: la vostra pagina si disegna, è solo sbagliata.
Ogni risposta porta X-RateLimit-Limit, X-RateLimit-Remaining e X-RateLimit-Reset: vedete arrivare un limite invece di scoprirlo.
Se manca qualcosa, scriveteci: al numero in fondo risponde una persona.