API Documentation

Welcome to the Porsche API documentation. Below are the details of the available API endpoints.

Base URL

/api

Endpoints

1. Get All Porsche Models

Endpoint: GET /porsches

Description: Retrieves the complete list of Porsche models.

Response:


[
  {
    "model": "Porsche 911 Turbo S",
    "year": 2021,
    "engine": "3.8L Twin-Turbo Flat-6",
    "power": "640 hp",
    "category": "Modern",
    "description": "The 2021 Porsche 911 Turbo S is a performance powerhouse with a 3.8L twin-turbo flat-six engine producing an impressive 640 horsepower. Known for its blistering acceleration and all-wheel-drive stability, this model is a top choice for enthusiasts seeking speed and luxury.",
    "image": "sm_282126133_porsche-cayenne-2010-side-view_4x.png"
  }
]
            

2. Get Porsche Models by Year

Endpoint: GET /porsches/year/:year

Description: Retrieves Porsche models from a specific year.

Parameters:

  • :year - The year of the Porsche model you want to retrieve.

Response:


[
  {
    "model": "Porsche 911 Turbo S",
    "year": 2021,
    "engine": "3.8L Twin-Turbo Flat-6",
    "power": "640 hp",
    "category": "Modern",
    "description": "The 2021 Porsche 911 Turbo S is a performance powerhouse with a 3.8L twin-turbo flat-six engine producing an impressive 640 horsepower. Known for its blistering acceleration and all-wheel-drive stability, this model is a top choice for enthusiasts seeking speed and luxury.",
    "image": "sm_282126133_porsche-cayenne-2010-side-view_4x.png"
  }
]
            

3. Get Porsche Models After a Given Year

Endpoint: GET /porsches/after/:year

Description: Retrieves Porsche models from after a specified year.

Parameters:

  • :year - The year after which Porsche models should be retrieved.

Response:


[
  {
    "model": "Porsche 911 Turbo S",
    "year": 2021,
    "engine": "3.8L Twin-Turbo Flat-6",
    "power": "640 hp",
    "category": "Modern",
    "description": "The 2021 Porsche 911 Turbo S is a performance powerhouse with a 3.8L twin-turbo flat-six engine producing an impressive 640 horsepower. Known for its blistering acceleration and all-wheel-drive stability, this model is a top choice for enthusiasts seeking speed and luxury.",
    "image": "sm_282126133_porsche-cayenne-2010-side-view_4x.png"
  }
]
            

4. Get Porsche Models by Category

Endpoint: GET /porsches/category/:category

Description: Retrieves Porsche models based on the category (e.g., Modern, Classic, Electric).

Parameters:

  • :category - The category of Porsche models to retrieve.

Response:


[
  {
    "model": "Porsche 911 Turbo S",
    "year": 2021,
    "engine": "3.8L Twin-Turbo Flat-6",
    "power": "640 hp",
    "category": "Modern",
    "description": "The 2021 Porsche 911 Turbo S is a performance powerhouse with a 3.8L twin-turbo flat-six engine producing an impressive 640 horsepower. Known for its blistering acceleration and all-wheel-drive stability, this model is a top choice for enthusiasts seeking speed and luxury.",
    "image": "sm_282126133_porsche-cayenne-2010-side-view_4x.png"
  }
]
            

5. Get a Random Porsche Model

Endpoint: GET /porsches/random

Description: Retrieves a random Porsche model from the collection.

Response:


{
  "model": "Porsche 911 Turbo S",
  "year": 2021,
  "engine": "3.8L Twin-Turbo Flat-6",
  "power": "640 hp",
  "category": "Modern",
  "description": "The 2021 Porsche 911 Turbo S is a performance powerhouse with a 3.8L twin-turbo flat-six engine producing an impressive 640 horsepower. Known for its blistering acceleration and all-wheel-drive stability, this model is a top choice for enthusiasts seeking speed and luxury.",
  "image": "sm_282126133_porsche-cayenne-2010-side-view_4x.png"
}