Skip to main content
U.S. flag

An official website of the United States government

Dot gov

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Https

Secure .gov websites use HTTPS
A lock ( ) or https:// means youโ€™ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Updated March 12th, 2022

Banner image with the following text: Join Our API Webinar Series. USGS. Easily Integrate Real-Time Water Data. SensorThings API on Monday, January 31st, 2022 at 12 pm ET/ 9 am PT. OGC API on Monday, February 28th, 2022 at 12 pm ET/ 9 am PT. What's Next? Monday, April 25th, 2022 at 12 pm ET/ 9 am PT. Water Data for the Nation. Making high-quality water information discoverable, accessible, and usable for everyone. On the right side of the image there is a computer programming screen with the text 'API.' Next to that, two gears working together continually turn, making this a gif.

On January 31st, we hosted the first webinar in our API series.. Join our next API webinar about OGC on 2/28/2022!

๐ŸŽฅ Webinar Recording

Watch the video below to view the recorded webinar or visit this link.

โ” What is the Application Programming Interface (API) Series?

๐Ÿ™Œ At the United States Geological Survey, we’re making high-quality water information discoverable, accessible, and usable for everyone.

Water data should be usable ๐Ÿฆพ! Our modernized APIs provide a way for you to display our water data in the format that works best for you. Learn more about how & why to use USGS modernized APIs to integrate our water data in your applications.

In this API webinar series, we’ll touch on what USGS water data is, then we’ll discuss the API formats that have been used in the past and why the new API formats are better for you.

Upcoming Webinars in API Series

Title Date Time
OGC-Features Monday, February 28th, 2022 12 pm ET / 9 am PT
OGC-Processes Monday, April 25th, 2022 12 pm ET / 9 am PT

โ” What is the OGC-Features Webinar?

In this webinar on our Open Geospatial Consortium (OGC) API, we’ll give you a brief background on APIs, then we’ll dive into a live demo of our OGC API-Features. Check out the features of OGC.

๐Ÿ•› When is the OGC-Features Webinar?

On Monday, February 28th, 2022 at 12 pm ET/ 9 am PT.

๐Ÿ‘ฉโ€๐Ÿ’ป Who is the OGC-Features Webinar For?

๐Ÿ“† How Can I Register/ Sign Up / Add to My Calendar?

Conveniently add this event to your calendar by visting the event on Eventbrite. You do not have to provide any personal information, and you do not have to register for the event on Eventbrite in order to attend (we’ve provided this option because many users requested a way to register for the event so they could get automatic reminders).

We will be providing a new way to register for events soon!

Join the Teams Live event at 12 pm ET/ 9 am PT on Monday, February 28th, 2022!

OGC API - Features Example

โœ Here is an example Leaflet webmap that is making a live call to the USGS Implementation of OGC API - Features, and below it is the minimal code needed to build your own map! We will talk in more detail about the structure of the USGS implementation of OGC API - Features during the seminar.

Here is the same code in a single html view that you can edit in any text editor.

<html>
    <head>
      <title>Stream gages with real time data in Wisconsin</title>
      <meta charset="utf-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin=""/>
      <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin=""></script>
        <style>
            html, body {
              height: 100%;
              margin: 0;
            }
            #map {
              width: 100%;
              height: 100%;
            }
        </style>
    </head>
    <body>
        <div id='map'></div>
        <script>
            var map = L.map("map").setView([45, -90], 6);
        
            L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
              attribution:
                'Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, '
            }).addTo(map);
        
            (async () => {
              const monitoringLocations = await fetch(
                "https://labs.waterdata.usgs.gov/api/observations/collections/RTS/items?stateFIPS=US%3A55&monitoringLocationType=Stream&active=true&f=json&limit=1000",
                {}
              ).then((response) => response.json());
              L.geoJSON(monitoringLocations, {
                pointToLayer: function (feature, latlng) {
                  return L.marker(latlng, {});
                },
                onEachFeature: onEachFeature
              }).addTo(map);
            })();
        
            function onEachFeature(feature, layer) {
              var popupContent =
                "<a href='" +
                feature.properties.monitoringLocationUrl +
                "' target='_blank'>" +
                feature.properties.monitoringLocationName +
                "</a>";
              if (feature.properties && feature.properties.popupContent) {
                popupContent += feature.properties.popupContent;
              }
              layer.bindPopup(popupContent);
            }
        </script>
    </body>
</html>

Resources

๐Ÿ“šResources mentioned during the webinar- more to come in this section after the webinar!