Ruby gem for the auto-api.com car listings API — 8 marketplaces, one client.
encar, mobile.de, autoscout24, che168, dongchedi, guazi, dubicars, dubizzle. No dependencies beyond stdlib (net/http + json).
gem install auto-api-clientOr add to your Gemfile:
gem "auto-api-client"client = AutoApi::Client.new("your-api-key", "https://api1.auto-api.com")filters = client.get_filters("encar")offers = client.get_offers("mobilede", page: 1, brand: "BMW", year_from: 2020)
# Pagination
puts offers["meta"]["page"]
puts offers["meta"]["next_page"]offer = client.get_offer("encar", "40427050")change_id = client.get_change_id("encar", "2025-01-15")
changes = client.get_changes("encar", change_id)
# Next batch
next_batch = client.get_changes("encar", changes["meta"]["next_change_id"])info = client.get_offer_by_url("https://encar.com/dc/dc_cardetailview.do?carid=40427050")The data hash structure depends on the source — each marketplace has its own set of fields:
offers["result"].each do |item|
data = item["data"]
puts "#{data['mark']} #{data['model']} #{data['year']} — $#{data['price']}"
endbegin
offers = client.get_offers("encar", page: 1)
rescue AutoApi::AuthError => e
# 401/403 — invalid API key
puts "#{e.status_code}: #{e.message}"
rescue AutoApi::ApiError => e
# Any other API error
puts "#{e.status_code}: #{e.message}"
puts e.response_body
end| Source | Platform | Region |
|---|---|---|
encar |
encar.com | South Korea |
mobilede |
mobile.de | Germany |
autoscout24 |
autoscout24.com | Europe |
che168 |
che168.com | China |
dongchedi |
dongchedi.com | China |
guazi |
guazi.com | China |
dubicars |
dubicars.com | UAE |
dubizzle |
dubizzle.com | UAE |
| Language | Package |
|---|---|
| PHP | autoapi/client |
| TypeScript | @autoapicom/client |
| Python | autoapicom-client |
| Go | auto-api-go |
| C# | AutoApi.Client |
| Java | auto-api-client |
| Rust | auto-api-client |