{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/statcite-com/json-schema/statcite-com-series-result-schema.json",
  "title": "SeriesResult",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/statcite-com-openapi.json#/components/schemas/SeriesResult",
  "type": "object",
  "properties": {
    "series_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "country": {
      "type": "object",
      "properties": {
        "iso3": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "unit": {
      "type": "string"
    },
    "frequency": {
      "type": "string"
    },
    "observations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "value": {
            "type": [
              "number",
              "null"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      }
    },
    "citation": {
      "$ref": "#/$defs/Citation"
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "fallback_used": {
      "type": "boolean",
      "description": "True when the primary source failed and a fallback source served this result, in which case the value may reflect a different statistical definition. The field is absent on primary-source responses."
    },
    "fallback_reason": {
      "type": "string",
      "enum": [
        "transient",
        "definitive"
      ],
      "description": "Present only alongside fallback_used: 'transient' means a source ranked above the serving one failed temporarily and may serve a different value for the same query once recovered (verify_stat demotes such verifies to cannot_verify); 'definitive' means the primary permanently lacks this series/country (e.g. Taiwan in WDI), so the fallback is that combination's stable serving source and verifies are judged normally with disclosure. It is also set when the primary simply has no value for the requested period."
    },
    "stale_primary": {
      "type": "boolean",
      "description": "True when a latest_only request was answered by the primary source with a value more than 3 years behind the current year while the registry lists other sources for the indicator that StatCite did not query. It describes the primary's own horizon and does not claim that another source is more recent. Absent otherwise."
    },
    "stale_primary_years": {
      "type": "number",
      "description": "Present with stale_primary: the current year minus the year of the value served."
    },
    "stale_primary_unqueried": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Present with stale_primary: the other registry sources StatCite did not query for this request, in precedence order."
    },
    "limitations": {
      "type": "array",
      "description": "Codes for what this figure is NOT, each read from a structured field of the result or from the indicator registry: projection (values in the source's estimate/projection period), fallback_source, stale_primary (the primary answered a latest_only request with an old value and the other registry sources it names were left unqueried), modeled_estimate (a published model output), rounded_source (IMF DataMapper WEO values rounded to one decimal), computed_values (a StatCite transform), stale_latest (a latest_only value more than 3 years older than its retrieval year, with the gap) and outturn_unconfirmed (IMF values before the projection boundary StatCite infers, which the IMF data StatCite reads does not mark as outturns or staff estimates). An empty list means none of these conditions was detected. It is not a warranty.",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "projection",
              "fallback_source",
              "stale_primary",
              "modeled_estimate",
              "rounded_source",
              "computed_values",
              "stale_latest",
              "outturn_unconfirmed"
            ]
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "detail"
        ],
        "additionalProperties": false
      }
    }
  },
  "$defs": {
    "Citation": {
      "type": "object",
      "description": "Every numeric payload carries one of these. Reproduce citation_text when presenting the number.",
      "properties": {
        "source": {
          "type": "string"
        },
        "dataset": {
          "type": "string"
        },
        "series_id": {
          "type": "string"
        },
        "series_name": {
          "type": "string"
        },
        "source_url": {
          "type": "string"
        },
        "api_url": {
          "type": "string"
        },
        "license": {
          "type": "string"
        },
        "attribution": {
          "type": "string"
        },
        "retrieved_at": {
          "type": "string"
        },
        "citation_text": {
          "type": "string"
        },
        "notices": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "export_formats": {
          "type": "object",
          "description": "Ready-to-paste citation strings derived from this citation's own fields, so they can never disagree with citation_text.",
          "properties": {
            "bibtex": {
              "type": "string"
            },
            "apa": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}