 Alright, welcome everyone to the help. I'm an accidental government information library webinar series. My name is Linda. I am the chair of Godort and senior data librarian at the Cornell Center for Social and the Cornell Center for Social Sciences. Sorry. So this series is brought to you by the American Library Association's government documents roundtable and the NCLA government resources section. And in the future Godort will take over the webinars. But right now the organizations are working together to bring you this series during that transition period. So we're really excited to work together and we're really excited just about the future of the help series, including our new logo, which is quite lovely. So thank you for coming. We are in webinar mode. This is a newer thing for us. So you are welcome to chat with us throughout as in the past and you can use the Q&A. We are also testing out some of the fun beta features in the Q&A. So if you want to upvote or comment on people's questions, you are welcome to do that. Feel free to play around. I haven't seen that feature yet. Feel free to play around with it if you want. So you can use the Q&A. It will go to the panelists primarily I think that's the default or the panelists and attendees we do ask that you ask questions of that all attendees can see either through the Q&A or through the chat function either one that you choose. If you have any questions, feel free to email me at LMK277 at Cornell.edu and I'll try to guide you through some some solutions. Also, Samantha is our tech support for the webinar and she can you can chat with her directly if you have questions. But in the worst case scenario we are recording this session so we'll put it up on our YouTube channel, which I will send a link to that in a minute. And you can watch it later. So we do have some upcoming webinars, a couple of plans one March 18th we'll have researching law in Europe with one of our regulars whose name is Howard Carrier, and then April we're going to have I think a webinar on the World Health Organization in conjunction with Pippers in May we'll do a webinar on researching state legislatures. And then the next one after that's September but if you have ideas we have plenty of spaces open for the fall summer and the fall for webinars. So if there's something that you'd like to see us do just shoot me an email or chat or however you want to let me know what you would like to see us do for help series. So today's webinar is a really special one because this webinar we did in 2016. And we looked at the data recently for the webinar series to look at the views and and this was the most viewed webinar. The series had about that over 1000, I think my maybe about 1500 views. And it got a lot of comments to which was great so we realized that 2016 to 2020 is, you know, there's a lot of a lot has changed in those years when it comes to API so we wanted to have a reboot of this webinar and invited back Julia to talk more about that. So I'm going to let her take over the sharing and I'll give an intro for Julia. She's doing that. So Julia is the librarian for government information packaging and political science at Michigan State University. She has a BA in history from Michigan State University and MLIS and graduate certificate in records and information management from Wayne State University. And she's a officer in Godot we're very excited, our committee chair and Godot we're very excited to have her with us today. Thank you very much Julia. Thank you so much Linda and thank you all for joining this webinar today on the API of data dot gov redux. As Linda mentioned this is an updated presentation on the same topic from 2016, but some information has changed. Not a lot for the little bit so we're going to go over that today is that we have more up to date information. So at the end of today's webinar you'll be able to understand and explain what an API is know how to navigate data dot gov to find API and have an understanding as to how you might use API is in your projects. So this is going to be kind of a, you know, 10,000 foot review of the topic so we're not going to be going into like delving deep into coding or details like that. So that's way more intense, but I will talk about resources that you can use. If you want to learn more about how to use an API or what coding languages you ought to use and so that will be covered towards the end of the presentation today. So what exactly is an API. API is our everywhere they're in our apps our websites are online widgets, but unless you're a developer, you might not really understand their purpose or their importance. So some of different dictionary definition is application programming interfaces or API is our software tool which performs a particular computational function. API is active building blocks allowing software developers to create new applications without having to code every single function from scratch. So they can write their code to link up to API is that are maybe housing databases or data or other information. So instead of having to write code specific every single time you want to pull information out of an API, you can just write and link to the API to pull that information into your own website. So it saves a lot of time. So in non technical terms, what this really is saying is that API is allow for seamless access and use of information and data stored elsewhere. So this means that developers don't need to write every little piece of code from scratch as I mentioned, they just need to write code to retrieve that information from the API that contains all the information they want to pull from, which helps speed up the process when software or websites are talking and when you're interacting with them it helps speed up the interaction process so there won't be a lot of lag time code won't be as complex because you're pulling from this API. So since that code is also being retrieved, since that code is retrieving information that's stored elsewhere, it means that you don't need to worry about updating the data or information yourself, since it's being updated centrally by the API managers. So because of this aspect, it makes the development of websites apps widget software, etc, much more efficient. You're not responsible for maintaining and updating a bunch of databases, if you're using an API, you just need to make sure that you create queries that can pull from the API's and let those who maintain the data in the API steal with keeping that data updated. And anyone who's ever done database management knows the importance of keeping databases up to date, and the hassle it can be to make sure that all the information in the database is is accurate so by being able to pull from a centrally located and stored database through an API. It helps make sure that the information is more up to date without you, the outside developer having to worry about all of that. There's a bit more technical background about API's just to give you an idea about how exactly they're constructed, but you don't really need to know this per se, this is just me being thorough. So API's are built with a series of protocols. Some protocols might be so which is an older format or rest. These protocols are combined with formats like Jason or XML, and with the combination of protocol and format and API is born, and this API has the ability to offer a variety of functionality that other developers can tap into when those developers are creating their own interfaces. In order to actually use an API, you'll need to know a scripting language such as Python or PHP and using these languages developers can write commands to access the information and data from the API. A good API will have documentation for how to use them, such as example queries and commands so that the developer who's trying to take advantage of all the API has to offer doesn't have to guess as to what command does what. Not all API's have good documentation, or in some cases any documentation at all, which makes them a lot harder to use. Luckily, as we'll see later, a lot of the API's that are on data.gov have really great documentation which makes it so a user can go in and know exactly how to build their query to use that API and help get government out information out there to the public. So why would anyone want to use an API? As I mentioned earlier, you don't need to download, store, or update the data or information in your own database or databases. This means that every developer is using the exact same data and information, and since it's in an API, anyone can access and use that data, of course depending on permissions and licensing. API's also help create a more seamless user experience by enabling developers to create interrelated systems. This seamless integration is one of the reasons why we often don't realize that we're accessing information that's stored on an API. An example of this is when you're on a storage website, for example, and it allows you to type in your zip code to find the nearest store. Chances are, when you type that in, you're pulling information from Google Maps API, for example, in order to find the closest store. Additionally, API's help save developers time since they won't have to rewrite code for every little thing. They just need to write code to access the API and pull that information into their own app, website, or whatever they're working with. Now that we've covered some of the basics of APIs, we're going to move on to talking about data.gov. Data.gov was launched in May of 2009, and its goal was to be a clearinghouse for locating not only governmental datasets, but also APIs and an attempt to foster a more open government. By creating APIs that the public can access and use, government information and data is much more accessible to the public. So agencies and other organizations can allow other developers to spend time and money on developing user interfaces to access this information and government created data. Developing apps and websites uses a ton of developer time, and by allowing the public to have this ability to access government information easily, it helps free up governmental agency developers to focus on other tasks. That isn't to say that government agencies never create their own apps, it just means that they aren't the only ones responsible for their creation in order to allow the public to use this information. And I'm going to point out when we go a little bit further where exactly you can find the licensing terms in data.gov. So if you are developing something you can see what that data is licensed or what that API is licensed to do and who can access it. So this is what the homepage of data.gov looks like. You can search in the search box for specific topics, or you can click in the upper center where it says data to allow a more faceted search. So giant center search box, you can click on data as I mentioned. And once you do that you'll see that there's a ton of data sets available. And it's not all federal organizations as you can see there's some city government state government universities, you can change the filter to see what organizations have published their data here, as well as what bureaus are available in this as well. So not all bureaus are listed, not all agencies have their data in data.gov, but many do. So if you scroll up towards the top on the filters you can search by format I like to change to A to Z, and then click on API, and you'll see that there are quite a few available. You can search by sort by the order of popularity, name A to Z, things like that. Once again you have more filtering options on the left hand side to get an idea of what organizations are there. But you'll notice that by searching for API, some agencies aren't listed. And for those we'll talk about later how you can find their API is because many like the Census Bureau and NASA do have them. So if you find one of interest you can click on it. And once you do that you can get more information which includes metadata contact information for the person maintaining the API, as well as licensing information towards the top access and use so many of these in data.gov are going to have a public statement saying that this is for anyone can use it for the public and any licensing terms will be available by clicking on license. Some will have Creative Common License, some will have more additional restrictions so it's important to keep those in mind if you plan on using any of these API so that you're in compliance. So clicking on download will give you detailed documentation for using this particular API. The EPA does a fantastic job with showing you how exactly to build your query. And what you're doing is you're just plugging in a URL to access the API and then constructing your query to pull information out of that and they give you parameters and explain what the results would be. They give you tons of examples they show you what the examples would look like. And so you get a really good idea of how exactly your search should look when you're writing your code and what to expect with your search results. And so with that, one of the things that was built using this particular API was the UV index which is an iOS mobile app. It pulls from the EPA and Viral Facts API and specifically is using the UV index API. And this app allows users to find out the UV index using their zip code and lets users easily see their risk for UV damage. The UV index API could also be helpful to include, for example, if you're thinking what could I use this API for? If you are building a website or an app about outside activities, you can integrate this API into your app or your website and allow users to plug in their zip code or you can also use location detection on their device so that way users can easily see how it was there for sun damage when they participate in that outdoor activity and also what precautions they should consider taking before embarking on that outside activity. So that's just an example of how one developer is using this particular API. Of course there are many other uses for this but this is just one I wanted to highlight. So one thing that I mentioned is that data.gov is just a clearinghouse. So that means that the data is not hosted on data.gov. On occasion when you click on links, they might not work or they might take you to a different site than you expected. So this is especially true of older data sets that might have had links change since the record was originally created on data.gov. So just keep in mind that you might have to do a little hunting once you find something of use in the event you encounter a broken link. But at least on that landing page you do get some contact information so you can try and contact the person responsible to get updated links and let them know that their data.gov entry needs some updating. And not all APIs include documentation, which can be a bit frustrating especially if you're just getting started using an API as you may need to do a fair amount of trial and error to get your API queries to work properly. A good API will include detailed documentation for example what I showed with the EPA. This helps guide the user but documentation is not a requirement so that's something to keep in mind is that you may get really lucky and find great documentation that really help you get started with the API and build successful queries. That's not always the case though. But heavy data producing agencies don't upload all of their data or their APIs to data.gov. When you are looking for census information for example, you probably aren't thinking I'm going to go to data.gov and look for, you know, the number of people living in this particular city or other census related information. I think I'm going to go to data.census.gov and I'm going to pull that information directly from the Census Bureau. And that's true for major data producing agencies, not just the census but also the FDA, NASA, and others and this also is true for their APIs. But that doesn't mean that these bureaus and agencies don't have APIs. If you're looking on data.gov and you know that, you know, for example, the census, when you think that they would have APIs available, I recommend going to your search engine and typing in the name of the agencies and including API and your search and see, to see if they might have an API specific portal, which many of them do and I'll talk more about these portals later. But they really help. It complicates things, but in some ways it's nice because all the information related to those specific APIs are in one place. You just have to remember to go to a couple of places to find that. Also, to use certain APIs, for example, those created by the Census or NASA, you need to request an API key or token, and this will be clearly stated in any documentation for that API, or on any sort of API portal, or an API key to get queries to work. And this is because some APIs have limits as to how many times a day you can send queries. So certain NASA APIs, for example, have a limit of 1000 queries an hour per API key. And this is to help protect NASA servers from getting in an overloaded and inundated with queries that could overload their servers and make their sites go down for a bit. That's something to keep in mind. So I'm going to talk a little bit now about the major data producing agencies that have their own API portals. This includes the FDA found at open.fda.gov. The Census Bureau at census.gov slash data slash developers.html food data central through the USDA at fdc.nal.usda.gov and the Department of Labor at developer.dol.gov. So these portals, while an additional step for you to get access to APIs and find that information, they help centralize all the information for a developer. So you can find all of the APIs that the agency may have as well as developer tools all in one place. And these specialized API portals provide access to detailed information relating to all the available APIs, including how to use them developer forums to discuss any issues with using their APIs. There's links to access the API key up at the top. You can find more information about how exactly to work with the API, including, like I said, getting the API key. They also post some other code onto code repositories such as GitHub, and you can pull from some of that code when you're working on your own apps. And if you want to learn more about a data set. You can click on that to get more information and it will give you all the detail parameters and what to expect with your queries. So this information would be rather hard to convey in a meaningful and useful manner in a non centralized site like data.gov where you just have all this information thrown at you all these search results would be really hard to sift through. So in some ways it makes sense for these agencies to create these specific these API specific portals to help facilitate the use of their data and API so it streamlines it in some ways. It's just something to keep in mind is that not everything is on data.gov, but there is a lot of content there. There's a website that is pulling from open FDA's API for food and drug recall information. And this website allows users to easily add their search criteria to find out about recalls in their state, for example. If the site didn't have access to FDA's API for this information, the website would need to maintain their own database or databases with all this information, which would be difficult to keep up to date with the FDA's own databases. If they're pulling from the centrally maintained API, all the developer needs to worry about is the accuracy of their code. It also helps ensure consistency across users and developers. So one site isn't going to say that this product has been recalled, and another site may say something else has been recalled and contradict each other or be, you know, not not have the same results because they're all pulling from the source they're all pulling from API source that's maintained by the FDA so you can trust that it's up to date and properly maintained and has accurate information. We're going to take a look at another example. And this one, this site is pulling data from several census APIs. And this site is cleargov.com and it allows users to find out information, including detailed demographic and local government financial information, all in one spot. And you can see by these results that there's a lot of infographics, a ton of data contained here. And with the search, it took just seconds to pull from. If it weren't using an API, it would probably be a slower search result because it would have to go to multiple databases to build this information. And the developer of this website would also have to maintain their own databases against the census databases to keep everything up to date and the same across the sites. And that would be an absolute nightmare to maintain but because they're able to tap directly into various census APIs to pull through that information through queries. It was a much more seamless user experience. It's accurate. It's up to date with whatever data the census has. So, whether you find an API through data.gov or through an agency specific API portal like NASA or the Census Bureau, once you find an API you want to play around with, you'll need some additional help, either through learning to code in a language, such as Python, or by playing around with a site like hopscotch to create and test your own APLs, API calls, and test what you're learning through reading documentation. So, where exactly do you go to learn code other than enrolling in classes? You could go to Code Academy at CodeAcademy.com, which is a great interactive training website that allows you to learn all sorts of code. Most of the training available is free, but they do have some pro content and some certificates that do cost money. And here's just a sampling of some of the languages that are available. For APIs, I recommend learning a language like Python or PHP. And once you practice through the Python tutorials, for example, you can see what you've learned and practice with Python using the Watson API on Code Academy. So, you can actually get some hands-on experience putting the code that you just learned into action by pulling from another API. And another fantastic site is W3Schools at W3Schools.com. It's also free and also at your own pace. Once again, here's a sampling of the languages that they have available. They have PHP, JSON, Python, XML. These are all helpful languages for working with APIs. And while learning code is great, it's a great tool to add to your skill set. Being realistic, we all have so much on our plates that we don't necessarily have time for such an endeavor. But when reading API documentation, if we want to practice what we learn and see if we're actually like understanding how to write a query, how to write a call to the API, there are tools out there that can help you play around and see if you understand what you're reading. So one of those tools is hopscotch.io. And it is a free open source website. It is just in your browser. You don't have to download anything or have anything to run it. It allows you to just plug in what your request to the API, the URL, and then any parameters that you want to play around with. Using this and the NASA API for the astronomy picture of the day, I'm going to look at the documentation, see I'm going to write a get call to the API, and take that URL over to hopscotch, paste that in. NASA does require an API key because they do limit how many times you can query their API, but they do have a demo key which I'm going to add as a parameter. I'm going to add another parameter. I want to be able to play around with, see what the picture of the day was for a specific date. So my parameter will be date, and then the format as listed in the documentation is year-month-day. And then if I had more parameters, I could add them. I'm going to see if this actually worked. I'll press send. And it provides the results in JSON format. So you can see that yes, this query does work. I can format things properly. If I had this built into an app or a website, I can have it automatically generate the picture after someone types in a date. But since I don't have that, I can go ahead and just pull up the URL. I can change the date just to make sure it wasn't a fluke or something, and see what the picture of the day was for January 6, for example. I can see that it is a different image produced. So I can see, oh, okay, I do understand how to write queries using this API. It does generate a different image. I think I have a basic understanding. I'm going to go ahead and I can plug this into whatever I'm developing. So that was my little overview of APIs. I'd like to thank you all. I know that APIs are very complicated. So I was able to explain what they are, why we need them, and give you all an idea of where to get started with playing around with APIs. And remember that documentation is your friend when it comes to APIs or really any sort of code work. So I'm going to open it up to questions. Thank you so much, Julia. I'm going to stop sharing my screen. Okay, so yeah, if you have questions, feel free to chat or use the Q&A. One question I have, and this is for Julia and for anybody else too who's interested or who does this, but are there, do you support users in your library and in what ways have you worked with users? And what are the examples of times that you've worked with users with APIs? Mostly for me, it's been directing them to available APIs. So someone will come to me with a reference question and say, I want to pull, for example, demographic information. How can I easily do that for my project I'm working on. Usually it's like undergrad type projects or things like that for like a computer science class and they just want to be able to link into an already created freely available API. And then direct them as to how to find them where to find the developer tools. And so it's that type of thing. So I don't really get into the coding aspects of it. I leave that to the computer science professionals. But this is mostly, I view it as a general reference type question of letting users know that these APIs are out there. You can tap into government information and just like all government information, it's really available. It's really accessible. We're paying for it with our tax dollars, please use it. It's just basically a way of marketing government information in another way and reminding users that it's there to use. Awesome. Thank you very much. Yeah, it's definitely useful to see the. Are there any questions out there. Do you want to chat about how you're using APIs or things you like about. So, oh, yeah, Lynn says she's encounters APIs in the context of bulk downloads most recently com trade in nexus rest, rather than for developers. Is there a difference in the way the queries are entered. And it depends on how they're written. So it really depends and like I said documentation is your friend for this. And there was actually there's I was looking for a bunch of different, not just the data gov and US government but a bunch of agent like an international groups have created APIs. Looking for it. But I have a link where it has the World Health Organization and some others I think that I think that was one of them that created APIs, there's a lot of them that provide the documentation on how to pull do bulk downloads. Yeah, I'll send it along. Is there one government API that you are that you are requested to help with the most from your faculty. You run into that for me, not so much the one in particular it's mostly just referencing type questions of I'm trying to find an API available to do X so a lot of the questions I see are related to demographic information, people really want to build what apps or websites related to being able to show an overview for example of our local city. And that sort of thing so I direct them to the census and their developer portal and the documentation and the developer forum that they have is all so helpful. I've not seen anything coming back from them like I'm having trouble doing X or I'm trying to find this data set or anything like that once I direct them to the resource they're, they seem to be satisfied or they don't come back to me. But like I said but the documentation provided is generally really detailed and so that's really helpful for users to understand what exactly is in the API is. I'm not sure what happened to Linda. Julia. She did disappear. So we do have another question that came in. Asking are there any do you have any good resources for learning Jason or API for beginners. I would recommend the resources I pointed out. W3 schools.com fantastic it's all at your own pace it's all free. It's a great way for you to start. They give great examples and will training tutorials that you can play around with. So I would recommend going over there. Code Academy is the other one I would definitely recommend their very lightweight in terms of training so it helps you get on your feet much faster than like if you were to take a computer science class for example that would be really intense this is much more accessible for those who are just beginning or just wanting to touch up their skills or learn a new language. So I would definitely check out those resources. Okay, and we have a related question. Are there any good lip guides out there pointing to free government APIs. That's a really good question, and I honestly don't know the answer to it that I haven't done any searching for that, which is weird and not like me. Usually I always am looking for those resources. But I've not encountered them in the past. The APIs available were on data.gov you can easily go there and find them. But it's more recently that the agencies have been creating their own portals to access APIs. So that decentralizes things, which I have a bit of a love hate relationship with that it's great going to one spot and finding all the things produced by the government in one spot but it also makes sense, especially with these agencies that might create multiple APIs or have a lot of detailed documentation, or want tools all in one place, just specific to their own API. It makes sense that they would want it in their own portal. So that is a great idea for a lip guide if anyone wants to take that on. I just do it like a Google search or, you know, search in your favorite web browser for the agency and see if they have an API portal. So like census API, the first result I think is the Census Bureau's developer portal. Okay, do you have any more questions for us. Type them in the Q&A or in the chat. You've got you're getting some love Julia in the chat they don't know if you have. Thank you. Yes, I'm glad that this was a helpful overview of API. And I'm glad to see that I'm inspiring people to learn more about API but it makes me happy. And as information professionals. It's always good to have more things to learn about. And even if you don't have the technical capabilities for programming using APIs, at least you can point your, your researchers in the right direction if they want to build something, you know, accessing government information and another means that's not just a static website is always a great way to help promote government information in a different way. Thank you for a few more minutes and for any last minute questions and then I had an email from Linda saying she got kicked out so it looked like a few maybe a few others in people did I'm not sure what happened. A little technology. Seeing that there aren't any more questions burning in your minds. Thank you all for joining us today. And thank you Julia for your wonderful presentation I think everybody learned a lot. And this recording will be available. Probably next week. So it'll be posted in once the recordings available will send a message out to everybody with the link so thanks again for coming and we'll see you guys later at the next one. So the next, let's see. Sorry, when does enter I don't have the information about upcoming help webinars. But you can just check out the help page. It's March 18. Thanks everyone.