Bedrijfsdata icon

Bedrijfsdata

Get data from the Bedrijfsdata API.

Overview

The "Validate City" operation in the Validation & Cleansing resource allows users to validate global city names against an external API. This node checks if a given city name is valid within a specified country, helping ensure geographic data accuracy and consistency.

Common scenarios where this node is beneficial include:

  • Data cleansing workflows where user-entered city names need verification.
  • Address validation processes before shipping or billing.
  • Geographic data enrichment by confirming city existence and correctness.

For example, you can input a city name like "Amsterdam" with the country code "nl" (Netherlands) to verify that Amsterdam is a valid city in the Netherlands.

Properties

Name Meaning
City The city name to validate. Must be provided as a string.
Country (ISO 3166-1 Alpha-2) The two-letter country code (e.g., "nl" for Netherlands, "us" for United States) to specify the country context for the city validation.

Output

The node outputs JSON data containing the validation results from the API. The exact structure depends on the API response but typically includes:

  • Confirmation of whether the city is valid.
  • Possibly additional metadata about the city such as standardized name or location details.

No binary data output is indicated for this operation.

Dependencies

  • Requires an active connection to the Bedrijfsdata API service.
  • An API key credential must be configured in n8n to authenticate requests to the Bedrijfsdata API.
  • The node sends a GET request to the /city endpoint of the API with query parameters for city and country_code.

Troubleshooting

  • Common issues:

    • Invalid or missing city or country code parameters will cause the API to reject the request.
    • Network connectivity problems may prevent reaching the API endpoint.
    • Incorrect API credentials will result in authentication errors.
  • Error messages:

    • "Failed to fetch cities: <message>" indicates the API returned an error or unexpected response.
    • "Error fetching cities: <message>" suggests a network or other request failure.
  • Resolutions:

    • Ensure both city and country code inputs are correctly provided and formatted.
    • Verify API credentials and network access.
    • Check the API status and retry if transient errors occur.

Links and References

Discussion