Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’± Currency Converter β€” Fixer API

A Java console application for currency conversion using the Fixer API.

Homework project for the REST Client / External API lesson at AIT TR GmbH (cohort 60).


πŸ“‹ Task

Using the Fixer API, build a currency converter application where the user enters from the console:

  • The currency to convert from
  • The currency to convert to
  • The amount to convert

The application prints the converted result.


πŸ›  Tech Stack

  • Java 23
  • Spring Web (RestTemplate, UriComponentsBuilder) β€” no Spring Boot
  • Jackson Databind (JSON deserialization)
  • Lombok
  • Maven

πŸš€ How It Works

  1. The app prompts the user to enter input via the console
  2. Builds a request to https://api.apilayer.com/fixer/convert with query params from, to, amount
  3. Sends an HTTP GET request with the API key in the apikey header using RestTemplate
  4. Deserializes the JSON response into FixerResult
  5. Prints the converted amount and target currency

πŸ–₯ Console Example

Enter currency (from): USD
Enter currency (to): EUR
Enter amount: 100
Result: 91.25 EUR

πŸ“ Project Structure

src/main/java/ait/fixer/
β”œβ”€β”€ FixerAppl.java          # Main class β€” reads console input, calls API, prints result
β”œβ”€β”€ dto/
β”‚   └── FixerResult.java    # Maps JSON response (success, date, result, query)
└── utils/
    └── DataFromConsole.java # Reads from, to, amount from Scanner

βš™οΈ Getting Started

git clone https://github.com/AOgit/ait-fixer-api.git
cd ait-fixer-api

Run via IntelliJ IDEA or:

mvn compile exec:java -Dexec.mainClass="ait.fixer.FixerAppl"

Note: The API key is hardcoded in FixerAppl.java. To use your own key, register at apilayer.com and replace the value of apiKey.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages