Categorygithub.com/krios2146/currency-exchange-api-go
module
0.0.0-20240930152835-60d4a77ac996
Repository: https://github.com/krios2146/currency-exchange-api-go.git
Documentation: pkg.go.dev

# README

Currency Exchange API

OCaml SQLite

GitHub License

Simple REST API with currencies and exchange rates as resources and exchange of the currency as the main functionality

Created according to the technical specifications presented in this course

Run Locally

[!IMPORTANT]
Go should be installed to run this project

Clone the project

git clone [email protected]:krios2146/currency-exchange-api-go.git

Go to the project directory

cd currency-exchange-api-go

Run with go

go run cmd/main.go

API Reference

[!NOTE]
Postman workspace for this project with reuqests examples

Currencies

Get all currencies

GET /currencies

Get currency by code

GET /currency/{code}
ParameterTypeDescription
codestringRequired. Currency code in the ISO-4217 format

Add new currency

POST /currencies
Content-Type: x-www-form-urlencoded
RequestTypeDescription
codestringRequired. Currency code in the ISO-4217 format
namestringRequired. Currency name
signstringRequired. Currency sign

Exchange Rates

Get all exchange rates

GET /exchangeRates

Get exchange rate for currencies

GET /exchangeRate/{codes}
ParameterTypeDescription
codesstringRequired. Currency codes in the ISO-4217 format. E.g. for USDEUR parameter API will response with USD => EUR exchange rate

Add new exchange rate

POST /exchangeRates
Content-Type: x-www-form-urlencoded
RequestTypeDescription
baseCurrencyCodestringRequired. Base currency code in the ISO-4217 format
targetCurrencyCodestringRequired. Target currency code in the ISO-4217 format
ratefloatRequired. Exchange rate

Update exchange rate for currencies

PATCH /exchangeRate/{codes}
Content-Type: x-www-form-urlencoded
Parameter/RequestTypeDescription
codesstringRequired. Currency codes in the ISO-4217 format. E.g. for USDEUR parameter API will update USD => EUR exchange rate
ratefloatRequired. New exchange rate for currency pair

Currency exchange

GET /exchange
QueryTypeDescription
fromstringRequired. Currency code in the ISO-4217
tostringRequired. Currency code in the ISO-4217
amountfloatRequired. Amount to exchange

# Packages

No description provided by the author