curl --request GET \
--url https://api.ngnmarket.com/v1/forex/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ngnmarket.com/v1/forex/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ngnmarket.com/v1/forex/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngnmarket.com/v1/forex/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ngnmarket.com/v1/forex/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ngnmarket.com/v1/forex/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngnmarket.com/v1/forex/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"date": "2026-04-17",
"currency": "USD",
"rate": 0.000623
},
{
"date": "2026-04-16",
"currency": "USD",
"rate": 0.000621
},
{
"date": "2026-04-15",
"currency": "USD",
"rate": 0.000619
}
],
"start_date": "2026-04-15",
"end_date": "2026-04-17",
"meta": {
"plan": "starter",
"calls_used": 4821,
"calls_remaining": 95179,
"reset_at": "2026-05-15T23:57:00.000Z"
}
}Historical Forex Rates
Retrieve historical NGN exchange rates by currency pair and date range.
curl --request GET \
--url https://api.ngnmarket.com/v1/forex/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ngnmarket.com/v1/forex/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ngnmarket.com/v1/forex/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngnmarket.com/v1/forex/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ngnmarket.com/v1/forex/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ngnmarket.com/v1/forex/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngnmarket.com/v1/forex/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"date": "2026-04-17",
"currency": "USD",
"rate": 0.000623
},
{
"date": "2026-04-16",
"currency": "USD",
"rate": 0.000621
},
{
"date": "2026-04-15",
"currency": "USD",
"rate": 0.000619
}
],
"start_date": "2026-04-15",
"end_date": "2026-04-17",
"meta": {
"plan": "starter",
"calls_used": 4821,
"calls_remaining": 95179,
"reset_at": "2026-05-15T23:57:00.000Z"
}
}from/to), and record count, making it straightforward to populate charts, backtest models, or power rate-change alerts.
The source and target parameters default to USD and NGN respectively. Pass both to query any supported pair in either direction. This endpoint requires a Hobby plan or higher.
How far back you can go depends on your plan. Hobby gets 2 years, Starter gets 5, and Pro, Business, and Enterprise get the full record. A from date older than your plan allows won’t error, the response just starts from the earliest date you’re entitled to, so check the returned dates rather than assuming the request failed.
For example, to fetch GBP/NGN rates for Q1 2026:
curl "https://api.ngnmarket.com/v1/forex/history?source=GBP&target=NGN&from=2026-01-01&to=2026-03-31" \
-H "Authorization: Bearer ngm_live_YOUR_KEY"
const url = new URL('https://api.ngnmarket.com/v1/forex/history');
url.searchParams.set('source', 'GBP');
url.searchParams.set('target', 'NGN');
url.searchParams.set('from', '2026-01-01');
url.searchParams.set('to', '2026-03-31');
const res = await fetch(url, {
headers: { Authorization: 'Bearer ngm_live_YOUR_KEY' },
});
const { data } = await res.json();
import requests
res = requests.get(
'https://api.ngnmarket.com/v1/forex/history',
params={
'source': 'GBP',
'target': 'NGN',
'from': '2026-01-01',
'to': '2026-03-31',
},
headers={'Authorization': 'Bearer ngm_live_YOUR_KEY'},
)
data = res.json()['data']
Authorizations
Pass your API key as a Bearer token: Authorization: Bearer ngm_live_YOUR_KEY.
Generate keys at ngnmarket.com/dashboard/developer.
Query Parameters
Source currency code (e.g. USD, EUR, GBP). Defaults to USD.
"USD"
Target currency code. Defaults to NGN.
"NGN"
Shorthand currency filter when querying NGN-based rates. Overridden by explicit source/target.
Start date in YYYY-MM-DD format (inclusive).
"2026-01-01"
End date in YYYY-MM-DD format (inclusive). Defaults to today.
"2026-04-17"
Maximum number of records to return.
Response
Historical forex rates retrieved successfully.
Quota and plan metadata included on every authenticated response.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Date of the oldest rate returned. Reflects any plan-based history depth cap applied to your from date.
"2026-04-15"
Date of the most recent rate returned.
"2026-04-17"