RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.78% (6.81%*) • Investment PI: 5.49% (6.32%*)

National Library of Australia Sheet Music API

National Library of Australia Sheet Music API

We have hundreds of APIs working overtime to drive a number of our websites. Others provide sources of data for our Social Marketing Platform. While most of the services were designed with our users in mind, this is one API that we built because we wanted the information ourselves. The National Library of Australia Sheet Music collection, available freely from the NLA , includes printed music created by Australians, published in, performed in, or otherwise associated with, Australia. The dataset contains over 11,000 items - including the original scores of Waltzing Matilda and Advance Australia Fair.

The data is made available by the NLA as a mess of XML files that we've ported over to a database and made accessible via a JSON API. We've made the collection searchable by a number of parameters in a number of ways. This article describes basic usage of the API for those of our clients that hold an API key.

Browsing Results

To browse all results, use http://api.beliefmedia.com/nla/music/music.json?apikey=xxxxx. While the type of search (type=browse) should normally be defined, this isn't necessary for browsing all results. All results are paginated to a maximum of 30 results.

1
Array
2
(
3
    [code] => 200
4
    [status] => 200
5
    [message] => OK
6
    [source] => National Archives of Australia
7
    [page] => 1
8
    [number] => 30
9
    [pages] => 406
10
    [total] => 12183
11
    [results] => Array
12
        (
13
            [0] => Array
14
                (
15
                    [nlid] => nla.mus-an10000708
16
                    [title] => Les barricades mysterieuses [music]
17
                    [creator] => Couperin, Francois, 1668-1733
18
                    [published] => Melbourne : Allan & Co., [190-]
19
                    [thedate] => 1901-01-01 - 1910-12-31
20
                    [description] => A. & Co. 993 (Publisher number). Pl. no.: A. & Co. 993.
21
                )
22
 
23
            [1] => Array
24
                (
25
                    [nlid] => nla.mus-an10000902
26
                    [title] => Let me hold your hand till the tram goes by [music] : catchy chorus song
27
                    [creator] => Vaude, Charles
28
                    [published] => Melbourne : Dinsdale's, [191-?]
29
                    [thedate] => 1900-01-01 - 1919-12-31
30
                    [description] =>
31
                )
32
 
33
            [2] => Array
34
                (
35
                    [nlid] => nla.mus-an10000939
36
                    [title] => If I were a lark [music] : song
37
                    [creator] => Clutsam, G. H. (George H.), 1866-1951
38
                    [published] => London : Edwin Ashdown ; Sydney : D. Davis, c1901.
39
                    [thedate] => 1901-01-01
40
                    [description] => E.A. 33582 (Publisher number). "in E-flat" -- cover.; For medium voice and piano.; Pl. no.: E.A. 33582.
41
                )
42
 
43
            [SNIP]
44
 
45
            [29] => Array
46
                (
47
                    [nlid] => nla.mus-an10041000
48
                    [title] => The Australian bird waltz [music]
49
                    [creator] => Ellard, Frederick, 1824-1874
50
                    [published] => Sydney : Woolcott & Clarke, [185-?]
51
                    [thedate] => 1850-01-01 - 1859-12-31
52
                    [description] =>
53
                )
54
 
55
        )
56
 
57
)

Music Details

The nlid key is the ID used to return full details for a particular result. For example, http://api.beliefmedia.com/nla/music/music.json?type=details&id=nla.mus-an7412026&apikey=xxxxx returns JSON data that unfolds into the following (original Waltzing Matilda Score).

