Skip to content

Practice API Documentation

elif-caliskan edited this page May 12, 2019 · 23 revisions

Practice-API Documentation

Practice-Api has three functionalities fetching real-time Forex data , fetching latest economic events and Login/Sign up.

Foreign Exchange Rates

Practice-Api provides a simple REST API with real-time exchange rates for 168 world currencies, delivering currency pairs in universally usable JSON format. Users may access real-time exchange rates using the Practice-API's t-equipments endpoint.Base currency is USD. Exchange rate data is refreshed every 60 minutes in this version.

  • Endpoint: /t-equipments/

Sample API request:

GET http://api.dev.arkenstone.ml/t-equipments

Sample API response:

{
    "USDAUD" : 1.278342,
    "USDEUR" : 1.278342,
    "USDGBP" : 0.908019,
    "USDPLN" : 3.731504,
    ...
}

RealTime Single Foreign Exchange Rate

This endpoint returns the realtime exchange rate for any pair of digital currency (e.g., Bitcoin) or physical currency (e.g., USD) at the moment.

Parameters

Parameters distinguished by "-" sign and first symbol is from_currency and the second symbol is to_currency parameter. Parameters shall be given as their forex codes.

  • Required from_currency : The currency you would like to get the exchange rate for. It can either be a physical currency or digital/crypto currency.
  • Required to_currency : The destination currency for the exchange rate. It can either be a physical currency or digital/crypto currency.
  • Endpoint: /t-equipments/:currencyA-:currencyB

Sample API request:

GET http://api.dev.arkenstone.ml/t-equipments/USD-BTC

Sample API response:

{
    "rate" : "USD/BTC",
    "value" : "0.00017213"
}

Supported Currency List

A full list of supported currencies can be accessed through the link

Events

Practice-Api provides a simple REST API by delivering economic events as array in universally usable JSON format. Users may access latest events using the Practice-API's events/list endpoint.

  • Endpoint: /events/list

Sample API request:

GET http://api.dev.arkenstone.ml/events/list

Sample API response:

[
    {
        "date" : "2019-05-05T04:15:00",
        "country" :"Egypt",
        "eventName" : "Emirates NBD PMI",
        "signifanceLevel" : 1,
        "actual" : "50.8",
        "previous" : "49.9",
        "forecast" : ""
    },
    {
        "date" : "2019-05-08T00:30:00",
        "country" : "Japan",
        "eventName" : "Nikkei Services PMI",
        "signifanceLevel" : 1,
        "actual" : "51.8",
        "previous" : "52.0",
        "forecast" : ""
    },
    {
        "date" : "2019-05-08T01:00:00",
        "country" : "Philippines",
        "eventName" : "Imports YoY",
        "signifanceLevel" : 1,
        "actual" : "7.8%",
        "previous" : "2.6%",
        "forecast" : ""
    }
]

Sign-Up

Practice-Api provides their users to register to our system. Users send their personal information required to signup to the system.

  • Endpoint: /auth/signup
  • Request Body: Application / JSON
  • Required parameters:
    1. name: String
    2. surname: String
    3. email: String
    4. password: String
    5. location: String
  • Possible error codes:
    1. 400: Duplicate email or missing parameter in request body

Sample API request:

POST http://api.dev.arkenstone.ml/auth/signup

Sample request body:

{
    "name" : 'ExampleName",
    "surname" : "ExampleSurname",
    "email" : "[email protected]",
    "password" : "examplepassword",
    "location" : "ExampleLocation",
    "isTrader": false
}

Sample API response:

{
    "name" : "ExampleName",
    "surname" : "ExampleSurname",
    "email" : "[email protected]",
    "location" : "ExampleLocation",
    "isTrader" : false
}

Login

Practice-Api provides their users to login to our system. Users send their login credentials, which are email and password, to login to the system. The response contains a cookie they may use for further operations.

  • Endpoint: /auth/login
  • Request Body: Application / JSON
  • Required parameters:
    1. email: String
    2. password: String
  • Possible error codes:
    1. 400: Missing parameter or nonexistent email-password pair

Sample API request:

POST http://api.dev.arkenstone.ml/auth/login

Sample request body:

{
    "email" : "[email protected]",
    "password" : "examplepassword"
}

Sample API response:

{
    "name" : "ExampleName",
    "surname" : "ExampleSurname",
    "email" : "[email protected]",
    "location" : "ExampleLocation",
    "isTrader" : false
}
Clone this wiki locally