Clean Address

address/clean-address@1.1.1
Supported by 1 provider
S

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'.

Input
Street
City
State
ZIP code
Result
Street
City
State
ZIP code

1.Choose a provider

2.Use CleanAddress 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('address/clean-address@1.1.1');

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

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

run();

Structure details

Input (object)

street
Street Address
city
City or Town
state
State or Province
zipcode
Zip or Postal code

Example

{
  "street": "3301 South Greenfield Road",
  "city": "Gilbert",
  "state": "AZ",
  "zipcode": "85297"
}

Result (object)

street
Street Address
city
City or Town
state
State or Province
zipcode
Zip or Postal code

Example

{
  "street": "3301 S Greenfield Rd",
  "city": "Gilbert",
  "state": "AZ",
  "zipcode": "85297"
}

Implementation details

Provider
mock
Use case
CleanAddress
Author
@superface
Source
Verified