Historical NGN forex rates
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": {
"format": "detailed",
"source": "USD",
"target": "NGN",
"period": "30d",
"start_date": "2026-04-15",
"end_date": "2026-04-17",
"data": [
{
"source_currency": "USD",
"target_currency": "NGN",
"rate": 1603.5,
"rate_date": "2026-04-17",
"timestamp_unix": 1776384000000
},
{
"source_currency": "USD",
"target_currency": "NGN",
"rate": 1601,
"rate_date": "2026-04-16",
"timestamp_unix": 1776297600000
},
{
"source_currency": "USD",
"target_currency": "NGN",
"rate": 1598.75,
"rate_date": "2026-04-15",
"timestamp_unix": 1776211200000
}
],
"pagination": {
"page": 1,
"limit": 100,
"total": 3,
"pages": 1,
"has_next": false,
"has_prev": false
},
"statistics": {
"latest": 1603.5,
"oldest": 1598.75,
"change": 4.75,
"change_percent": 0.2971,
"min": 1598.75,
"max": 1603.5,
"average": 1601.083333
}
},
"meta": {
"plan": "starter",
"calls_used": 4821,
"calls_remaining": 95179,
"reset_at": "2026-05-15T23:57:00.000Z"
}
}Forex Endpoints
Historical Forex Rates
Retrieve historical NGN exchange rates by currency pair and date range.
GET
/
forex
/
history
Historical NGN forex rates
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": {
"format": "detailed",
"source": "USD",
"target": "NGN",
"period": "30d",
"start_date": "2026-04-15",
"end_date": "2026-04-17",
"data": [
{
"source_currency": "USD",
"target_currency": "NGN",
"rate": 1603.5,
"rate_date": "2026-04-17",
"timestamp_unix": 1776384000000
},
{
"source_currency": "USD",
"target_currency": "NGN",
"rate": 1601,
"rate_date": "2026-04-16",
"timestamp_unix": 1776297600000
},
{
"source_currency": "USD",
"target_currency": "NGN",
"rate": 1598.75,
"rate_date": "2026-04-15",
"timestamp_unix": 1776211200000
}
],
"pagination": {
"page": 1,
"limit": 100,
"total": 3,
"pages": 1,
"has_next": false,
"has_prev": false
},
"statistics": {
"latest": 1603.5,
"oldest": 1598.75,
"change": 4.75,
"change_percent": 0.2971,
"min": 1598.75,
"max": 1603.5,
"average": 1601.083333
}
},
"meta": {
"plan": "starter",
"calls_used": 4821,
"calls_remaining": 95179,
"reset_at": "2026-05-15T23:57:00.000Z"
}
}This endpoint gives you historical exchange rate data between NGN and any supported currency pair. You can narrow results by currency code, date range (
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.
Example:
"USD"
Target currency code. Defaults to NGN.
Example:
"NGN"
Preset window when from/to are not given. Defaults to 30d.
Available options:
7d, 30d, 90d, 1y, all detailed (default) returns full rows with pagination and summary statistics; simple returns every row in the window as {date, rate, timestamp}, unpaginated.
Available options:
detailed, simple Start date in YYYY-MM-DD format (inclusive).
Example:
"2026-01-01"
End date in YYYY-MM-DD format (inclusive). Defaults to today.
Example:
"2026-04-17"
Page number for format=detailed.
Rows per page for format=detailed.