Star Wars API Vehicles API

Vehicles in the Star Wars universe

OpenAPI Specification

star-wars-vehicles-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Star Wars REST API (SWAPI) Films Vehicles API
  description: The Star Wars REST API (swapi.info) is the world's first quantified and programmatically-accessible data source for all the data from the Star Wars canon universe. It provides structured JSON access to films, characters (people), starships, vehicles, planets, and species. No authentication is required.
  version: 1.0.0
  contact:
    name: SWAPI
    url: https://swapi.info
  license:
    name: MIT
    url: https://github.com/SivaramPg/swapi.info/blob/main/LICENSE
servers:
- url: https://swapi.info/api
  description: Production server
tags:
- name: Vehicles
  description: Vehicles in the Star Wars universe
paths:
  /vehicles:
    get:
      operationId: listVehicles
      summary: List all vehicles
      description: Retrieve a list of all vehicles in the Star Wars universe.
      tags:
      - Vehicles
      responses:
        '200':
          description: A list of vehicles
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Vehicle'
  /vehicles/{id}:
    get:
      operationId: getVehicle
      summary: Get a vehicle by ID
      description: Retrieve a single Star Wars vehicle by its numeric ID.
      tags:
      - Vehicles
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: The numeric ID of the vehicle
      responses:
        '200':
          description: A single vehicle
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vehicle'
        '404':
          description: Vehicle not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
components:
  schemas:
    Vehicle:
      type: object
      description: A vehicle in the Star Wars universe
      required:
      - name
      - model
      - manufacturer
      - cost_in_credits
      - length
      - max_atmosphering_speed
      - crew
      - passengers
      - cargo_capacity
      - consumables
      - vehicle_class
      - pilots
      - films
      - created
      - edited
      - url
      properties:
        name:
          type: string
          description: The name of this vehicle
          example: Sand Crawler
        model:
          type: string
          description: The model or official name of this vehicle
          example: Digger Crawler
        manufacturer:
          type: string
          description: The manufacturer of this vehicle
          example: Corellia Mining Corporation
        cost_in_credits:
          type: string
          description: The cost of this vehicle new, in Galactic Credits
          example: '150000'
        length:
          type: string
          description: The length of this vehicle in meters
          example: '36.8'
        max_atmosphering_speed:
          type: string
          description: The maximum speed of this vehicle in the atmosphere
          example: '30'
        crew:
          type: string
          description: The number of personnel needed to run or pilot this vehicle
          example: '46'
        passengers:
          type: string
          description: The number of non-essential people this vehicle can transport
          example: '30'
        cargo_capacity:
          type: string
          description: The maximum number of kilograms that this vehicle can transport
          example: '50000'
        consumables:
          type: string
          description: The maximum length of time that this vehicle can provide consumables for its crew
          example: 2 months
        vehicle_class:
          type: string
          description: The class of this vehicle
          example: wheeled
        pilots:
          type: array
          description: URLs of People resources that have piloted this vehicle
          items:
            type: string
            format: uri
        films:
          type: array
          description: URLs of Film resources that this vehicle has appeared in
          items:
            type: string
            format: uri
        created:
          type: string
          format: date-time
          description: ISO 8601 date-time when this resource was created
        edited:
          type: string
          format: date-time
          description: ISO 8601 date-time when this resource was last edited
        url:
          type: string
          format: uri
          description: The hypermedia URL of this resource
    NotFound:
      type: object
      properties:
        detail:
          type: string
          example: Not found