Javadoc available at: http://rci.rutgers.edu/~willkara/apidocs/
This is meant to be a simple Java wrapper for the Digital Public Library's API
https://github.com/dpla/platform
Before anything is done you must set your apikey.
SearchQuery sq = new SearchQuery("pizza",null);
sq.setAPIKEY("your api key goes here");
Every SearchQuery will return an array full of DplaItems. You can then gain access to each items information from there.
You can execute a search with:
- Just a Search Query
- Search Query & SearchOptions
- Just SearchOptions
If you only want one, then just pass null for the other.
SearchQuery sq = new SearchQuery("pizza",null);
sq.setAPIKEY("your api key goes here");
DplaItem[] result = sq.search();
for (DplaItem dp : result) {
System.out.println(dp.getSourceResource().getTitle());
}
SearchOptions so = new SearchOptions();
so.description="history";
SearchQuery sq = new SearchQuery("pizza",null);
sq.setAPIKEY("your api key goes here");
DplaItem[] result = sq.search();
for (DplaItem dp : result) {
System.out.println(dp.getSourceResource().getTitle());
}