Clean Address

Version: 1.1.1
address/clean-address
superface

Normalize postal address from user input.

Clean Address

This use case is useful for cleaning up addresses input by users. It will take an address like '3301 South Greenfield Road, Gilbert, AZ 85297' and converts it to '3301 S Greenfield Rd, Gilbert, AZ 85297'.

Street
City
State
ZIP code
Street
City
State
ZIP code

1. Install

npx @superfaceai/cli install address/clean-address

2. Use in your code

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

const sdk = new SuperfaceClient();

async function run() {
  // Load the installed profile
  const profile = await sdk.getProfile('address/clean-address');

  // Use the profile
  const result = await profile
    .getUseCase('CleanAddress')
    .perform({
      street: '3301 South Greenfield Road',
      city: 'Gilbert',
      state: 'AZ',
      zipcode: '85297'
    });

  return result.unwrap();
}

run();

3. Add providers