Historical index values
curl --request GET \
--url https://api.ngnmarket.com/v1/indices/{symbol}/chart \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ngnmarket.com/v1/indices/{symbol}/chart"
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/indices/{symbol}/chart', 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/indices/{symbol}/chart",
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/indices/{symbol}/chart"
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/indices/{symbol}/chart")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngnmarket.com/v1/indices/{symbol}/chart")
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": {
"symbol": "NGX30",
"format": "detailed",
"period": "30d",
"count": 3,
"statistics": {
"start_date": "2026-04-15",
"end_date": "2026-04-17",
"start_value": 2819.3,
"end_value": 2841.45,
"change": 22.15,
"change_percent": 0.79,
"min_value": 2819.3,
"max_value": 2841.45,
"return_1m": 3.42,
"return_3m": 8.17,
"return_1y": 24.55,
"return_ytd": 11.83
},
"data": [
{
"date": "2026-04-15",
"timestamp": 1744675200000,
"index_value": 2819.3,
"normalized_value": 100,
"daily_change": 0,
"daily_change_percent": 0
},
{
"date": "2026-04-16",
"timestamp": 1744761600000,
"index_value": 2829.88,
"normalized_value": 100.38,
"daily_change": 10.58,
"daily_change_percent": 0.38
},
{
"date": "2026-04-17",
"timestamp": 1744848000000,
"index_value": 2841.45,
"normalized_value": 100.79,
"daily_change": 11.57,
"daily_change_percent": 0.41
}
]
},
"meta": {
"plan": "starter",
"calls_used": 4823,
"calls_remaining": 95177,
"reset_at": "2026-05-15T23:57:00.000Z"
}
}Index Endpoints
Index Chart
Retrieve historical daily closing values for any NGX market index.
GET
/
indices
/
{symbol}
/
chart
Historical index values
curl --request GET \
--url https://api.ngnmarket.com/v1/indices/{symbol}/chart \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ngnmarket.com/v1/indices/{symbol}/chart"
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/indices/{symbol}/chart', 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/indices/{symbol}/chart",
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/indices/{symbol}/chart"
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/indices/{symbol}/chart")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngnmarket.com/v1/indices/{symbol}/chart")
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": {
"symbol": "NGX30",
"format": "detailed",
"period": "30d",
"count": 3,
"statistics": {
"start_date": "2026-04-15",
"end_date": "2026-04-17",
"start_value": 2819.3,
"end_value": 2841.45,
"change": 22.15,
"change_percent": 0.79,
"min_value": 2819.3,
"max_value": 2841.45,
"return_1m": 3.42,
"return_3m": 8.17,
"return_1y": 24.55,
"return_ytd": 11.83
},
"data": [
{
"date": "2026-04-15",
"timestamp": 1744675200000,
"index_value": 2819.3,
"normalized_value": 100,
"daily_change": 0,
"daily_change_percent": 0
},
{
"date": "2026-04-16",
"timestamp": 1744761600000,
"index_value": 2829.88,
"normalized_value": 100.38,
"daily_change": 10.58,
"daily_change_percent": 0.38
},
{
"date": "2026-04-17",
"timestamp": 1744848000000,
"index_value": 2841.45,
"normalized_value": 100.79,
"daily_change": 11.57,
"daily_change_percent": 0.41
}
]
},
"meta": {
"plan": "starter",
"calls_used": 4823,
"calls_remaining": 95177,
"reset_at": "2026-05-15T23:57:00.000Z"
}
}This endpoint returns a time series of daily closing values for a specific NGX market index. Narrow the result set with
from and to date parameters, or use period (7d, 30d, 90d, 1y, 5y, all) to request a named time window.
In detailed format, each data point includes a normalized_value field that rebases the index to 100 at the start of the requested period, useful for comparing two indices on the same scale in a single chart.
The statistics block also includes return_1m, return_3m, return_1y, and return_ytd, percentage returns versus fixed historical reference points, computed independently of the period you requested.
Use format=chart for compact [timestamp, value] arrays suited for line charting libraries.
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. Ask for more than your plan allows and you won’t get an error, the response just starts from the earliest date you’re entitled to, so check the returned dates if you need to confirm the actual range.
For example, to fetch one year of NGX 30 closes in chart-ready format:
curl "https://api.ngnmarket.com/v1/indices/NGX30/chart?period=1y&format=chart" \
-H "Authorization: Bearer ngm_live_YOUR_KEY"
const url = new URL('https://api.ngnmarket.com/v1/indices/NGX30/chart');
url.searchParams.set('period', '1y');
url.searchParams.set('format', 'chart');
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/indices/NGX30/chart',
params={'period': '1y', 'format': 'chart'},
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.
Path Parameters
Index symbol (e.g. NGX30). Case-insensitive.
Example:
"NGX30"
Query Parameters
Preset lookback window. Ignored when from/to are supplied.
Available options:
7d, 30d, 90d, 1y, 5y, all Start date in YYYY-MM-DD format (inclusive). Takes priority over period.
Example:
"2026-01-01"
End date in YYYY-MM-DD format (inclusive). Use with from.
Example:
"2026-04-17"
Response shape. detailed returns objects; chart returns compact [timestamp, value] pairs.
Available options:
detailed, chart