Skip to content
GET /v1/history

One country's quarterly debt-to-GDP for a sector

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/debttogdp-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/debttogdp-api/v1/history" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/debttogdp-api/v1/history", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/debttogdp-api/v1/history");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/debttogdp-api/v1/history",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "count": 40,
        "sector": "government",
        "source": "BIS",
        "country": "US",
        "history": [
            {
                "period": "2015-Q4",
                "debt_to_gdp": 99.6
            },
            {
                "period": "2016-Q1",
                "debt_to_gdp": 102.6
            },
            {
                "period": "2016-Q2",
                "debt_to_gdp": 103.3
            },
            {
                "period": "2016-Q3",
                "debt_to_gdp": 103.2
            },
            {
                "period": "2016-Q4",
                "debt_to_gdp": 100.6
            },
            {
                "period": "2017-Q1",
                "debt_to_gdp": 99.6
            },
            {
                "period": "2017-Q2",
                "debt_to_gdp": 98.7
            },
            {
                "period": "2017-Q3",
                "debt_to_gdp": 99.2
            },
            {
                "period": "2017-Q4",
                "debt_to_gdp": 99.4
            },
            {
                "period": "2018-Q1",
                "debt_to_gdp": 99.1
            },
            {
                "period": "2018-Q2",
                "debt_to_gdp": 97.5
            },
            {
                "period": "2018-Q3",
                "debt_to_gdp": 96.7
            },
            {
                "period": "2018-Q4",
                "debt_to_gdp": 98.9
            },
            {
                "period": "2019-Q1",
                "debt_to_gdp": 100.5
            },
            {
                "period": "2019-Q2",
                "debt_to_gdp": 100.7
            },
            {
                "period": "2019-Q3",
                "debt_to_gdp": 103.7
            },
            {
                "period": "2019-Q4",
                "debt_to_gdp": 103.5
            },
            {
                "period": "2020-Q1",
                "debt_to_gdp": 110.7
            },
            {
                "period": "2020-Q2",
                "debt_to_gdp": 125.1
            },
            {
                "period": "2020-Q3",
                "debt_to_gdp": 127.3
            },
            {
                "period": "2020-Q4",
                "debt_to_gdp": 129.3
            },
            {
                "period": "2021-Q1",
                "debt_to_gdp": 125.4
            },
            {
                "period": "2021-Q2",
                "debt_to_gdp": 121.9
            },
            {
                "period": "2021-Q3",
                "debt_to_gdp": 119.3
            },
            {
                "period": "2021-Q4",
                "debt_to_gdp": 119.1
            },
            {
                "period": "2022-Q1",
                "debt_to_gdp": 113.9
            },
            {
                "period": "2022-Q2",
                "debt_to_gdp": 107
            },
            {
                "period": "2022-Q3",
                "debt_to_gdp": 102.1
  
…