Check out our latest APIs:Random Word

Motorcycles API

The Motorcycles API provides highly-detailed technical data on tens of thousands of different motorcycle models from hundreds of manufacturers.

/v1/motorcycles

HTTP GET

Returns up to 30 motorcycle results matching the input name parameters. For searches that yield > 30 results, please use the offset parameter.

Parameters

Either make or model must be set.

make (optional) - name of manufacturer/brand. Supports partial matching (e.g. Harley will match Harley-Davidson).

model (optional) - name of motorcycle model. Supports partial matching (e.g. Ninja will match Ninja 650).

year (optional) - release year of motorcycle model. Must be in the form of YYYY (e.g. 2022).

offset (optional) - number of results to offset for pagination. Default is 0.

Headers

X-Api-Key (required) - API Key associated with your account.

Sample Request URL

Live Demo!

https://api.api-ninjas.com/v1/motorcycles?make=
&model=

Sample Response

[
  {
    "make": "Kawasaki",
    "model": "Ninja 650 ",
    "year": "2022",
    "type": "Sport",
    "displacement": "649.0 ccm (39.60 cubic inches)",
    "engine": "Twin, four-stroke",
    "power": "52.3 HP (38.2  kW)) @ 8000 RPM",
    "torque": "56.0 Nm (5.7 kgf-m or 41.3 ft.lbs) @ 4000 RPM",
    "compression": "10.8:1",
    "bore_stroke": "83.0 x 60.0 mm (3.3 x 2.4 inches)",
    "valves_per_cylinder": "4",
    "fuel_system": "Injection. DFI® with dual 36mm Keihin throttle bodies",
    "fuel_control": "Double Overhead Cams/Twin Cam (DOHC)",
    "ignition": "TCBI with digital advance",
    "lubrication": "Forced lubrication, semi-dry sump",
    "cooling": "Liquid",
    "gearbox": "6-speed",
    "transmission": "Chain   (final drive)",
    "clutch": "Assist  and  Slipper Clutch",
    "frame": "Trellis, high-tensile steel",
    "front_suspension": "41mm hydraulic telescopic fork",
    "front_wheel_travel": "124 mm (4.9 inches)",
    "rear_suspension": "Horizontal back-link with adjustable spring preload",
    "rear_wheel_travel": "130 mm (5.1 inches)",
    "front_tire": "120/70-17 ",
    "rear_tire": "160/60-17 ",
    "front_brakes": "Double disc. Petal discs and two-piston calipers. Optional ABS.                                  ",
    "rear_brakes": "Single disc. Petal disc and single piston caliper. Optional ABS.                               ",
    "total_weight": "192.1 kg (423.4 pounds)",
    "seat_height": "790 mm (31.1 inches) If adjustable, lowest setting.",
    "total_height": "1146 mm (45.1 inches)",
    "total_length": "2055 mm (80.9 inches)",
    "total_width": "739 mm (29.1 inches)",
    "ground_clearance": "130 mm (5.1 inches)",
    "wheelbase": "1410 mm (55.5 inches)",
    "fuel_capacity": "15.14 litres (4.00 US gallons)",
    "starter": "Electric"
  },
  ...
]

import requests

api_url = 'https://api.api-ninjas.com/v1/motorcycles?make=kawasaki&model=ninja'
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
    print(response.text)
else:
    print("Error:", response.status_code, response.text)
$.ajax({
    method: 'GET',
    url: 'https://api.api-ninjas.com/v1/motorcycles?make=kawasaki&model=ninja',
    headers: { 'X-Api-Key': 'YOUR_API_KEY'},
    contentType: 'application/json',
    success: function(result) {
        console.log(result);
    },
    error: function ajaxError(jqXHR) {
        console.error('Error: ', jqXHR.responseText);
    }
});
const request = require('request');
request.get({
  url: 'https://api.api-ninjas.com/v1/motorcycles?make=kawasaki&model=ninja',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY'
  },
}, function(error, response, body) {
  if(error) return console.error('Request failed:', error);
  else if(response.statusCode != 200) return console.error('Error:', response.statusCode, body.toString('utf8'));
  else console.log(body)
});
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import com.fasterxml.jackson.databind.ObjectMapper;

URL url = new URL("https://api.api-ninjas.com/v1/motorcycles?make=kawasaki&model=ninja");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("accept", "application/json");
InputStream responseStream = connection.getInputStream();
ObjectMapper mapper = new ObjectMapper();
JsonNode root = mapper.readTree(responseStream);
System.out.println(root.path("fact").asText());
let url = URL(string: "https://api.api-ninjas.com/v1/motorcycles?make=kawasaki&model=ninja")!
var request = URLRequest(url: url)
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "X-Api-Key")
let task = URLSession.shared.dataTask(with: request) {(data, response, error) in
    guard let data = data else { return }
    print(String(data: data, encoding: .utf8)!)
}
task.resume()
If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.