DPLA Suggest

DPLA Suggest is a jQuery plugin that adds Digital Public Library of America search autocomplete to search boxes on your site. Start typing text and the widget suggests relevant matches from the millions of records in DPLA. (In the future you will be able search subset of types.) Topic flyouts help the user select the correct item. It uses DPLA's Platform API to return items.

Add to your site

<link href="suggest.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script src="suggest.js"></script>
<script>
    $(function() {
      $("#try").suggest({
        api_key: "your DPLA key"
      })
      .bind("fb-select", function(e, data) {
         window.open("http://dp.la/item/" + data.id, '_blank');
         //To use same window, do window.open("http://dp.la/item/" + data.id, '_blank');
      });
    });
</script>

<input type="text" id="try">
      

Options (more coming soon)

api_key String Default: None
This is the API Key for your DPLA requests. To get one, please visit: http://dp.la/info/developers/codex/policies/#get-a-key
page_size String Default: 25
The number of records to attempt to return in the search result.
dataProvider String Default: null
Limit results to a specific institution. For example, $("#mySearchBox").suggest({ api_key: "your DPLA key", dataProvider: "University of California" })