Giter Site home page Giter Site logo

dntrc-api-nbp-server's Introduction

dntrc-api-nbp-server

Description

This is the solution for the internship task for Dynatrace. This project contains simple local runnable server which fetches data from http://api.nbp.pl/ and provides three endpoints to get detailed information from this API.

Installation

To run this project you can use one of the following commands while inside project directory

Run the Spring boot application with the java -jar command:

java -jar target/nbpapi-0.0.1-SNAPSHOT.jar

Run the Spring boot application using Maven:

mvn spring-boot:run

Run your Spring Boot application using Gradle

gradle bootRun

Available Endpoints

Gets the average value of provided currency during given day.

http://localhost:8080/api/currency/average/{date}/{code}

Gets the minimum average value and maximum average value of the given currency.

http://localhost:8080/api/currency/maxmin/{code}/{limit}

Gets biggest difference for ask and sell rates for given currency

http://localhost:8080/api/currency/maxdiff/{code}/{limit}

Path variables:

  • {date} - Date in YYYY-MM-DD format. This date points from which day should the data be fetched from. In case of Saturday or Sunday it cannot provide any data. (standard ISO 8601)
  • {code} - Three letter currency code (standard ISO 4217)
  • {limit} - Maximum amount of returned rates for the given currency

Example queries

Gets the average value for USD on April 24th 2023

http://localhost:8080/api/currency/average/2023-04-24/usd

Gets the minimum average value and maximum average value for USD, fetches data from 100 days back.

http://localhost:8080/api/currency/maxmin/usd/100

Gets biggest difference for ask and sell rates for USD, fetches data from 50 days back

http://localhost:8080/api/currency/maxdiff/usd/50

Test Endpoints!

In order to try this endpoints out, please run your local server as said before and paste in browser request below.

http://localhost:8080/swagger-ui/index.html#/

You should be able to use "Try it out" function. This front-end has been made by open source project SwaggerUI. image

dntrc-api-nbp-server's People

Contributors

heesos avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.