# Country Info Card

## Start here

Read the simulated search test and follow what changes when the request fails. [View the project page](country-info-card.html).

## Why I built it

I built this coursework exercise to practice taking an API response and turning it into something readable.

**Status:** Coursework

A small browser exercise that turns API data into a readable country information card.


## The problem

An API response is useful to a program, but a user needs an understandable result and a clear path when it fails.

## What I built

JavaScript coursework using external API requests, JSON and dynamic page updates.

## A decision I made

Keep a small interface so the data flow from request to rendered card is easy to explain.

## What I can show

The exercise is described in the existing portfolio. No independently verified public deployment is linked.

## Known limits

A coursework example, not a production service.

## What went wrong and what changed

### Changing the search could change only the heading

- What I changed: The search button now trims the input, ignores blanks, and sends the new country through the same data-loading function as the initial card.
- How I checked: A simulated data test checked the default card, a changed country, blank input, and a failed request. The old card stays on screen if the request fails. This was not a live API test.

## What I’m still solving

Show a visible error or retry message when the network request fails. Right now the error is logged, but the page does not explain it to the reader.

**Skills:** Tracing UI state · fetch handling · comparing before and after

## Tools and topics

JavaScript, Fetch, JSON, HTML/CSS
