ApogeoAPI icon

ApogeoAPI

IP geolocation, countries, cities, and exchange rates

Actions8

Country → Get Country

AI-generated

Summary

Fetches a single country's record from ApogeoAPI by its ISO 3166-1 alpha-2 code, via a GET request to /v1/countries/{CODE}.

Inputs

  • Country Code (required) — ISO 3166-1 alpha-2 country code (e.g. US, DE, AR). The code is converted to uppercase before the request is sent, so lowercase input works. It is placed directly in the URL path, so use an expression to supply it from incoming item data.

Output shape

One output item per input item. Each item's json is the country object that the ApogeoAPI /countries/{code} endpoint returns. If the API returns an array instead, each element becomes its own item.

The source doesn't define the country object's fields, so they depend on the API. Requests are authenticated with the apogeoApiCredentials credential (sent as an X-API-Key header). If the code is invalid or the request fails, the node throws an API error that includes the status and response body. With Continue On Fail enabled, it instead outputs an item shaped like {error: message} for that input item.

Examples

Example 1: Look up details for a fixed country, such as Germany.

Resource: Country; Operation: Get Country; Country Code: DE

Example 2: Enrich each incoming record that has a country code field.

Resource: Country; Operation: Get Country; Country Code: ={{ $json.countryCode }}. The node runs once per input item.

Links

Discussion