The DatamoAPI Quick Start Guide

Introduction

Our API is a stateless, REST API that can be used with most major programming languages. To get started, you will need to sign in to your Rapid API account and choose a subscription tier. For more detailed information on the pricing tier structure and the options available, reference the Rapid API Pricing Options

Once subscribed, you will receive an API key and are able to get started with pulling vehicle data. We recommend concealing your API key in a configuration file away from source control. 

Making your First Request

In the following example, we will be using Javascript as the language. To use the API, you will need to use the endpoint and the API key gathered after choosing your tier and subscribing. The following example leverages the Axios library. Javascript provides other ways to make HTTP requests like Ajax or the “Fetch” library. By hitting the getMakes endpoint, your response will be an array of the auto manufacturers available from Datamo. 

var axios = require("axios").default;
var options = {
  method: 'GET',
  url: 'https://datamo.p.rapidapi.com/specs/v1/getMakes',
  headers: {
    'x-rapidapi-host': 'datamo.p.rapidapi.com',
    'x-rapidapi-key': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  }
};
axios.request(options).then(function (response) {
	console.log(response.data);
}).catch(function (error) {
	console.error(error);
});

We will now look at aggregating data from a separate endpoint. With the following structure, you will be able to pull data no matter the tier you chose. Depending on the tier chosen you will only have a select amount of parameters to filter by. 

See a list of all of the data available through Datamo here.

Example of Tier 3 Request 

Tier 3 allows a user to filter and use any of the response data points as parameters for your request. For the below example, we are choosing to return results for the 2021 Tesla, Model Y. 

var axios = require("axios").default;

var options = {
  method: 'GET',
  url: 'https://datamo.p.rapidapi.com/specs/v1/tier3',
  params: {make: Tesla, model: Model Y, year: 2021},
  headers: {
    'x-rapidapi-host': 'datamo.p.rapidapi.com',
    'x-rapidapi-key': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  }
};

axios.request(options).then(function (response) {
	console.log(response.data);
}).catch(function (error) {
	console.error(error);
})

We’ve now retrieved data 

A sample of the response data looks like the following: 

[
   {
       "totalItems": 3,
       "totalPages": 1,
       "data": [
           {
               Body Type: SUV
Curb Weight: 3920
Car Classification: Compact crossover SUV
Front Head Room: 41.0"
Front Hip Room: 53.8"
Front Leg Room: 	41.8"
Front Shoulder Room: 56.4"
MSRP: 39990
MPGe City: 131 mi.
MPGe Highway: 117 mi.
MPGe Combined: 125 mi.
Total Seating: 5
……….
              ]
   }
]

Looking for more information? Head to our RapidAPI page.

Looking for more information? Head to our RapidAPI page.

2