A Nova Marketing Group service
Docsmenu

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.

MethodPurposeReturns alternativesRecords per call
AnalyzeAddressCorrect + validate one address.No1
AnalyzeGetAlternativesCorrect one address, expose ambiguity.Yes (up to MaxAlternatives)1
AnalyzeRecordsCorrect a batch in one round-trip.NoMany (billed per record)

AnalyzeAddress#

http
POST /AnalyzeAddress

Use when you have a known good address and want to validate + canonicalize it without the cost of exploring alternatives.

NameTypeDescription
AddressLayoutRequiredstringSee /docs/layouts.
AnalysisModeRequiredstringSee /docs/modes.
CorrectionStyleRequiredstringSee /docs/styles.
AddressLinesInRequiredLineContent[]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#

http
POST /AnalyzeGetAlternatives

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

NameTypeDescription
AddressLayoutRequiredstringSee /docs/layouts.
AnalysisModeRequiredstringSee /docs/modes.
CorrectionStyleRequiredstringSee /docs/styles.
AddressLinesInRequiredLineContent[]The address to analyze.
MaxAlternativesnumber0 = all, otherwise an upper bound. Typical: 50–200.

Response includes Alternatives[] plus ActualAlternativesFound and StyleChanges[] describing what the engine rewrote.

AnalyzeRecords#

http
POST /AnalyzeRecords

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

bash
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" }] }
  ]
}'