{
  "name": "oecd-government-debt",
  "title": "General Government Debt and Deficits from OECD National Accounts",
  "description": "General government debt and net lending or net borrowing (the deficit or surplus) as a percentage of GDP, by country and year, from OECD National Accounts at a Glance (Chapter 6: General Government) via the OECD Data Explorer API. Debt on two OECD measures: gross debt (D4, the SNA measure, including government employee pension liabilities) and adjusted debt (D3, without insurance, pensions and standardised guarantees, which OECD says is comparable across countries). Debt covers 37 OECD member countries, 1995-2025 (start years vary); net lending covers 42 countries (37 OECD members, excluding Türkiye, plus Brazil, China, Indonesia, Russia and South Africa), from 1970 for some. General government (central, state, local and social security), SNA definitions: not central government, not Maastricht debt. Values are OECD's, unchanged. Frozen snapshot of 29 November 2026. Source: OECD. Package licence: CC BY 4.0; see the licensing assessment in the README (Source and licence) and archive/PROVENANCE.md.",
  "licenses": [
    {
      "name": "CC-BY-4.0",
      "title": "Creative Commons Attribution 4.0 International: package licence selected by the publisher. Our understanding is that OECD's data terms permit reuse with attribution; this is not a quotation of an explicit CC BY 4.0 designation for this source table. See https://www.oecd.org/en/about/terms-conditions.html and archive/PROVENANCE.md. Credit: OECD, National Accounts at a Glance.",
      "path": "https://www.oecd.org/en/about/terms-conditions.html"
    }
  ],
  "sources": [
    {
      "title": "OECD National Accounts at a Glance, Chapter 6: General Government (OECD Data Explorer dataflow OECD.SDD.NAD:DSD_NAAG_VI@DF_NAAG_VI)",
      "path": "https://sdmx.oecd.org/public/rest/dataflow/OECD.SDD.NAD/DSD_NAAG_VI@DF_NAAG_VI/latest"
    },
    {
      "title": "OECD Government debt by instrument coverage (D1-D4 definitions; dataflow OECD.SDD.NAD:DSD_PSD_D1D4@DF_PSD_D1D4)",
      "path": "https://sdmx.oecd.org/public/rest/dataflow/OECD.SDD.NAD/DSD_PSD_D1D4@DF_PSD_D1D4/latest"
    },
    {
      "title": "OECD Data Explorer SDMX API (how the data were retrieved)",
      "path": "https://sdmx.oecd.org/public/rest/"
    },
    {
      "title": "OECD Data Explorer (browse the same tables)",
      "path": "https://data-explorer.oecd.org/"
    }
  ],
  "upkeep": {
    "mode": "frozen",
    "snapshot": "2026-11-29"
  },
  "status": "structured",
  "resources": [
    {
      "path": "data/general-government.csv",
      "name": "general-government",
      "title": "General government gross debt, adjusted debt and net lending (% of GDP), by country and year",
      "mediatype": "text/csv",
      "format": "csv",
      "encoding": "utf-8",
      "schema": {
        "fields": [
          {
            "name": "country_code",
            "type": "string",
            "description": "ISO 3166-1 alpha-3 country code (OECD REF_AREA code)."
          },
          {
            "name": "country",
            "type": "string",
            "description": "Country name, as given in OECD's data."
          },
          {
            "name": "year",
            "type": "year",
            "description": "Calendar year. Debt is the stock at the end of the year."
          },
          {
            "name": "gross_debt_pct_gdp",
            "type": "number",
            "unit": "% of GDP",
            "description": "Gross debt of general government, % of GDP (OECD measure LES13_FD4; debt instruments D4: SDRs, currency and deposits, debt securities, loans, insurance, pensions and standardised guarantees, and other accounts payable). SNA definition; less comparable across countries because of different recording of government employee pension liabilities. Empty where OECD has no figure."
          },
          {
            "name": "adjusted_debt_pct_gdp",
            "type": "number",
            "unit": "% of GDP",
            "description": "Adjusted debt of general government, % of GDP (OECD measure LES13_FD3; D3 = D4 without insurance, pensions and standardised guarantees). Comparable across OECD countries, per OECD. Empty where OECD has no figure."
          },
          {
            "name": "net_lending_pct_gdp",
            "type": "number",
            "unit": "% of GDP",
            "description": "Net lending (+) / net borrowing (-) of general government, % of GDP (OECD measure B9S13): revenue minus expenditure; negative is a deficit. Empty where OECD has no figure."
          },
          {
            "name": "net_lending_status",
            "type": "string",
            "description": "OECD observation status for net_lending_pct_gdp: empty for a normal value, E estimated value, B break in series."
          }
        ],
        "primaryKey": [
          "country_code",
          "year"
        ]
      }
    }
  ],
  "views": [
    {
      "name": "g7-adjusted-debt",
      "title": "General government adjusted debt (D3), G7 countries, 1995-2025 (% of GDP)",
      "resources": [
        "general-government"
      ],
      "specType": "vega-lite",
      "spec": {
        "width": "container",
        "height": 340,
        "transform": [
          {
            "filter": {
              "field": "country_code",
              "oneOf": [
                "CAN",
                "FRA",
                "DEU",
                "ITA",
                "JPN",
                "GBR",
                "USA"
              ]
            }
          },
          {
            "filter": "isValid(datum.adjusted_debt_pct_gdp) && datum.adjusted_debt_pct_gdp !== ''"
          }
        ],
        "layer": [
          {
            "mark": {
              "type": "rule",
              "strokeDash": [
                4,
                4
              ],
              "color": "#888"
            },
            "encoding": {
              "y": {
                "datum": 100
              }
            }
          },
          {
            "mark": {
              "type": "line",
              "strokeWidth": 1.75
            },
            "encoding": {
              "x": {
                "field": "year",
                "type": "quantitative",
                "axis": {
                  "title": null,
                  "format": "d"
                }
              },
              "y": {
                "field": "adjusted_debt_pct_gdp",
                "type": "quantitative",
                "axis": {
                  "title": "Adjusted debt, % of GDP"
                }
              },
              "color": {
                "field": "country",
                "type": "nominal",
                "title": null
              },
              "tooltip": [
                {
                  "field": "country",
                  "type": "nominal"
                },
                {
                  "field": "year",
                  "type": "quantitative",
                  "format": "d"
                },
                {
                  "field": "adjusted_debt_pct_gdp",
                  "type": "quantitative",
                  "format": ".1f",
                  "title": "adjusted debt (D3), % GDP"
                },
                {
                  "field": "gross_debt_pct_gdp",
                  "type": "quantitative",
                  "format": ".1f",
                  "title": "gross debt (D4), % GDP"
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
