Recreation Information Database

Recreation Information Database

Open Data

Recreational areas, federal lands, historic sites, museums, and other attractions/resourceS ACROSS USA. RIDB is a part of the Recreation One Stop (Rec1Stop) project, initiated as a result of a government modernization study conducted in 2004.

Visit API

📚 Documentation & Examples

Everything you need to integrate with Recreation Information Database

🚀 Quick Start Examples

Recreation Information Database Javascript Examplejavascript
// Recreation Information Database API Example
const response = await fetch('https://ridb.recreation.gov/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Exploring the Recreation Information Database (RIDB) API

The Recreation Information Database (RIDB) API is a public API that provides information on recreational facilities and activities in public lands across the United States. This API is an excellent resource for developers who want to build innovative applications that help people find and explore public lands. In this blog post, we will be exploring the RIDB API and provide example code snippets in JavaScript.

Getting Started

Before we dive into the specifics of the RIDB API, we need to obtain an API key that we will use to authenticate our requests. To get an API key, you will need to create an account on recreation.gov and then request an API key from the RIDB.

Once you have obtained your API key, you can start exploring the RIDB Endpoints. Let's begin by looking at the search function, which allows us to search for facilities in the database.

fetch('https://ridb.recreation.gov/api/v1/facilities', {
    method: 'GET',
    headers: {
        'accept': 'application/json',
        'apikey': 'YOUR_API_KEY'
    },
    qs: {
        state: 'CO',
        activity: 'Hiking'
    }
}).then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

In this code snippet, we are using the fetch function to make a GET request to the facilities endpoint of the RIDB API. We are passing our API key in the headers and setting the query parameters to search for hiking facilities in Colorado.

The response from the API will return a JSON object that contains an array of matching facilities. You can parse through this data to display information about the facilities on your application.

Additional Endpoints

In addition to the facilities endpoint, the RIDB API provides several other endpoints that you can use to obtain information on campsites, tours, and permits. Here are some example code snippets for each of these endpoints:

Campgrounds

fetch('https://ridb.recreation.gov/api/v1/campgrounds', {
    method: 'GET',
    headers: {
        'accept': 'application/json',
        'apikey': 'YOUR_API_KEY'
    },
    qs: {
        state: 'CA',
        maxPeople: 6
    }
}).then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

Tours

fetch('https://ridb.recreation.gov/api/v1/tours', {
    method: 'GET',
    headers: {
        'accept': 'application/json',
        'apikey': 'YOUR_API_KEY'
    },
    qs: {
        state: 'NY',
        keywords: 'scenic'
    }
}).then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

Permits

fetch('https://ridb.recreation.gov/api/v1/permits', {
    method: 'GET',
    headers: {
        'accept': 'application/json',
        'apikey': 'YOUR_API_KEY'
    },
    qs: {
        latitude: '41.8781',
        longitude: '-87.6298'
    }
}).then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

Conclusion

The Recreation Information Database (RIDB) API provides an excellent resource for developers to build innovative applications around recreational facilities and activities in public lands across the United States. In this blog post, we explored the RIDB API and provided example code in JavaScript for the search, campgrounds, tours, and permits endpoints.

With the RIDB API, developers can build apps that help people plan and explore the great outdoors. Let your imagination run wild and see what kind of applications you can build with the RIDB API!

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Aug 1Aug 3Aug 5Aug 7Aug 9Aug 11Aug 13Aug 15Aug 17Aug 19Aug 21Aug 23Aug 25Aug 27Aug 3004008001440Minutes
Online
Offline

Related APIs in Open Data