Smartcar’s Batch API is available on our Pro Plan.
The Batch API allows developers to request multiple pieces of data from a car at the same time.
Its primary use is to help reduce latency experienced by an application while awaiting a response from a vehicle. Batch also helps lower development overhead by allowing you to make a request to one endpoint, instead of multiple.
Without Batch, requesting Odometer, Battery, Charge, and Location would require 4 separate API calls to the vehicle. Each would take a varying amount of time in order to return a response.
With Batch, you can make one request to the vehicle for all 4 pieces of information. Instead of considering each request separately, the vehicle will collect all of the requested information and send it back in bulk.
Note: Using Batch does not reduce your total billable API requests. One Batch request for 4 data points from a vehicle will be counted as 4 separate billable API requests.
For more information about what constitutes a billable API request, click here.
Learn how to use the Batch API here.