dcsimg

TreasuryDirect for...

  • Individual
    • Learn about purchasing & holding Treasury Securities
    • Set up an online account
  • Institutional
    • Access data & rules on securities auctions
    • Obtain information about Treasury securities
  • Government
    • Invest through the Federal Investments program
    • Purchase & manage SLGS
    • Borrow from the Treasury or liquidate securities

Web APIs

We provide these services as a standard means for requesting TreasuryDirect.gov data.  These API are Restful or Representational State Transfer (REST) based.

Restful APIs use HTTP requests to specific URLs, passing URL parameters as arguments to the services. These services return data in the HTTP request as either JSON or XML for parsing and/or processing by your application.

A typical Restful request is generally of the following form:

  • http://treasurydirect.gov/api/service/output?parameters

In the above example, service indicates the particular service requested and output indicates the response format (usually json or xml).

API Documentation

The purpose of this documentation is to give developers the basic information needed to successfully use these services.  All APIs are case sensitive; adhere to a default order and a maximum size; and the Terms and Conditions.