API Endpoints
Retrieve a list of active banks. Optionally include recent exchange rates by setting withRecentEx=true.
curl -X GET https://api.et-forex.com/api/v1/banks -H "x-api-key: YOUR_API_KEY"
Request Query
{
"withRecentEx": {
"type": "boolean",
"isOptional": true,
"description": "Include recent exchange rates for each bank"
}
}
Success Response
{
"message": "Success",
"status": 200,
"data": [
{
"id": "string",
"lastRatesUpdatedAt": "2024-11-09T10:39:59.783Z",
"name": "string",
"code": "string",
"imageUrl": "string",
"exchangeRates": [
{
"cashBuying": 0,
"cashSelling": 0,
"transactionalBuying": 0,
"transactionalSelling": 0,
"updatedAt": "2024-11-09T10:39:59.783Z",
"currency": {
"id": "string",
"name": "string",
"symbol": "string",
"imageUrl": "string"
}
}
]
}
]
}
Error Responses
Status 400
{
"status": 400,
"message": "Validation errors occurred.",
"errors": {}
}
Status 401
{
"status": 401,
"message": "API key is required"
}
Status 500
{
"status": 500,
"message": "Internal Server Error"
}
Fetches a list of available currencies that have valid exchange rates, ordered by the rate count.
curl -X GET https://api.et-forex.com/api/v1/currencies -H "x-api-key: YOUR_API_KEY"
Success Response
{
"message": "success",
"status": 200,
"data": [
{
"id": "string",
"name": "US Dollar",
"symbol": "USD",
"imageUrl": "https://example.com/images/usd.png"
}
]
}
Error Responses
Status 400
{
"status": 400,
"message": "Validation errors occurred.",
"errors": {}
}
Status 401
{
"status": 401,
"message": "API key is required"
}
Status 500
{
"status": 500,
"message": "Internal Server Error"
}
Fetches the latest available exchange rates for all active banks or a specific bank if bankId is provided.
curl -X GET https://api.et-forex.com/api/v1/rates -H "x-api-key: YOUR_API_KEY"
Request Query
{
"bankId": {
"type": "boolean",
"isOptional": true,
"description": "The ID of the specific bank to retrieve rates for."
},
"transactional": {
"type": "boolean",
"isOptional": true,
"description": "Include transactional rates in the response if true."
},
"socialLinks": {
"type": "boolean",
"isOptional": true,
"description": "Include social links in the response if true."
}
}
Success Response
{
"message": "Success",
"status": 200,
"data": [
{
"message": "success",
"status": 200,
"data": [
{
"id": 0,
"lastRatesUpdatedAt": "2024-11-09T11:15:26.818Z",
"name": "string",
"code": "string",
"imageUrl": "string",
"socialLinks": [
{
"platform": "string",
"url": "string"
}
],
"exchangeRates": [
{
"cashBuying": 0,
"cashSelling": 0,
"transactionalBuying": 0,
"transactionalSelling": 0,
"updatedAt": "2024-11-09T11:15:26.818Z",
"currency": {
"id": "string",
"name": "string",
"symbol": "string",
"imageUrl": "string"
},
"difference": {
"cashBuying": 0,
"cashSelling": 0,
"transactionalBuying": 0,
"transactionalSelling": 0
}
}
]
}
]
}
]
}
Error Responses
Status 400
{
"status": 400,
"message": "Validation errors occurred.",
"errors": {}
}
Status 401
{
"status": 401,
"message": "API key is required"
}
Status 500
{
"status": 500,
"message": "Internal Server Error"
}
Retrieves the cash and transactional buying/selling rates for a specified currency code.
curl -X GET https://api.et-forex.com/api/v1/rates/best-rates -H "x-api-key: YOUR_API_KEY"
Request Query
{
"currencyCode": {
"type": "boolean",
"isOptional": false,
"description": "The currency code to retrieve the best rates for. eg: USD"
}
}
Success Response
{
"message": "success",
"status": 200,
"data": {
"cashBuying": {
"price": 0,
"updatedAt": "2024-11-09T11:19:01.578Z",
"timestamp": "2024-11-09T11:19:01.578Z",
"difference": "string",
"bank": {
"id": 0,
"name": "string",
"code": "string",
"imageUrl": "string"
},
"rates": [
{
"value": 0,
"timestamp": "2024-11-09T11:19:01.578Z"
}
]
},
"cashSelling": {
"price": 0,
"updatedAt": "2024-11-09T11:19:01.578Z",
"timestamp": "2024-11-09T11:19:01.578Z",
"difference": "string",
"bank": {
"id": 0,
"name": "string",
"code": "string",
"imageUrl": "string"
},
"rates": [
{
"value": 0,
"timestamp": "2024-11-09T11:19:01.578Z"
}
]
},
"transactionalBuying": {
"price": 0,
"updatedAt": "2024-11-09T11:19:01.578Z",
"timestamp": "2024-11-09T11:19:01.578Z",
"difference": "string",
"bank": {
"id": 0,
"name": "string",
"code": "string",
"imageUrl": "string"
},
"rates": [
{
"value": 0,
"timestamp": "2024-11-09T11:19:01.578Z"
}
]
},
"transactionalSelling": {
"price": 0,
"updatedAt": "2024-11-09T11:19:01.578Z",
"timestamp": "2024-11-09T11:19:01.578Z",
"difference": "string",
"bank": {
"id": 0,
"name": "string",
"code": "string",
"imageUrl": "string"
},
"rates": [
{
"value": 0,
"timestamp": "2024-11-09T11:19:01.578Z"
}
]
}
}
}
Error Responses
Status 400
{
"status": 400,
"message": "Validation errors occurred.",
"errors": {}
}
Status 401
{
"status": 401,
"message": "API key is required"
}
Status 500
{
"status": 500,
"message": "Internal Server Error"
}
Fetches exchange rates history for a specific bank and date.
curl -X GET https://api.et-forex.com/api/v1/history -H "x-api-key: YOUR_API_KEY"
Request Query
{
"bankId": {
"type": "boolean",
"isOptional": false,
"description": "The ID of the bank to filter the rates."
},
"date": {
"type": "boolean",
"isOptional": false,
"description": "The date to filter the rates in YYYY-MM-DD format."
},
"currencyCode": {
"type": "boolean",
"isOptional": true,
"description": "The currency code to filter the rates."
}
}
Success Response
{
"message": "success",
"status": 200,
"date": "2020-01-01",
"data": {
"cashBuying": 0,
"cashSelling": 0,
"transactionalBuying": 0,
"transactionalSelling": 0,
"timestamp": "2024-11-13T06:42:05.494Z",
"currency": {
"id": "string",
"name": "string",
"symbol": "string",
"imageUrl": "string"
}
}
}
Error Responses
Status 400
{
"status": 400,
"message": "Validation errors occurred.",
"errors": {}
}
Status 401
{
"status": 401,
"message": "API key is required"
}
Status 500
{
"status": 500,
"message": "Internal Server Error"
}