Superface

Star Wars Character Information

starwars/character-information@1.0.4
1 provider

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

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });

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