CA DMV Poller
A developer API to access the CA DMV appointment system
NOTE: This is a developer API. Use CA DMV Appointment FastFinder, an Android app, if you just want to get an appointment.
Install
Install this module like any other npm package:
$ npm install ca-dmv-poller
Usage
const Poller = require('ca-dmv-poller')
const poller = new Poller({
itemsToProcess: 1,
maxDistanceMiles: 15,
zipCode: '95630',
coords: {
lat: '38.733792',
lng: '-121.141315'
}
address: '1600 Amphitheatre Pkwy, Mountain View, CA 94043',
mode: 'OfficeVisit',
appointmentTypes: ['CID'],
appointmentInfo: {
appointmentInfo: {
firstName: 'John',
lastName: 'Doe',
telArea: '123',
telPrefix: '456',
telSuffix: '7890',
birthDay: '01',
birthMonth: '01',
birthYear: '2001',
dlNumber: 'I0004567',
requestedTask: 'DT',
safetyCourseCompletedSelection: 'TRUE'
}
}
})
poller
.check()
.then(results => {
results.forEach(result => {
if (result.hasFailed) {
console.log(
`The request to ${result.location} (id ${
result.id
}) failed because: ${result.cause}`
)
return
}
console.log('Day of appointment: ', result.date)
console.log('Days until appointment: ', result.daysUntil)
console.log('Location of appointment: ', result.location)
})
})
.catch(e => console.error(e))
Special Thanks to Michael Vartan and his tool, ca-dmv-poller, for inspiration and initial implementation of this app.