Skip to content

Mixss/nbp-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages