Archive-It
Archive-It is the leading web archiving service for collecting and accessing cultural heritage on the web. UMD routinely archives a variety of web content to enhance our unique collections.
OpenSearch
API Description: OpenSearch, Archive-It Documentation
JSON Endpoint: https://archive-it.org/search-master/opensearch
Example: archive-it-search.py
archive-it-search.py
#!/usr/bin/env python3
import urllib.request
from xml.etree import ElementTree
# Search Archive-It using XML OpenSearch
ENDPOINT = 'https://archive-it.org/search-master/opensearch'
# Visit the UMD Organization at https://archive-it.org/organizations/408
# Select one of the collections, e.g., Special Collections at
# https://archive-it.org/collections/2269. The Collection ID is 2269.
# Keyword query on 'Maryland'
params = {
"search_field": "all_fields",
"q": "maryland",
"i": "2269", # Collection ID
}
search_url = ENDPOINT + '?' + urllib.parse.urlencode(params)
# Get search results as parsed XML
with urllib.request.urlopen(search_url) as request:
result = ElementTree.parse(request).getroot()
# Iterate over the returned items
for element in result.findall('channel/item'):
# Extract Item information
title = element.find('title').text
link = element.find('link').text
date = element.find('date').text
print('----')
print(f'Title: {title}')
print(f'Date: {date}')
print(f'Link: {link}')