Skip to content

natliblux/archiveit-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a Java client for Archive-It's API. It enables you to query seeds, collections, WARC file metadata and account settings. You can either use it with your own Archive-It credentials to gain access to your data, or without credentials to query public data.

Usage

This is a Maven project, so you simply use it as a dependency in your project.

The main starting point is the ArchiveitClient class:

ArchiveitClient client = new ArchiveitClient("myUsername", "myPassword");

Note that you do not need to provide credentials if you are only getting publicly available information from the API. In this case, just instantiate the client without a username and password:

ArchiveitClient client = new ArchiveitClient();

Features

The API functionalities of the client are divided into ''services''. Each service is responsible for a specific part of the API:

  • CollectionService
  • SeedService
  • AuthenticationService
  • AccountService
  • WarcService

Here is an example of getting the collection with ID 123 using the CollectionService:

ArchiveitClient client = new ArchiveitClient("myUsername", "myPassword");
Collection collection = client.getCollectionService().getCollectionById(123);
System.out.println(collection.toString());

Examples

Here we will give a few illustrative examples and use cases.

Get all seeds within a collection

Assuming you know the ID if your collection, you can run:

ArchiveitClient client = new ArchiveitClient("myUsername", "myPassword");
List<Seed> seeds = client.getSeedService().getSeedsByCollectionId(collectionId);
for (Seed seed : seeds)
{
	System.out.println(seed.toString());
}
System.out.println("Total: " + seeds.size()); 

Get detailed information about a seed

Assuming you know the ID of your seed, you can run:

ArchiveitClient client = new ArchiveitClient("myUsername", "myPassword");
Seed seed = client.getSeedService().getSeedById(seedId);
System.out.println(seed.toString());

Get all collections within an Archive-IT account

Assuming you now the ID of your account, you can run:

ArchiveitClient client = new ArchiveitClient("myUsername", "myPassword");
List<Collection> collections = client.getCollectionService().getCollectionsByAccountId(accountId);
for (Collection collection : collections)
{
	System.out.println(collection.toString());
}
System.out.println("Total: " + collections.size());

Runnable example code

You can find executable code examples under src/test/java, in the AppTest class.

License

License: GPL v3

See COPYING to see full text.

About

A Java client for Archive-It's API services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages