Skip to content

Latest commit

 

History

History
61 lines (54 loc) · 2.24 KB

README.md

File metadata and controls

61 lines (54 loc) · 2.24 KB

Simple NBP REST API

This REST API fetches data from the Narodowy Bank Polski's public APIs and returns relevant information from them (http://api.nbp.pl/).

Table of contents

Compiling and running

  • Using maven package and java -jar:
$ ./mvnw package
$ java -jar target/dynatrace-backend-task-1.0.jar
  • Executing directly with maven
$ ./mvnw compile exec:java
  • Using docker (you can specify your own port):
$ ./mvnw spring-boot:build-image
$ docker run -p 8080:8080 docker.io/library/dynatrace-backend-task:1.0

Usage

Application by default will be available at port 8080. You can test the API using your application of choice, but there is also a swagger UI available at /swagger-ui/index.html

Endpoints

  • GET /api/avg/{currencyCode}/{date}:
  • GET /api/minmax/{currencyCode}/{numberOfLastQuotations}:
    • takes arguments:
    • returns:
      • two values, first is the minimum and second one is the maximum value of the currency in the last numberOfLastQuotations quotations; e.g:
      {
         "min": 5.2086,
         "max": 5.3648
      }
  • GET /api/maxdiff/{currencyCode}/{numberOfQuotations}:
    • takes arguments:
    • returns:
      • single number which is the major difference between the buy and ask rate in the last numberOfLastQuotations quotations; e.g:
      0.1096