1
Array
2
(
3
    [code] => 200
4
    [status] => 200
5
    [message] => OK
6
    [source] => National Archives of Australia
7
    [data] => Array
8
        (
9
            [details] => Array
10
                (
11
                    [nlid] => nla.mus-an7412026
12
                    [title] => Waltzing Matilda [music] : song
13
                    [creator] => Cowan, Marie, d.1919
14
                    [published] => [Sydney?] : Printed and published for the proprietors, [1905?] (Sydney : Turner& Henderson)
15
                    [format] => 1 score ([2] p.) ; 36 cm.
16
                    [thedate] => 1905-01-01
17
                    [description] => For voice and piano.; At head of title page_ Sung with immense success!!!! The popular song.; Lithography by Turner & Henderson.; Believed to have been issued as promotional material for James Inglis & Co. Ltd, Sydney, whose advertisement for Billy tea appears on the back cover.
18
                    [type] => Image
19
                    [source] => Item held by National Library of Australia
20
                    [rights] => You may save or print this image for research and study. If you wish to use it for any other purposes, you must contact the National Library of Australia to request permission.
21
                )
22
 
23
            [contributors] => Array
24
                (
25
                    [0] => Paterson, A. B. (Andrew Barton), 1864-1941
26
                    [1] => Cowan, Marie, d.1919
27
                )
28
 
29
            [relations] =>
30
            [subject] => Array
31
                (
32
                    [0] => Paterson, A. B. (Andrew Barton), 1864-1941. -- Musical settings
33
                    [1] => National songs -- Australia
34
                    [2] => Australian
35
                    [3] => 783.24215990994 (DDC)
36
                )
37
 
38
            [pages] => Array
39
                (
40
                    [0] => Array
41
                        (
42
                            [subunit] => Front Cover
43
                            [subunit_no] =>
44
                            [thumbnail] => http://nla.gov.au/nla.mus-an7412026-s1-t
45
                            
Image Error
 => http://nla.gov.au/nla.mus-an7412026-s1-v
46
                        )
47
 
48
                    [1] => Array
49
                        (
50
                            [subunit] => Unnumbered Page [1]
51
                            [subunit_no] =>
52
                            [thumbnail] => http://nla.gov.au/nla.mus-an7412026-s2-t
53
                            
Image Error
 => http://nla.gov.au/nla.mus-an7412026-s2-v
54
                        )
55
 
56
                    [2] => Array
57
                        (
58
                            [subunit] => Unnumbered Page [2]
59
                            [subunit_no] =>
60
                            [thumbnail] => http://nla.gov.au/nla.mus-an7412026-s3-t
61
                            
Image Error
 => http://nla.gov.au/nla.mus-an7412026-s3-v
62
                        )
63
 
64
                    [3] => Array
65
                        (
66
                            [subunit] => Back Cover
67
                            [subunit_no] =>
68
                            [thumbnail] => http://nla.gov.au/nla.mus-an7412026-s4-t
69
                            
Image Error
 => http://nla.gov.au/nla.mus-an7412026-s4-v
70
                        )
71
 
72
                )
73
 
74
            [nla] => Array
75
                (
76
                    [0] => nla.mus-an7412026
77
                    [1] => http://nla.gov.au/nla.mus-an7412026
78
                )
79
 
80
        )
81
 
82
)

While each of the thumbnail and image links reference the NLA source, we do archive all the images ourselves, and they're all available via a similar local URL (with .jpg extension). They may all be downloaded from within our client area, although NLA's licencing should be understood before using them.

Searching Data

The API supports searching by title, description, subject, and author. To search via freetext, the following should be used:

http://api.beliefmedia.com/nla/music/music.json?type=search&title=waltzing

To search via author (exact match), use the following:

http://api.beliefmedia.com/nla/music/music.json?type=author&creator=ab,+ef

There are numerous other search types available but it's beyond the scope of this article. All data searched via author or text are paginated in the same manner as the first example (for browsing).

Considerations

  • We've played with sheet music OCR to port the data into a computer-readable format so it might be played with MIDI (without success). If you've got experience in this area we'd love to hear from you.
  • The NLA data isn't structured very well, and we've done our best to clean it up while preserving all field data without alteration.
  • Some WordPress shortcodes are to follow. One will take the NLID and construct a container with the music details and a responsive gallery of all pages of music.
  • We will be sharing basic API documentation for a number of our APIs over coming weeks. Subscribe to our mailing list or follow us on Facebook for updates.

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

RELATED READING

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment