{
    "version" : "https://jsonfeed.org/version/1",
    "content" : "news",
    "type" : "single",
    "title" : "Working with APIs for Non-Coders Recap |Digital.gov",
    "description": "Working with APIs for Non-Coders Recap",
    "home_page_url" : "/preview/gsa/digitalgov.gov/bc-archive-content-3/","feed_url" : "/preview/gsa/digitalgov.gov/bc-archive-content-3/2014/07/14/working-with-apis-for-non-coders-recap/index.json","item" : [
    {"title" :"Working with APIs for Non-Coders Recap","summary" : "In a recent event titled: “Intro to APIs: Working with URLs, JSON, APIs, and Open Data—Without Writing Any Code,” federal practitioners and supporters interested in open data attended an in-person workshop, led by Eric Mill, a key developer on GSA’s 18f team. This event was especially targeted to non-developers and explored the basics of APIs,","date" : "2014-07-14T10:00:00-04:00","date_modified" : "2025-01-27T19:42:55-05:00","authors" : {"zeshan-khan" : "Zeshan Khan"},"topics" : {
        
            "application-programming-interface" : "Application programming interface"
            },"branch" : "bc-archive-content-3",
      "filename" :"2014-07-14-working-with-apis-for-non-coders-recap.md",
      
      "filepath" :"news/2014/07/2014-07-14-working-with-apis-for-non-coders-recap.md",
      "filepathURL" :"https://github.com/GSA/digitalgov.gov/blob/bc-archive-content-3/content/news/2014/07/2014-07-14-working-with-apis-for-non-coders-recap.md",
      "editpathURL" :"https://github.com/GSA/digitalgov.gov/edit/bc-archive-content-3/content/news/2014/07/2014-07-14-working-with-apis-for-non-coders-recap.md","slug" : "working-with-apis-for-non-coders-recap","url" : "/preview/gsa/digitalgov.gov/bc-archive-content-3/2014/07/14/working-with-apis-for-non-coders-recap/","content" :"\u003cp\u003eIn a recent event titled: “Intro to APIs: Working with URLs, JSON, APIs, and Open Data—Without Writing Any Code,” federal practitioners and supporters interested in open data attended an in-person workshop, led by Eric Mill, a key developer on GSA’s 18f team. This event was especially targeted to non-developers and explored the basics of APIs, \u003ca href=\"http://sunlightlabs.github.io/congress/\"\u003eusing the Congress API\u003c/a\u003e, offered by the Sunlight Foundation, as an example. The purpose of the event was to showcase that anybody of any skill level can understand and use APIs without any coding knowledge! Below are some takeaways for those who weren’t able to attend the event.\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://s3.amazonaws.com/digitalgov/_legacy-img/2014/07/600-x-400-Sunlight-Foundation-Congress-API.jpg\"\u003e\u003cdiv class=\"image\"\u003e\n  \u003cimg\n    src=\"https://s3.amazonaws.com/digitalgov/_legacy-img/2014/07/600-x-400-Sunlight-Foundation-Congress-API.jpg\"\n    alt=\"600 x 400 Sunlight Foundation Congress API\"/\u003e\u003c/div\u003e\n\n\u003c/a\u003e\u003c/p\u003e\n\u003ch2 id=\"understanding-the-anatomy-of-a-url\"\u003eUnderstanding the anatomy of a URL\u003c/h2\u003e\n\u003cp\u003eIn one sense, APIs are just URLs that lead to data instead of a Web page. In order to explore an API, we need to understand the breakdown of a URL. As an example, take a look at the following URL.\u003c/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #993366\"\u003ehttps://\u003c/span\u003e\u003cspan style=\"color: #339966\"\u003e\u003ca href=\"https://www.flickr.com\"\u003ewww.flickr.com\u003c/a\u003e\u003c/span\u003e\u003cspan style=\"color: #3366ff\"\u003e/search/\u003c/span\u003e\u003cspan style=\"color: #ff0000\"\u003e?sort=relevance\u0026amp;text=ukraine\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #993366\"\u003e\u003cstrong\u003ehttps\u003c/strong\u003e\u003c/span\u003e is the protocol or set of rules used in the communication between the browser and web server.\u003c/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #339966\"\u003e\u003cstrong\u003eflickr.com\u003c/strong\u003e\u003c/span\u003e is the domain name. Think of this as the “web address.”\u003c/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #3366ff\"\u003e\u003cstrong\u003e/search/\u003c/strong\u003e\u003c/span\u003e is a path – a folder in the root folder.\u003c/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #ff0000\"\u003e\u003cstrong\u003e?sort=relevance\u0026amp;text=ukraine\u003c/strong\u003e\u003c/span\u003e is information you are sending to the server.\u003c/p\u003e\n\u003ch2 id=\"apis-aren8217t-complicated\"\u003eAPIs aren’t complicated\u003c/h2\u003e\n\u003cp\u003eAs stated above, APIs are just URLs that lead you to data. There are many formats used to create an API, but JSON is most common these days. There are several reasons for this, including “cleaner” data, greater efficiency, and scalability. One way JSON accomplishes this is by using arrays. Arrays allow values to be compacted, or in other words, arrays are a way of holding data that would be difficult in a two dimensional grid.\u003c/p\u003e\n\u003cp\u003eYou sometimes need an API key to access some APIs. It is usually a quick registration process to obtain one and there should be clear directions for how to do this. The documentation also includes a description and details on what data you can access through the API as well as other information useful to navigating around the API.\u003c/p\u003e\n\u003cp\u003eLastly, by adding certain paths or values in your URL, you can narrow down the API to give you just the data fields you want to access.\u003c/p\u003e\n\u003cp\u003eThe \u003ca href=\"https://congress.api.sunlightfoundation.com/votes?apikey=opendataday\u0026amp;fields=voted_at,chamber,result,required,question,breakdown.total\u0026amp;order=voted_at_\u0026amp;breakdown.total.Yea__gte=70\u0026amp;chamber=senate\"\u003eURL below for the Congress API\u003c/a\u003e has the same features as the Flickr URL mentioned above.\u003c/p\u003e\n\u003cdiv class=\"image\"\u003e\n  \u003cimg\n    src=\"https://s3.amazonaws.com/digitalgov/_legacy-img/2014/07/600-x-52-congress-api-url-in-color.jpg\"\n    alt=\"An image of the very, very long color-coded URL to access the Congress API\"/\u003e\u003c/div\u003e\n\n\n\u003cp\u003eEntering this URL into a browser then returns information specific to the request:\u003c/p\u003e\n\u003cdiv class=\"image\"\u003e\n  \u003cimg\n    src=\"https://s3.amazonaws.com/digitalgov/_legacy-img/2014/07/425-x-620-Nomination-code-API.jpg\"\n    alt=\"425 x 620 Nomination code API\"/\u003e\u003c/div\u003e\n\n\n\u003ch2 id=\"simplify-your-tabular-data-by-converting-your-json-file-into-a-csv\"\u003eSimplify your tabular data by converting your JSON file into a CSV\u003c/h2\u003e\n\u003cp\u003eYou can use \u003ca href=\"http://konklone.io/json/\"\u003ethis tool\u003c/a\u003e to convert your JSON files into CSV (simply copy and paste \u003cspan style=\"color: #222222\"\u003ethe JSON data into the text box\u003c/span\u003e). The purpose of this is to make it easier for you to look at the data. CSV stands for Comma Separated Values and a CSV file stores your tabular data in plain-text that is easily viewed as a spreadsheet.\u003c/p\u003e\n\u003ch2 id=\"conclusion\"\u003eConclusion\u003c/h2\u003e\n\u003cp\u003eThere’s a lot you can do with APIs and you don’t have to be a developer or a coder to do so. \u003ca href=\"http://sunlightfoundation.com/blog/2014/04/03/i-learned-basic-json-in-the-morning-and-made-a-silly-twitter-bot-with-sunlights-api-in-the-afternoon/\"\u003eCheck out this blog post\u003c/a\u003e where a non-developer used the Sunlight API to make a Twitter bot that automatically tweets out Happy Birthday to our Congressmen.\u003c/p\u003e\n\u003cp\u003eAll it takes is a little courage and determination!\u003cem\u003eEditor’s note: GSA will be hosting this session again in the future, so everyone will have a chance to take this class and others like it.\u003c/em\u003e\u003c/p\u003e\n"}
  ]
}
