Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff

Similar presentations


Presentation on theme: "Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff"— Presentation transcript:

1 Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

2 THE API: ACCESS TO MILLIONS OF ITEMS, FOR ANY PURPOSE

3 What is an API? Application Programming Interface... a set of functions or routines that accomplish a specific task... a specification of how objects work in a given object-oriented language... an implementation of a protocol

4 APIs you may have used Have you ever: Accessed one library catalog from within another library catalog? Z39.50 Embedded a Google Books preview in a library catalog? Google Book Search Embedded Viewer API Geocoded addresses and place names for display on a map? GeoNames Search Webservice Google Maps API Geocoding Service

5 DPLA Apps http://dp.la/apps/

6 DPLA Search Widget https://github.com/lfarrell/DPLA-Search-Widget https://github.com/lfarrell/Wordpress-DPLA-Search- Widget-Plugin https://github.com/lfarrell/Wordpress-DPLA-Search- Widget-Plugin Generates a search query that is sent to the DPLA Portal (http://dp.la)http://dp.la

7 http://dp.la/search?q=Panda

8 Behind the magic curtain 1. User puts search term into HTML form 2. Form prepends DPLA search URL (http://dp.la/search?q=)http://dp.la/search?q= 3. Clicking “search” sends query to DPLA API using HTTP GET 4. DPLA Portal opens in same page For discussion for how to customize this widget, see http://www.dcplumer.com/2014/04/hacking-dpla-at-tcdl/ http://www.dcplumer.com/2014/04/hacking-dpla-at-tcdl/

9 DPLA API Search Widget https://github.com/dcplumer/dpla-search-tutorial/ Generates a search query that returns results on your own web page using the DPLA API.

10 Working example at http://www.dcplumer.com/ dpla-search/dpla-api-search.php http://www.dcplumer.com/ dpla-search/dpla-api-search.php http://api.dp.la/v2/items?q=pand a&api_key=http://api.dp.la/v2/items?q=pand a&api_key=$YOUR_KEY

11 Behind the magic curtain 1. User puts search term into PHP form 2. PHP prepends API search URL and appends API Key 3. Clicking “search” sends query to DPLA API using curl 4. Get results back from DPLA 5. Interpret results using a PHP function called json_decode 6. Display results For step-by-step discussion, see http://www.dcplumer.com/resources/handouts/dpla-api-tutorial-2/ http://www.dcplumer.com/resources/handouts/dpla-api-tutorial-2/

12 DPLA API Results Note: Shown in Mozilla Firefox with JSONView Extension api.dp.la/v2/items?q=panda&api_key=$YOUR _KEY (API query with API Key appended) api.dp.la/v2/items?q=panda&api_key=$YOUR _KEY (API query with API Key appended)

13

14

15

16 DPLA API Key See http://dp.la/info/developers/codex/policies/#get-a-keyhttp://dp.la/info/developers/codex/policies/#get-a-key Mac or Linux: Terminal (in Applications/Utilities) curl -v -XPOST http://api.dp.la/v2/api_key/YOUR_EMAIL@ex ample.com Windows: CuRL or something similarCuRL Browser plugins: Poster (Firefox) Poster Postman (Chrome) Postman

17 DPLA API Key – Terminal Method

18 DPLA API Key – Postman Method Install Postman from Chrome Web Store (free)Postman Enter Request URL: http://api.dp.la/v2/api_key/YOUR_EMAIL Select method POST Click Send

19 DPLA API Key – Postman Method

20

21 DPLA API Requests Allows Boolean operators AND and OR plus wildcards (*) Allows searching within fields (similar to refinements in DPLA Portal) By Format Contributor Partner By Date By Language By Location By Subject

22 DPLA API Request http://api.dp.la/v2/items?sourceResource.title=panda &sourceResource.type=image&api_key=$YOUR_KEY http://api.dp.la/v2/items?sourceResource.title=panda &sourceResource.type=image&api_key=$YOUR_KEY

23 Searching within Fields Any field in sourceResource: title collection stateLocatedIn type description Subject Provider (Partner) dataProvider (Contributing Institution) http://dp.la/info/developers/codex/requests/

24 Discovering Facet Options http://api.dp.la/v2/items?sourceResource.title=panda &facets=sourceResource.type,provider.name &api_key=$YOUR_KEY http://api.dp.la/v2/items?sourceResource.title=panda &facets=sourceResource.type,provider.name &api_key=$YOUR_KEY Facet: Type Facet: Provider Name

25 Designing a DPLA Advanced Search See http://europeana.eu/portal/widget/editor.html for ideas:http://europeana.eu/portal/widget/editor.html

26 DPLA Apps http://dp.la/apps/

27 Getting Code

28

29

30 API Key API Query

31 App Wishlist http://dp.la/info/developers/ideas-and-projects/

32 App Wishlist http://dp.la/info/developers/ideas-and-projects/current-ideas/

33 visit dp.la Contact info@dp.la @dpla


Download ppt "Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff"

Similar presentations


Ads by Google