/vehicles/42
Request:
fetch("https://swapi.info/api/vehicles/42")
.then((res) => res.json()) // Parse the JSON content from the API to be consumed
.then((json) => console.log(json)) // Log the JSON response to your console
.catch((error) => console.error(error)) // Log the API error (if any) to your console
Result:
{
"name": "Sith speeder",
"model": "FC-20 speeder bike",
"manufacturer": "Razalon",
"cost_in_credits": "4000",
"length": "1.5",
"max_atmosphering_speed": "180",
"crew": "1",
"passengers": "0",
"cargo_capacity": "2",
"consumables": "unknown",
"vehicle_class": "speeder",
"pilots": [
"https://swapi.info/api/people/44"
],
"films": [
"https://swapi.info/api/films/4"
],
"created": "2014-12-20T10:09:56.095000Z",
"edited": "2014-12-20T21:30:21.712000Z",
"url": "https://swapi.info/api/vehicles/42"
}