Federal Deficit

U.S. federal government surplus or deficit, showing the fiscal balance in dollars and plotted alongside Bitcoin price.

How to call

Request format

GET
curl -X GET "https://newhedge.io/api/v2/metrics/federal-deficit/METRIC_NAME?api_token=YOUR_TOKEN"
Query params

api_token (required) — 24 character token.

resolution (optional) — 1d only for the metrics on this chart. Any other value is refused with a 400 that names what is available; see Resolutions.

before (optional) — exclusive cursor, returns observations older than this timestamp_ms. Works on every resolution.

limit (optional) — the most recent N observations, maximum 5000. Finer resolutions page by default (2500); a 1d request returns the whole series unless you send limit or before.

before and limit narrow a time series. A response with no single time axis, such as a hash keyed by venue or a labelled snapshot table, has nothing to cut on. It is returned whole, and both parameters are ignored rather than rejected.

A before that is not a positive epoch-millisecond timestamp is a 400. It is the one paging value we reject rather than ignore, because a page size has a sensible default and a cursor does not.

include (optional) — definition wraps the response as {"definition": …, "data": …} and returns the record shown under each metric; see Definitions. Any other value is a 400.

Path params

:metric_name — one of the metric names listed below.

Responses

200 with JSON payload, 400 for an unknown include value, 401 for missing/invalid token, 404 for missing resources.

Metrics

Each metric is fetched independently. Responses are trimmed samples to show structure.

1 metrics
Metric

Federal Deficitfederal_deficit_usd

Data used by the Federal Deficit chart.

Resolutions: 1d only.

Endpoint
https://newhedge.io/api/v2/metrics/federal-deficit/federal_deficit_usd?api_token=YOUR_TOKEN

Replace `YOUR_TOKEN` with your API token.

Sample response
200 Successful response
[
  [
    1759017600000,
    -1815377.0
  ],
  [
    1759104000000,
    -1815377.0
  ],
  [
    1759190400000,
    -1774684.0
  ]
]
Definition (from the chart description)

Value: U.S. federal government surplus or deficit, showing the fiscal balance in dollars and plotted alongside Bitcoin price.

Units: usd