Skip to content

Smart Zipcode Area

Keyword-based smart postal code detection. Search by country code and keyword, matching against both city names (fuzzy) and postal codes (exact).

Endpoint: POST /biz/bigdata/data/zipcode/detect

Parameters

ParameterTypeRequiredDescription
country_codeStringYesISO 3166-1 alpha-2 country code
keywordStringYesSearch keyword (matches city name or postal code)

The keyword parameter performs a fuzzy match on city names (LIKE %keyword%) and an exact match on postal codes. Results are limited to 100 records.

Request

bash
curl -X POST "https://api.alaikis.com/std/biz/bigdata/data/zipcode/detect" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d 'bizContent={"country_code": "US", "keyword": "beverly"}'

Response

json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "id": 1001,
      "country": "United States",
      "countryCode": "US",
      "state": "California",
      "stateCode": "CA",
      "city": "Beverly Hills",
      "suburbs": "Beverly Hills",
      "zipCode": "90210",
      "location": "Beverly Hills",
      "latitude": "34.1030",
      "longitude": "-118.4100",
      "createdTime": "2024-01-15T10:30:00",
      "validAdministrativeType": "city",
      "isValid": true
    }
  ]
}

Data Model

FieldTypeDescription
idIntegerUnique record ID
countryStringCountry name
countryCodeStringISO 3166-1 alpha-2 country code
stateStringState/province name
stateCodeStringState/province code
cityStringCity name
suburbsStringSuburb/district name
zipCodeStringPostal/zip code
locationStringLocation description
latitudeStringLatitude in decimal degrees
longitudeStringLongitude in decimal degrees
createdTimeStringRecord creation timestamp
validAdministrativeTypeStringAdministrative type validation
isValidBooleanWhether the record is validated

Use Cases

  • Autocomplete: Use as a type-ahead search for postal code input fields
  • Address validation: Verify city-postal code combinations
  • Location lookup: Find postal codes by city name fragment

Error Codes

CodeDescription
400Invalid JSON format
406Missing required parameters (country_code and keyword)