Skip to content
A java wrapper for the Digital Public Library's API.
Branch: master
Clone or download
Latest commit 0d54540 Apr 24, 2013
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main/java/willkara/dplajavawrapper HouseKeeping Apr 24, 2013
.gitignore Initial Commit Apr 24, 2013
CHANGE-LOG.txt Initial Commit Apr 24, 2013
MIT-License.txt Changed license file Apr 24, 2013
README.md Fixed the README Apr 24, 2013
pom.xml Initial Commit Apr 24, 2013

README.md

Java Wrapper for the Digital Public Library's API

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

http://dp.la

https://github.com/dpla/platform

Examples


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.

Execute a simple search query WITHOUT any SearchOptions.

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());
    }

Execute a search query with some SearchOptions

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());
    }
You can’t perform that action at this time.