MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your profile page https://xeiqd/profile

Endpoints

Latest rates

requires authentication

Display a listing of the latest exchange rates

To get authorization token, after creating an account go to https://xeiqd/profile page

Example request:
curl --request GET \
    --get "http://xeiqd-new.test/api/v1/latest" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://xeiqd-new.test/api/v1/latest"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "timestamp": 1701543444,
    "date": "02/12/2023",
    "lang": "ar",
    "city": "أربيل",
    "base_currency": "دولار أمريكي",
    "amount": 100,
    "rates": {
        "IQD": 156300,
        "EUR": 91.8998,
        "GBP": 78.6916,
        "USD": 100,
        "TRY": 2889.2533,
        "IRR": 4200274.5
    }
}
 

Request   

GET api/v1/latest

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

lang   string  optional  

Field to return name by language. Defaults to 'AR'. Example: KU

base   string  optional  

Field to add a currency as the base of the conversion. Defaults to 'USD'. Example: GBP

amount   integer  optional  

Field to add an amount of money for the conversion. Defaults to 100. Example: 1000

city   string  optional  

Field to return the rates for a specific city. Defaults to 'Baghdad'. Example: Erbil

symbols   string  optional  

Comma-separated list of fields to include in the response. Example: USD,GBP,EUR,TRY,IRR