{
    "version" : "https://jsonfeed.org/version/1",
    "content" : "news",
    "type" : "single",
    "title" : "The API Briefing: How Do I Use This API? Good Documentation Practices from Department of Labor |Digital.gov",
    "description": "The API Briefing: How Do I Use This API? Good Documentation Practices from Department of Labor",
    "home_page_url" : "/preview/gsa/digitalgov.gov/bc-archive-content-3/","feed_url" : "/preview/gsa/digitalgov.gov/bc-archive-content-3/2015/04/01/the-api-briefing-how-do-i-use-this-api-good-documentation-practices-from-department-of-labor/index.json","item" : [
    {"title" :"The API Briefing: How Do I Use This API? Good Documentation Practices from Department of Labor","summary" : "When I first started coding using BASIC on the Commodore 64, I rarely documented my programs. Neither did many of my fellow programmers which led to numerous hours trying to figure out just exactly how a program worked. Documentation became more vital as programs became more feature rich and complex. In the API world, there","date" : "2015-04-01T14:43:54-04:00","date_modified" : "2025-01-27T19:42:55-05:00","authors" : {"bbrantley" : "Bill Brantley"},"topics" : {
        
            "application-programming-interface" : "Application programming interface"
            },"branch" : "bc-archive-content-3",
      "filename" :"2015-04-01-the-api-briefing-how-do-i-use-this-api-good-documentation-practices-from-department-of-labor.md",
      
      "filepath" :"news/2015/04/2015-04-01-the-api-briefing-how-do-i-use-this-api-good-documentation-practices-from-department-of-labor.md",
      "filepathURL" :"https://github.com/GSA/digitalgov.gov/blob/bc-archive-content-3/content/news/2015/04/2015-04-01-the-api-briefing-how-do-i-use-this-api-good-documentation-practices-from-department-of-labor.md",
      "editpathURL" :"https://github.com/GSA/digitalgov.gov/edit/bc-archive-content-3/content/news/2015/04/2015-04-01-the-api-briefing-how-do-i-use-this-api-good-documentation-practices-from-department-of-labor.md","slug" : "the-api-briefing-how-do-i-use-this-api-good-documentation-practices-from-department-of-labor","url" : "/preview/gsa/digitalgov.gov/bc-archive-content-3/2015/04/01/the-api-briefing-how-do-i-use-this-api-good-documentation-practices-from-department-of-labor/","content" :"\u003cdiv class=\"image\"\u003e\n  \u003cimg\n    src=\"https://s3.amazonaws.com/digitalgov/_legacy-img/2014/11/600-x-393-Robot-with-tools-and-application-programming-interface-sign-Technology-concept-Kirillm-iStock-Thinkstock-450547591.jpg\"\n    alt=\"Robot with tools and application programming interface sign. Technology concept.\"/\u003e\u003c/div\u003e\n\n\n\u003cp\u003eWhen I first started coding using BASIC on the Commodore 64, I rarely documented my programs. Neither did many of my fellow programmers which led to numerous hours trying to figure out just exactly how a program worked. Documentation became more vital as programs became more feature rich and complex. In the API world, there are a number of documentation standards to choose from when documenting an API.\u003c/p\u003e\n\u003cp\u003eNo matter which documentation standard is chosen, make sure that the documentation fulfills these four functions. First, explain what the API does and how it helps the user. Second, explain how to install the API and start using it. Providing code samples and examples of the API in use is the third function. The fourth function of good API documentation is a reference to all the functions and data elements of the API. The API developer may also want to include a section on common errors and how to troubleshoot the API.\u003c/p\u003e\n\u003cp\u003eGood documentation starts with commenting your code. Every programming language has a way to include comments in the code, and there are applications that will parse the code and pull out the comments to create documentation. Developers can also use tools such as \u003ca href=\"http://swagger.io/\" target=\"_blank\"\u003eSwagger\u003c/a\u003e to produce interactive documentation and automate the API documentation process.\u003c/p\u003e\n\u003cp\u003eMany federal agencies do a tremendous job of documenting their APIs and data sources. One of my favorites is the \u003ca href=\"http://developer.dol.gov/\" target=\"_blank\"\u003eDepartment of Labor’s API documentation\u003c/a\u003e. When you first visit Labor’s developer page, you can choose the beginner’s path or the expert path. Choosing the \u003ca href=\"http://developer.dol.gov/beginner/\" target=\"_blank\"\u003ebeginner’s path\u003c/a\u003e takes you to a page that fulfills all four functions of good documentation. There is a general overview of the APIs and the data sources along with plenty of code samples for eight of the most common API programming languages. Click through to specific data sources for the API reference information, which is housed on \u003ca href=\"https://github.com/USDepartmentofLabor/LaborStats-Android\" target=\"_blank\"\u003eGitHub\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eThe best API documentations are the ones that are structured like tutorials. For example, examine how \u003ca href=\"http://usdepartmentoflabor.github.io/Ruby-Sample-App/\" target=\"_blank\"\u003eLabor’s Ruby Government Data SDK Sample\u003c/a\u003e is broken up into a detailed set of steps, from installing the SDK to securing the application to running the application. Making an API \u003cstrong\u003eeasy to use\u003c/strong\u003e is the best way to ensure that the API \u003cstrong\u003ewill be used\u003c/strong\u003e. Federal agencies realize this, and that is why their API documentation is some of the best.\u003cem\u003e*API – Application Programming Interface; how software programs and databases share data and functions with each other. Check out \u003ca href=\"/preview/gsa/digitalgov.gov/bc-archive-content-3/2013/04/30/apis-in-government/\"\u003eAPIs in Government\u003c/a\u003e for more information.\u003c/em\u003e\n\u003cem\u003eEach week, “\u003ca href=\"/preview/gsa/digitalgov.gov/bc-archive-content-3/topics/application-programming-interface/\"\u003eThe API Briefing\u003c/a\u003e” will showcase government APIs and the latest API news and trends. Visit this column every week to learn how government APIs are transforming government and improving government services for the American people. If you have ideas for a topic or have questions about APIs, please contact me via \u003ca href=\"mailto:%20bill@billbrantley.com\" target=\"_blank\"\u003eemail\u003c/a\u003e. All opinions are my own and do not reflect the opinions of the USDA and GSA.\u003c/em\u003e\u003c/p\u003e\n"}
  ]
}
