🚗 Assets API Documentation

Welcome to the Assets API! This API provides information about various assets including cars, boats, houses, and planes. All prices are formatted in European style.

📮 Download Postman Collection

Base URL

The API is available at: https://matti-assets-api.vercel.app

Endpoints

Cars

GET /api/cars
Retrieve a list of all cars.
limit (optional, integer, default: 100, max: 1000)
Maximum number of results to return.
offset (optional, integer, default: 0)
Number of results to skip for pagination.
Example Request:
GET /api/cars?limit=10&offset=0
Success Response (200):
{
  "data": [
    {
      "id": 1,
      "make": "Toyota",
      "model": "Corolla",
      "price": "20.000,00 €",
      "picture": "https://example.com/car.jpg"
    }
  ],
  "total": 50,
  "limit": 10,
  "offset": 0
}
GET /api/cars/{id}
Retrieve a specific car by its ID.
id (required, integer)
The ID of the car to retrieve.
Example Request:
GET /api/cars/1
Success Response (200):
{
  "id": 1,
  "make": "Toyota",
  "model": "Corolla",
  "price": "20.000,00 €",
  "picture": "https://example.com/car.jpg"
}
Error Response (404):
{
  "error": "Not Found",
  "message": "Car with id 999 not found"
}

Boats

GET /api/boats
Retrieve a list of all boats.
limit (optional, integer, default: 100, max: 1000)
Maximum number of results to return.
offset (optional, integer, default: 0)
Number of results to skip for pagination.
Example Request:
GET /api/boats?limit=5
Success Response (200):
{
  "data": [
    {
      "id": 1,
      "make": "Bayliner",
      "model": "Element",
      "price": "150.000,00 €",
      "picture": "https://example.com/boat.jpg"
    }
  ],
  "total": 25,
  "limit": 5,
  "offset": 0
}
GET /api/boats/{id}
Retrieve a specific boat by its ID.
id (required, integer)
The ID of the boat to retrieve.
Example Request:
GET /api/boats/1
Success Response (200):
{
  "id": 1,
  "make": "Bayliner",
  "model": "Element",
  "price": "150.000,00 €",
  "picture": "https://example.com/boat.jpg"
}
Error Response (404):
{
  "error": "Not Found",
  "message": "Boat with id 999 not found"
}

Houses

GET /api/houses
Retrieve a list of all houses.
limit (optional, integer, default: 100, max: 1000)
Maximum number of results to return.
offset (optional, integer, default: 0)
Number of results to skip for pagination.
Example Request:
GET /api/houses?limit=20&offset=10
Success Response (200):
{
  "data": [
    {
      "id": 1,
      "make": "Modern",
      "model": "Villa",
      "price": "500.000,00 €",
      "picture": "https://example.com/house.jpg"
    }
  ],
  "total": 100,
  "limit": 20,
  "offset": 10
}
GET /api/houses/{id}
Retrieve a specific house by its ID.
id (required, integer)
The ID of the house to retrieve.
Example Request:
GET /api/houses/1
Success Response (200):
{
  "id": 1,
  "make": "Modern",
  "model": "Villa",
  "price": "500.000,00 €",
  "picture": "https://example.com/house.jpg"
}
Error Response (404):
{
  "error": "Not Found",
  "message": "House with id 999 not found"
}

Planes

GET /api/planes
Retrieve a list of all planes.
limit (optional, integer, default: 100, max: 1000)
Maximum number of results to return.
offset (optional, integer, default: 0)
Number of results to skip for pagination.
Example Request:
GET /api/planes?limit=50
Success Response (200):
{
  "data": [
    {
      "id": 1,
      "make": "Cessna",
      "model": "172",
      "price": "300.000,00 €",
      "picture": "https://example.com/plane.jpg"
    }
  ],
  "total": 75,
  "limit": 50,
  "offset": 0
}
GET /api/planes/{id}
Retrieve a specific plane by its ID.
id (required, integer)
The ID of the plane to retrieve.
Example Request:
GET /api/planes/1
Success Response (200):
{
  "id": 1,
  "make": "Cessna",
  "model": "172",
  "price": "300.000,00 €",
  "picture": "https://example.com/plane.jpg"
}
Error Response (404):
{
  "error": "Not Found",
  "message": "Plane with id 999 not found"
}

All Assets

GET /api/assets
Retrieve a combined list of all assets (cars, boats, houses, planes).
limit (optional, integer, default: 100, max: 1000)
Maximum number of results to return.
offset (optional, integer, default: 0)
Number of results to skip for pagination.
type (optional, string: "car", "boat", "house", "plane")
Filter results by asset type.
Example Request:
GET /api/assets?type=car&limit=25
Success Response (200):
{
  "data": [
    {
      "id": 1,
      "make": "Toyota",
      "model": "Corolla",
      "price": "20.000,00 €",
      "picture": "https://example.com/car.jpg",
      "type": "car"
    },
    {
      "id": 1,
      "make": "Bayliner",
      "model": "Element",
      "price": "150.000,00 €",
      "picture": "https://example.com/boat.jpg",
      "type": "boat"
    }
  ],
  "total": 250,
  "limit": 25,
  "offset": 0
}

Error Handling

All endpoints may return the following error responses:

Rate Limit Exceeded (429):
{
  "error": "Too Many Requests",
  "message": "Rate limit exceeded",
  "retryAfter": "60"
}

Rate Limiting

The API implements rate limiting to prevent abuse. Most endpoints allow 100 requests per 15 minutes per IP address. Some individual item endpoints have stricter limits.