InternetArchiveKit is a Swift library to interact with the Internet Archive API
It was built to power Live Music Archive, an app I developed for listening to the Internet Archive's collection of live music.
The Internet Archive's structure is made up of Items
and Files
. Items
are the top level "things", like audio, video, and books, that contain all of the metadata for the "thing". Items
contain Files
, which are the actual content of the Item
. For instance, in a live music recording, the Item
is a particular recording of a show with metadata about the show like artist, venue, taper, etc. The Files
are the individual audio tracks from that show.
For more information about the Internet Archive's structure, see their Python Library Documentation.
See the documenation for a full API reference
import InternetArchiveKit
let query = InternetArchive.Query(
clauses: ["collection": "etree", "mediatype": "collection"])
let archive = InternetArchive()
let results = await archive.search(query: query, page: 0, rows: 10)
switch results {
case .success(let items):
// debugPrint(items)
case .failure(let error):
// debugPrint(error)
}
let result = await archive.itemDetail(identifier: "sci2007-07-28.Schoeps")
switch result {
case .success(let item):
// debugPrint(item)
case .failure(let error):
// debugPrint(error)
}
For more advanced usage, see the test suite and the included sample app.
Currently, InternetArchiveKit is read-only and does not have support for all of Internet Archive's data. Pull requests are welcome!