The content on this wiki is being preserved for historical purposes, but is not being maintained and is probably no longer accurate.

For current information about DPLA Development, see the Development Portal

For latest API documentation, see the API documentation

Contributor API

From DPLA Dev Wiki
Jump to: navigation, search

Contents

Base URI for the Contributor type

http://api.dp.la/v0.03/contributor/

Basic Query

Basic queries to DPLA include the field you want to search against and your query term squashed together with a colon:

Parameter name Parameter description
filter The field and query


A basic query might look something like this:

http://api.dp.la/v0.03/contributor/?filter=dpla.keyword:juneau


Return Type

Currently, all data is returned as JSON.


Query Terms: Well-formedness

The rules for creating well-formed query terms differ according to whether the search type performs exact or keyword matching.

Keywords

  • Case insensitive
  • Truncation only at word boundaries allowed

Exact Searches

  • Case sensitive
  • Only full values accepted


Base Fields: Mapping to a set of common terms

Field name Field description
dpla.keyword Almost all of a record's fields get copied to this field
dpla.name The name of contributor
dpla.url The web address of the contributor
dpla.type The type of contributor (public library, university library)
dpla.dataset_id A unique identifier associated with the data load
dpla.location.address.street Contributor's street address
dpla.location.address.city Contributor's city
dpla.location.address.state Contributor's state
dpla.location.address.zip Contributor's postal code
dpla.location.geocoords.lat Geographic latitude of the contributor
dpla.location.geocoords.lon Geographic longitude of the contributor


A search for libraries in the state of AK might look something like this:

http://api.dp.la/v0.03/contributor/?filter=dpla.location.address.state:AK


Local Data: The original, supplied data

We map incoming data to the terms listed in the Base Fields section above but we realize that you might have cause to deal with the original data. We've done our best to index the data as it was given to us. You'll find it mixed in. If the term doesn't start with dpla., it's original data:

CITY_M: "ANCHOR POINT",
LATITUDE: "59.78",
F_VIDEO: "R_09",
F_DB_ST: "R_09",
YAPRO: "1",
dpla.location.geocoords.lon: "-151.85",
C_RELATN: "NO",
ZIP: "99556",
dpla.location.address.city: "ANCHOR POINT",
dpla.type: "public library",
POPU_UND: "1772",
F_OTHINC: "R_09",
LOANFM: "5",

Fields common to all DPLA records

A number of handy DPLA system related fields exist in every record in DPLA:

Parameter name Parameter description
dpla.id Each item in DPLA is given a unique identifier.
dpla.contributor The unique name of the partner that supplied the record. These field values usually take the form of the partner's domain name. e.g. example_edu, library_example_org
dpla.dataset_id Each record loaded into DPLA is loaded in a batch. This field is a unique identifier common to all records loaded in the batch.

Faceting and filtering

The API allows filtering and faceting on almost all fields:

Parameter name Parameter description
facet The field you want to facet on
facet_limit_fieldname The default facet return set size is 100. You can limit that on a per field basis by using this parameter. (Substitute fieldname for the name of your field)
filter You can narrow queries by using filters. Syntax looks like this: fieldname:filter (example: language:English)


A search for items containing the term juneau, faceting on contributor type, dpla.type might look like this:

http://api.dp.la/v0.03/contributor/?filter=dpla.keyword:juneau&facet=dpla.type


Let's add some more filters:

A search for items containing the term juneau, faceting on contributor type dpla.type, limiting ourselves to the records with the state, dpla.location.address.state or Alaska:

http://api.dp.la/v0.03/contributor/?filter=dpla.keyword:juneau&facet=dpla.type&filter=dpla.location.address.state:AK

Controls

Common API controls are available:

Parameter name Parameter description
limit Number of records to return
start The starting point in the result set


A search for items containing the term juneau, limiting the return number 2, starting at record 5:

http://api.dp.la/v0.03/contributor/?filter=dpla.keyword:juneau&limit=2&start=5
Personal tools