Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Avatars → Get Country Flag

AI-generated

Overview

This node interacts with the Appwrite API to retrieve country flag images based on ISO Alpha-2 country codes. It is useful for applications that need to display country flags dynamically, such as user profiles, dashboards, or internationalization features. For example, it can fetch the flag of the United States by using the code 'us'.

Use Case Examples

  1. Fetching the flag of Germany using the country code 'de' to display on a user profile.
  2. Retrieving the flag of Japan with specific image dimensions for a travel website.

Properties

Name Meaning
Country Code ISO Alpha-2 country code to specify which country's flag to retrieve (e.g., us, gb, de, fr, jp).
Width Width of the flag image in pixels, ranging from 0 to 2000. Use 0 to keep the original width.
Height Height of the flag image in pixels, ranging from 0 to 2000. Use 0 to keep the original height.
Quality Quality of the flag image from 0 to 100, where higher values produce better quality images.

Output

JSON

  • flagUrl - URL of the retrieved country flag image.

Dependencies

  • Requires an Appwrite API key credential with endpoint, project ID, and API key for authentication.

Troubleshooting

  • Common issues include invalid or missing country codes, which may result in errors or no image returned. Ensure the country code is a valid ISO Alpha-2 code.
  • Errors related to authentication failures due to incorrect or expired API keys. Verify the API credentials are correct and have necessary permissions.
  • Image dimension parameters (width and height) must be within the allowed range (0-2000). Values outside this range may cause errors or unexpected results.

Links

Discussion