Species - Gio85/swapi-ts-sdk GitHub Wiki

In order to fetch the data, the following methods can be used;

  • getSchema() which will return the resource schema
  • read() which will return the single resource
  • list() which will return the resources list
  • getWookiee() which will return.. Wookiee!!

Examples:

  // Get the instance of the client
  const client = ApiClient.getInstance()

  const species = await client.species.list({ search: 'Wookie' })
  const species = await client.species.list({ page: 3 })
  const speciesSchema = await client.species.getSchema()
  const singleSpecie = await client.species.read('1')
  const speciesWookie = await client.species.getWookiee('1')