Music Ngram Viewer API

The API is a simple way of accessing the ngram data when you don't want to download the whole data set.
The API provides access to the latest and most complete music ngram data, which might not be available for download otherwise.
We don't give any guarantees, but very responsive support is one click away.
Feel free to use the data and augment your mash-ups and algorithms with it!

Score Viewer API

For the Score Viewer API go to www.peachnote.com/viewer

REST API V0

N-gram counts

The ngram count endpoint is located at http://www.peachnote.com/rest/api/v0/ngramCounts
The response is wrapped in JSON.
The available parameters are
site The queried collection. Currently values "imslp.org", "loc.gov" and "duke.edu" are supported.
type The index type. Currently values "singleNoteAffine", "singleNoteAbsolute", "chordAffine", "chordAbsolute", "chordAffineTrackwise" and "chordAbsoluteTrackwise" are supported.
q The N-gram

An example URL is http://www.peachnote.com/rest/api/v0/ngramCounts?site=loc.gov&type=chordAffine&q=62+0+1+2+0+-2+-1

A response might look like {"62 0 1 2 0 -2 -1":{"1846":10.0,"1849":1.0,"1851":1.0}}

Score search by melody

The score search endpoint is located at http://www.peachnote.com/rest/api/v0/scoreSearch
The response is wrapped in JSON.
The available parameters are
site The queried collection. Currently values "imslp.org", "loc.gov" and "duke.edu" are supported.
type The index type. Currently values "singleNoteAffine", "singleNoteAbsolute", "chordAffine", "chordAbsolute", "chordAffineTrackwise" and "chordAbsoluteTrackwise" are supported.
q The N-gram
yearStart Only scores composed or published this year or later will be shown
yearEnd Only scores composed or published this year or earlier will be shown
filterText Text to filter search results by meta data
offset Pagination offset for search results
app_id An obligatory API app_id which can be obtained at api.peachnote.com
app_key An obligatory API key which can be obtained at api.peachnote.com

An example URL is http://www.peachnote.com/rest/api/v0/scoreSearch?site=loc.gov&type=chordAffine&q=62+0+1+2+0+-2+-1&app_id=abe33d61&app_key=e1181cc6f688fa721bc2cc225340be74

A response might look like
[{"composer":"Robinson, W. M.,Horn, Chas. E.,Robinson, W. M.","count":"1","id":"hdl:loc.music/sm1849.461820", "pagecount":"1","pages":"4","title":"How often hast thou told me, ballad","year":"1849"}, {"composer":"Beethoven, L. V.","count":"3","id":"hdl:loc.music/sm1846.410520", "pagecount":"3","pages":"2,14,19","title":"Ninth symphony","year":"1846"}, {"composer":"Drayton, Frank.","count":"1","id":"hdl:loc.music/sm1856.630320", "pagecount":"1","pages":"4","title":"Sweet flowers","year":"1856"}]

Score search by meta data

The score search endpoint is located at http://www.peachnote.com/rest/api/v0/scoreSearchMeta
The response is wrapped in JSON.
The available parameters are
q The query matched against composer name and score title.
Advanced search syntax is available.
Six fields may be used to guide the search: title, composer, year, instrumentation, language, key (see example query below).
offset Pagination offset for search results
limit Number of results returned per query
app_id An obligatory API app_id which can be obtained at api.peachnote.com
app_key An obligatory API key which can be obtained at api.peachnote.com

An example URL is http://www.peachnote.com/rest/api/v0/scoreSearchMeta?app_id=abe33d61&app_key=e1181cc6f688fa721bc2cc225340be74&limit=1&q=Bach instrumentation:chorus key:"B minor"

A response might look like
{"kind":"volumes#volumes","query":"Bach instrumentation:chorus key:\"B minor\"","totalItems":1,"items":[ {"scoreId":"IMSLP01257","authors":["Bach, Johann Sebastian"],"title":"Mass in B minor - 1. Kyrie","year":1724,"pageCount":44,"selfLink":"http://www.peachnote.com/rest/api/v0/score?id\u003dIMSLP01257","kind":"volumes#volume"} ]}

Score sheet info

The score sheet info endpoint is located at http://www.peachnote.com/rest/api/v0/score
The response is wrapped in JSON.
The available parameters are
id The id of the score. It can be obtained for example via the search API

An example URL is http://www.peachnote.com/rest/api/v0/score?id=IMSLP00010

A response might look like
{"kind":"volumes#pages","scoreId":"IMSLP01010","totalItems":4,"items":[ {"height":"2550","page":"1","url":"http://www.peachnote.com/rest/api/v0/image?sid\u003dIMSLP01010\u0026page\u003d1","width":"3300"}, {"height":"2550","page":"2","url":"http://www.peachnote.com/rest/api/v0/image?sid\u003dIMSLP01010\u0026page\u003d2","width":"3300"}, {"height":"2550","page":"3","url":"http://www.peachnote.com/rest/api/v0/image?sid\u003dIMSLP01010\u0026page\u003d3","width":"3300"}, {"height":"2550","page":"4","url":"http://www.peachnote.com/rest/api/v0/image?sid\u003dIMSLP01010\u0026page\u003d4","width":"3300"} ]}

Sheet images

The sheet image endpoint is located at http://www.peachnote.com/rest/api/v0/image
The response is a PNG image.
The available parameters are
sid The id of the score containing the sheet. Can be obtained using the score search API.
page The page number
w The width of the returned image. The sheet image is scaled on the server side accordingly.

An example URL is http://www.peachnote.com/rest/api/v0/image?sid=IMSLP26221&page=18&w=300

A response might look like

Have fun!