{
  "openapi": "3.0.1",
  "info": {
    "title": "Treasury Fiscal Data API: Debt, Rates, Auctions, $0.50/1K",
    "description": "Pull official US Treasury Fiscal Data: Debt to the Penny, average interest rates, exchange rates, auction results, or any documented endpoint. One typed row per record. $0.50 per 1,000 rows. No API key.",
    "version": "0.1",
    "x-build-id": "ey3BfUxym9nSRsail"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/conserving_celerytop~treasury-fiscal-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-conserving_celerytop-treasury-fiscal-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/conserving_celerytop~treasury-fiscal-data-api/runs": {
      "post": {
        "operationId": "runs-sync-conserving_celerytop-treasury-fiscal-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/conserving_celerytop~treasury-fiscal-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-conserving_celerytop-treasury-fiscal-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to get",
            "enum": [
              "debt_to_the_penny",
              "average_interest_rates",
              "exchange_rates",
              "auctions",
              "any_endpoint"
            ],
            "type": "string",
            "description": "Debt to the Penny, average interest rates on Treasury securities, Treasury reporting rates of exchange, Treasury auction results, or any other documented Fiscal Data endpoint.",
            "default": "debt_to_the_penny"
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Keep records from this date on, as 2026-01-01 or a period such as 30 days. Applies to the record date (the auction date for auctions). Leave empty for no start date."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Keep records up to this date, as 2026-06-30 or a period such as 7 days. Leave empty for no end date."
          },
          "maxRows": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many rows. Each row is one record and one charged event. The API returns up to 10,000 rows per request; the Actor pages through the rest.",
            "default": 1000
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "newest_first",
              "oldest_first"
            ],
            "type": "string",
            "description": "Newest first or oldest first, by record date (auction date for auctions). In the any-endpoint mode this applies only when Sort field is empty.",
            "default": "newest_first"
          },
          "country": {
            "title": "Country (exchange rates)",
            "type": "string",
            "description": "Exchange rates only: keep one country, spelled as in the data, such as Israel or Euro Zone. Leave empty for all countries."
          },
          "securityType": {
            "title": "Security type (auctions)",
            "enum": [
              "",
              "Bill",
              "Note",
              "Bond"
            ],
            "type": "string",
            "description": "Auctions only: keep Bills, Notes or Bonds. Leave empty for all.",
            "default": ""
          },
          "securityDescription": {
            "title": "Security description (average interest rates)",
            "type": "string",
            "description": "Average interest rates only: keep one security, spelled as in the data, such as Treasury Bills or Treasury Notes. Leave empty for all."
          },
          "endpoint": {
            "title": "Endpoint",
            "type": "string",
            "description": "Any-endpoint mode only: a documented endpoint path, such as v1/accounting/od/gold_reserve. Paths are checked against the Fiscal Data endpoint list; an unknown path ends the run with a free error row."
          },
          "fields": {
            "title": "Fields",
            "type": "array",
            "description": "Any-endpoint mode only: column names to return, one per line, such as record_date. Leave empty for all columns.",
            "items": {
              "type": "string"
            }
          },
          "filter": {
            "title": "Filter",
            "type": "string",
            "description": "Any-endpoint mode only: Fiscal Data filter, joined by commas, such as country:eq:Israel,record_date:gte:2026-01-01. Operators: eq, lt, lte, gt, gte, in. Date from and Date to are added to it."
          },
          "sortBy": {
            "title": "Sort field",
            "type": "string",
            "description": "Any-endpoint mode only: column to sort by, with a minus sign for descending, such as -record_date. Leave empty to sort by record date."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}