Star Wars Character Information

starwars/character-information@1.0.4
Supported by 1 provider
S

Retrieve Character Info

Retrieve information about a Star Wars character.

Input
Character name
Result
Height
Weight
Year of birth

1.Choose a provider

2.Use RetrieveCharacterInformation with mock in your code

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('starwars/character-information@1.0.4');

  // Use the profile
  const result = await profile
    .getUseCase('RetrieveCharacterInformation')
    .perform({
      characterName: 'Luke Skywalker'
    }, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Input (object)

characterName
The character name to use when looking up character information

Example

{
  "characterName": "Luke Skywalker"
}

Result (object)

height
The height of the character
weight
The weight of the character
yearOfBirth
The year of birth of the character

Example

{
  "height": "172",
  "weight": "77",
  "yearOfBirth": "19BBY"
}

Implementation details

Provider
mock
Use case
RetrieveCharacterInformation
Author
@superface
Source
Verified