Analyze methods
Three methods sit at the heart of nCodeWS4's address-correction pipeline. They share the same input shape and differ only in whether they return alternatives and whether they accept one or many records.
| Method | Purpose | Returns alternatives | Records per call |
|---|---|---|---|
AnalyzeAddress | Correct + validate one address. | No | 1 |
AnalyzeGetAlternatives | Correct one address, expose ambiguity. | Yes (up to MaxAlternatives) | 1 |
AnalyzeRecords | Correct a batch in one round-trip. | No | Many (billed per record) |
AnalyzeAddress#
POST /AnalyzeAddressUse when you have a known good address and want to validate + canonicalize it without the cost of exploring alternatives.
| Name | Type | Description |
|---|---|---|
| AddressLayoutRequired | string | See /docs/layouts. |
| AnalysisModeRequired | string | See /docs/modes. |
| CorrectionStyleRequired | string | See /docs/styles. |
| AddressLinesInRequired | LineContent[] | The address to analyze. |
The response carries the same envelope as OneStopAnalyze (intRetCode, strMessage, strStatus), with a single AddressLinesOut instead of an Alternatives array.
AnalyzeGetAlternatives#
POST /AnalyzeGetAlternativesUse when the input might be ambiguous (e.g. a misspelled street name) and you want the engine to surface multiple plausible corrections. This is the method that powers the live demo's "Address correction" mode.
| Name | Type | Description |
|---|---|---|
| AddressLayoutRequired | string | See /docs/layouts. |
| AnalysisModeRequired | string | See /docs/modes. |
| CorrectionStyleRequired | string | See /docs/styles. |
| AddressLinesInRequired | LineContent[] | The address to analyze. |
| MaxAlternatives | number | 0 = all, otherwise an upper bound. Typical: 50–200. |
Response includes Alternatives[] plus ActualAlternativesFound and StyleChanges[] describing what the engine rewrote.
AnalyzeRecords#
POST /AnalyzeRecordsIntroduced in nCode 12.3 for high-volume correction. Send N records, receive N results — significantly faster than calling AnalyzeGetAlternatives in a loop. Credits are billed per record.
curl $NCODE_BASE/AnalyzeRecords \
-H "Authorization: AcmeLogistics|nck_live_…" \
-H "Content-Type: application/json" \
-d '{
"AddressLayout": "ADDR x2 LAST LINE",
"AnalysisMode": "MODERATE",
"CorrectionStyle": "UPPER KYWD",
"Records": [
{ "AddressLinesIn": [{ "strName": "ADDR1", "strContent": "100 King St W" }, { "strName": "LASTLINE", "strContent": "Toronto ON M5X 1A9" }] },
{ "AddressLinesIn": [{ "strName": "ADDR1", "strContent": "1 Yonge St" }, { "strName": "LASTLINE", "strContent": "Toronto ON M5E 1W7" }] }
]
}'Related#
- OneStopAnalyze — single-call capture (parse + correct + validate).
- Search methods — partial-address lookup.
- Status codes —
V/C/N/I/F.