Get started with CarsXE's Ruby gem to integrate comprehensive vehicle data into your Ruby applications.
The CarsXE Ruby gem provides a simple and powerful way to integrate vehicle data into your Ruby applications. This guide will help you get started quickly.
For more information, see the gem on RubyGems.
Install the CarsXE Ruby gem using gem or bundler:
gem install carsxe
Or add it to your Gemfile:
gem 'carsxe' Then run bundle install.
First, require the CarsXE client and initialize it with your API key:
require 'carsxe' # Initialize the client
API_KEY = 'YOUR_API_KEY_HERE'
carsxe = Carsxe::CarsXE.new(api_key: API_KEY)vin = 'WBAFR7C57CC811956'
begin
vehicle = carsxe.specs('vin' => vin)
puts vehicle['input']['vin']
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
intvin = carsxe.int_vin_decoder('vin' => 'WF0MXXGBWM8R43240')
puts intvin
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
marketvalue = carsxe.market_value('vin' => 'WBAFR7C57CC811956')
puts marketvalue
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
history = carsxe.history('vin' => 'WBAFR7C57CC811956')
puts history
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
decoded_plate = carsxe.plate_decoder('plate' => '7XER187', 'state' => 'CA', 'country' => 'US')
puts decoded_plate
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
images = carsxe.images('make' => 'BMW', 'model' => 'X5', 'year' => '2019')
puts images
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
recalls = carsxe.recalls('vin' => '1C4JJXR64PW696340')
puts recalls
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
plateimg = carsxe.plate_image_recognition('upload_url' =>
'https://imagedelivery.net/moyiiSImjJPI_EZVxNMBBw/f49aed53-d736-4370-f3f4-97418841c800/public')
puts plateimg
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
vinocr = carsxe.vin_ocr('upload_url' => 'https://imagedelivery.net/moyiiSImjJPI_EZVxNMBBw/f49aed53-d736-4370-f3f4-97418841c800/public')
puts vinocr
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
yymm = carsxe.year_make_model('year' => '2012', 'make' => 'BMW', 'model' => '5 Series')
puts yymm
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
obdcode = carsxe.obd_codes_decoder('code' => 'P0115')
puts obdcode
rescue StandardError => error
puts "Error: #{error.message}"
endbegin
lien_and_theft = carsxe.lien_and_theft('vin' => '2C3CDXFG1FH762860')
puts lien_and_theft
rescue StandardError => error
puts "Error: #{error.message}"
endStart building powerful automotive applications with CarsXE's Ruby gem!