Library Website Tools
The UMD Libraries provides APIs to access information about physical spaces and hours.
Libtools REST API
The Libtools API provides access to information about Libraries’ spaces and hours. It is a RESTful API that returns JSON data.
Endpoint: https://api.www.lib.umd.edu/api/libtools/
Find the documentation here with examples: https://api.www.lib.umd.edu/api/libtools/docs
Example: website-libtools-hours.py
website-libtools-hours.py
#!/usr/bin/env python3
import urllib.request
import json
# Retrieve McKeldin hours from libtools search
BASE = 'https://api.www.lib.umd.edu/api/libtools/'
ENDPOINT = 'mckeldin/hours/today'
hours_url = BASE + ENDPOINT
# Get search results as parsed JSON
with urllib.request.urlopen(hours_url) as request:
response = json.loads(request.read())
status = response['status']
print('----')
print(f'McKeldin Hours: {status}')