Module interzoid.statedata
ballerinax/interzoid.statedata Ballerina library
Overview
The Interzoid State Data connector lets Ballerina applications standardize state and province names and obtain their two-letter abbreviations using Interzoid's AI-driven algorithms and knowledge bases. It supports version 1.0.0 of the Interzoid State/Province Standardization API.
Key features
- Standardize state and province names from free-form input
- Retrieve two-letter state and province abbreviations
- Choose the AI model used for standardization
- Track the remaining API credits on your license
Setup guide
-
Register for an Interzoid API account at the Interzoid registration page.
-
Copy the API license key issued for your account.
-
Provide the license key when creating the client, for example through a
Config.tomlfile.
Quickstart
To use the interzoid.statedata connector in your Ballerina application, update the .bal file as follows:
Step 1: Import the module
import ballerinax/interzoid.statedata;
Step 2: Instantiate a new connector
Create a Config.toml file with your license key:
licenseKey = "<your-license-key>"
configurable string licenseKey = ?; final statedata:Client stateClient = check new ({license: licenseKey});
Step 3: Invoke the connector operation
public function main() returns error? { statedata:StateAbbreviationResponse _ = check stateClient->getStateAbbreviation(state = "Ohio", algorithm = "ai-medium"); }
Step 4: Run the Ballerina application
bal run
Examples
The Interzoid State Data connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Standardize customer states - Standardize raw state names and print their two-letter abbreviations.
- Validate state inputs - Report state inputs that differ from their standardized names.