BetaThis is a work-in-progress verion and not fully functional.
This API is intended to serve as a base for server-, desktop- and web-applications and offers functions to easily fetch, create and update items in the Internet Archive as well as access the full functionality of all APIs offered by archive.org, including the WaybackMachine. The code is partially based on the Internet Archive Python API client and contains all features of the python package, however no cli is included. For an out-of-the-box cli tool, please use the python package.
Strong types are used to enable a good developer experience. Return types are dependent on the input, for example when fields to return are supplied.
Example:
const result = await waybackMachine.getSnapshotMatches("https://twitter.com/internetarchive/", {
limit: 10
});
const digest = matches[0].digest; // OK
const result = await waybackMachine.getSnapshotMatches("https://twitter.com/internetarchive/", {
fl: ["urlkey", "mimetype", "statuscode", "timestamp"],
limit: 10
});
const digest = matches[0].digest;
// Property 'digest' does not exist on type '{ urlkey: string; timestamp: string; mimetype: string; statuscode: string; }'
The API docs are located here.
This API uses S3 API credentials for authentication. You can obtain them here
Example .ts files are located in src/examples
const item = await getItem('nasa');
console.log(`Identifier: ${item.identifier}`);
console.log(`Item size: ${item.item_size}`);
console.log(`Date: ${item.created}`);
npm run test:unit