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.38% (6.14%*) • Home Loan Fixed: 5.44% (6.26%*) • Fixed: 5.44% (6.26%*) • Variable: 5.38% (6.14%*) • Investment IO: 5.69% (6.52%*) • Investment PI: 5.49% (5.98%*)

State Library of Queensland Photograph Collection (1914 – 1918) API

State Library of Queensland Photograph Collection (1914 – 1918) API

In our latest collection of images available via our API, we've created an archive of historical photographs and other digital material made available via the State Library of Queensland (SLQLD). The collection was generally collated from images created between 1914 and 1918 so, as you would expect, there's a large number of wartime references.

We've formatted the data as best we could (for now) and created a relational source of data that can easily be integrated into desktop and mobile applications.

The Result

The API endpoint for all requests is http://api.beliefmedia.com/australia/qld/slqld1418.json. A number of parameters determine how information is returned.

id

If returning details for a single image, the image itemid is required along with your API Key. If an ID is passed via the URL, all other parameters will be ignored.

type & search

The type can be browse, search, or tag. If no type is defined and no id is present in the URL (to return a single result), browse will be used. If the type is search or tag, a search term must be provided.

pg & number

The pg parameter determined the page to be returned. number determines how many results will be shown.

■ ■ ■

Our first example shows a request for a specific record. Using slqld1418.json?apikey=xxx&id=slqld1418_XoDl returns JSON that unfolds as follows:

1
Array
2
(
3
    [code] => 200
4
    [status] => 200
5
    [message] => OK
6
    [source] => State Library of Queensland
7
    [data] => Array
8
        (
9
            [itemid] => slqld1418_XoDl
10
            [title] => House donated to a war widow in the Toowoomba region, ca. 1917
11
            [creator] => Callaghan, C. W. (Charles Warwick), 1876-1947
12
            [publisher] => John Oxley Library, State Library of Queensland
13
            [contributor] => Queenslander (Brisbane, Qld. : 1866-1939)
14
            [date] => ca. 1917
15
            [temporal] => ca. 1917
16
            [description] => Array
17
                (
18
                    [0] => Looking after those who are left. On Saturday, this home, erected by public donations and gifts of labour and kind by the people of Toowoomba, was formally handed over by Mr. Bebbington, M.L.A., free of debt, to Mrs. Bentley, widow of Lance-Corporal G.W. Bentley, who was kiled in action in France, and left a wife and five children. The movement was organised by Mrs. F. Grundy and Mrs. J. E. Stone. The home is erected on land purchased by Corporal Bentley at Harlaxton before he volunteered. Mr. L.E. Groom, Assistant Minister for Defence, was present and spoke at the function. - C.W. Callagahn photo. (Description supplied with photograph)
19
                )
20
 
21
            
Image Error
 => Array
22
                (
23
                    [large] => http://resources.slq.qld.gov.au/images/slq/neg/2010-09-03/research/68874r.jpg
24
                    [medium] => http://resources.slq.qld.gov.au/images/slq/neg/2010-09-03/preview/68874p.jpg
25
                    [small] => http://resources.slq.qld.gov.au/images/slq/neg/2010-09-03/tnl/68874b.jpg
26
                    [local_thumbnail] => images/slqld1418/1917/XoDl-t.jpg
27
                    [local_image] => images/slqld1418/1917/XoDl.jpg
28
                )
29
 
30
            [reference] => Array
31
                (
32
                    [identifier] => Array
33
                        (
34
                            [negative_number] => 68874
35
                            [dtl_system_number] => 437839
36
                        )
37
 
38
                    [partof] => Array
39
                        (
40
                            [0] => Picture Queensland
41
                            [1] => State Library of Queensland : digital image collection
42
                        )
43
 
44
                    [partof_string] => picture queensland,state library of queensland : digital image collection
45
                    [original_image] => Array
46
                        (
47
                            [digital_format] => image/jpeg
48
                            [original_format] => copy print : b and w
49
                        )
50
 
51
                )
52
 
53
            [subject] => Array
54
                (
55
                    [subject_array] => Array
56
                        (
57
                            [0] => Array
58
                                (
59
                                    [0] => timber houses
60
                                    [1] => weatherboard houses
61
                                    [2] => war relief
62
                                    [3] => chimneys
63
                                    [4] => water tanks
64
                                    [5] => World War I
65
                                    [6] => Toowoomba
66
                                    [7] => Dwellings
67
                                )
68
 
69
                            [1] => Array
70
                                (
71
                                    [0] => Queensland
72
                                )
73
 
74
                            [2] => Array
75
                                (
76
                                    [0] => Toowoomba region
77
                                    [1] => World War, 1914-1918
78
                                )
79
 
80
                            [3] => Array
81
                                (
82
                                    [0] => Civilian relief
83
                                )
84
 
85
                            [4] => Array
86
                                (
87
                                    [0] => Toowoomba region
88
                                    [1] => Toowoomba region (Qld.)
89
                                )
90
 
91
                            [5] => Array
92
                                (
93
                                    [0] => Buildings, structures, etc.
94
                                )
95
 
96
                        )
97
 
98
                    [subject_string] => timberhouses,weatherboardhouses,warrelief,chimneys,watertanks,worldwari,toowoomba,dwellings,queensland,toowoombaregion,worldwar,1914-1918,civilianrelief,toowoombaregion,toowoombaregion(qld.),buildings,structures,etc.
99
                )
100
 
101
            [geo] => Array
102
                (
103
                    [location] => Harlaxton, Queensland
104
                    [latitude] => -27.541321
105
                    [longitude] => 151.953918
106
                )
107
 
108
            [rights] => Out of copyright. For further information http://www.slq.qld.gov.au/home/copyright Conditions of Use: You are free to use this image without permission. Please attribute State Library of Queensland.
109
        )
110
 
111
)

The description field returns an associative array since a large number of results include multiple titles and/or captions (as shown below).

1
Array
2
(
3
    [code] => 200
4
    [status] => 200
5
    [message] => OK
6
    [source] => State Library of Queensland
7
    [data] => Array
8
        (
9
            [itemid] => slqld1418_RloK
10
            [title] => Page 23 of the Queenslander Pictorial, supplement to The Queenslander, 8 April, 1916
11
            [creator] => Unidentified
12
            [publisher] => John Oxley Library, State Library of Queensland
13
            [contributor] => Queenslander (Brisbane, Qld. : 1866-1939)
14
            [date] => 8-Apr-16
15
            [temporal] => 8-Apr-16
16
            [description] => Array
17
                (
18
                    [0] => At head of page: SeventySeventh Expeditionary Force Number
19
                    [1] => Title: Field Artillery. Fegan, photo.
20
                    [2] => Caption: J.N. Adamson, H. Atkins, A. Beatty, C.K. Brothers, J.J. Burns, A.H. Butler, J.A. Cairns.
21
                    [3] => Caption: E.E. Childs, R.W. Clarke, O.G. Clarke, J. Coffey, C.E. Cowan, W.R. Cowley, R. Cunningham, A.E. Curtis.
22
                    [4] => Caption: J. Davidson, R. Davis, G. Dunn, M.F. Egan, C.E. Fensom, W. Fitzgerald, F.C. Fudge, S.J. Ganigan.
23
                    [5] => Caption: E.C. Gray, W. Hodgson, F.C. Hoomer, J. Hudson, W. Hunter, W.A. Inglis, S.G. McCullock, J. McGregor.
24
                    [6] => Caption: W.E. McKenzie, C.W. Missenden, W.R. Moore, L.H. Neilson, J.P. O'Connor, A.E. O'Keefe, C.W.H. Owen, J. Partridge.
25
                    [7] => Caption: C. Pepper, R.A. Ross, V.W. Ryan, W.E. Sellen, R.R. Selig, S.Silk, S.M. Skinner, G. Slater.
26
                    [8] => Caption: W.S. Solomon, W.L. Stack, J. Tanner, J.R. Todd, D.J. Tuckett, H. Westlake, H. Wood, R. Wyllie.
27
                )
28
 
29
[.. SNIP ..]

Since the collection of images was mashed up from various collections, the type and quantity of data will vary. For example, the geographic data is only returned for 6,141 results, and 1,710 results don't include a description.

Browsing & Searching Results

To browse or search a result, use the following: slqld1418.json?apikey=xxx&pg=1&number=10&type={tags|browse|search}&search=soldier. The search parameter need only be provided if searching text or tags (the unique tags of which is the imploded category/subject array).

1
Array
2
(
3
    [code] => 200
4
    [status] => 200
5
    [message] => OK
6
    [source] => State Library of Queensland
7
    [page] => 360
8
    [number] => 30
9
    [pages] => 537
10
    [total] => 16121
11
    [search] => Array
12
        (
13
            [type] => browse
14
        )
15
 
16
    [results] => Array
17
        (
18
            [0] => Array
19
                (
20
                    [itemid] => slqld1418_PjV4
21
                    [title] => Page 27 of the Queenslander Pictorial, supplement to The Queenslander, 6 February, 1915
22
                    [creator] => Unidentified
23
                    [date] => 6-Feb-15
24
                    [subject_string] => recruitingandenlistment,militaryuniforms,posters,cheesefactories,pelicans,airships,battleships,organs,churches,chancels,dundarrahco-opcheeseco.(coulstonlakes,qld.),citytabernaclebaptistchurch(brisbane,qld.),worldwar,1914-1918,posters,cheesefactories,queensland,coalstounlakes,militaryairships,battleships,organ(musicalinstrument),brisbane,churchfurniture,brisbane,greatbritain,armedforces,recruiting,enlistment,etc.,worldwar,1914-1918,posters
25
                    [description] => Array
26
                        (
27
                            [0] => Caption: A British recruiting poster. Posters are issued in the British Islands by various organisations formed to stimulate recruiting. This is a facsimile of a poster displayed on behalf of the Parliamentary Recruiting Committee.
28
                            [1] => Caption: The New Dundarrah cheese factory, Coalstoun Lakes, recently opened. Ada C. Bott photo.
29
                            [2] => Caption: Aeroplanes or birds? On many occasions since the outbreak of war persons in various parts of Queensland have declared that they saw aeroplanes and airships manoeuvring in the evening sky. It is significant that these appearances" have occurred in nearly every instance about dusk or soon after. This picture of a flight of pelicans (reproduced from "L'Illustration") suggests the possibility of a belated bird being mistaken for an aeroplane.
30
                            [3] => Caption: The magnitude of the Zeppelin. The great size of a German airship is shown by this illustration (from the "Scientific American") of a Zeppelin side by side with a battleship. It is conceivable that such a huge structure would form a comparatively easy mark for expert gunners.; and an aeroplane could scarcely be mistaken for a Zeppelin by any one who had seen both forms of aircraft.
31
                            [4] => Caption: The new "Carnegie"organ at the City Tabernacle dedicated last Sunday. The City Tabernacle the leading baptist church in Brisbane has just opened a fine new organ, installed at a cost of 1200 pounds, of which 500 was granted by the Carnegie Trust. The instrument is blown by a rotary blower driven by an electric motor. The scaling of the pipes was specially adapted to the requirements of the building. The pitch is French d apason normal. This is the only organ in Queensland tuned to that pitch which is the same as that used by Madame Melba. King Arnold photo.
32
                        )
33
 
34
                    
Image Error
 => Array
35
                        (
36
                            [large] => http://resources.slq.qld.gov.au/images/slq/pub/2014-08-02/research/702692-19150206/702692-19150206-s0027r.jpg
37
                            [medium] => http://resources.slq.qld.gov.au/images/slq/pub/2014-08-02/preview/702692-19150206/702692-19150206-s0027p.jpg
38
                            [small] => http://resources.slq.qld.gov.au/images/slq/pub/2014-08-02/tnl/702692-19150206/702692-19150206-s0027b.jpg
39
                            [local_thumbnail] => images/slqld1418/1915/PjV4-t.jpg
40
                            [local_image] => images/slqld1418/1915/PjV4.jpg
41
                        )
42
 
43
                )
44
 
45
            [1] => Array
46
                (
47
                    [itemid] => slqld1418_Qk89
48
                    [title] => Page 27 of the Queenslander Pictorial, supplement to The Queenslander, 6 January, 1917
49
                    [creator] => Unidentified
50
                    [date] => 6-Jan-17
51
                    [subject_string] => biplanes,warworkers,women,wings(aeronauticalinsignia),harvesting,horseracing,racecourses,winningposts,worldwar,1914-1918,campaigns,belguim,worldwar,1914-1918,aerialoperations,german,horseracing,queensland,brisbane,ascot(brisbane,qld.),france
52
                    [description] => Array
53
                        (
54
                            [0] => Caption: Caught in the Air. A German aviatik" photographed in the midair on the Yser Front by a Belgian aviator. The picture shows very plainly the iron cross which is the distinguishing mark of all German aeroplanes. The Belgian pilot showed great coolness in thus "snapshotting "his enemy at close rangenot more than 50 yards. From an official Belgian photograph.
55
                            [1] => Caption: France.The Harvest of 1916. The peasant woman, old and towed, represents the spirit of France just as truly as the soldier who is fighting in the trenches.New York "Independent."
56
                            [2] => Caption: Caught on the Post. A fine photograph of a finish (Stanley Plate) on the Ascot Racecourse during a recent meeting. King Arnold photo.
57
                        )
58
 
59
                    
Image Error
 => Array
60
                        (
61
                            [large] => http://resources.slq.qld.gov.au/images/slq/pub/2014-11-09/research/702692-19170106/702692-19170106-s0027r.jpg
62
                            [medium] => http://resources.slq.qld.gov.au/images/slq/pub/2014-11-09/preview/702692-19170106/702692-19170106-s0027p.jpg
63
                            [small] => http://resources.slq.qld.gov.au/images/slq/pub/2014-11-09/tnl/702692-19170106/702692-19170106-s0027b.jpg
64
                            [local_thumbnail] => images/slqld1418/1917/Qk89-t.jpg
65
                            [local_image] => images/slqld1418/1917/Qk89.jpg
66
                        )
67
 
68
                )
69
 
70
                [.. SNIP ..]
71
 
72
        )
73
 
74
)

Images

Of the 16,368 rows in the initial (dated) data, a number of image references were empty or returned 404 (not found) errors. After removing invalid rows we were left with 15,886 rows.

The entire image collection may be downloaded from our client area (2.8GB). The image path (honored in the download) is as follows: {year}/{itemid}.jpg (1000px image) and {year}/{itemid}-t.jpg (150px thumbnail). When a year was unable to be resolved we simply use 1234. The images hosted by the SLQLD are 1000px (large), 500px (medium), and 150px (small).

Example PHP Functions

The following very basic PHP functions aren't unlike the others we've provided that serve a similar purpose.

Return Photograph Details

1
<?php 
2
/*
3
 State Library of Queensland Photograph Collection (1914 - 1918) API
4
 https://www.beliefmedia.com.au/slqld-photographs-api
5
*/
6
 
7
function beliefmedia_slqld1418_photos_detail($id, $apikey = 'xxxxx') {
8
 
9
  $data = @file_get_contents('http://api.beliefmedia.com/australia/qld/slqld1418.json?apikey=' . $apikey . '&id=' . $id);
10
  if ($data === false) return false;
11
 
12
  $data = json_decode($data, true);
13
  if ($data === false) return false;
14
 
15
  /* Likely return array of errors with code & message */
16
  if ($data['code'] != '200') return $data['message'];
17
 
18
 /* Do something with data */
19
 return (array) $data;
20
}

Search Photograph Collection

1
<?php 
2
/*
3
 State Library of Queensland Photograph Collection (1914 - 1918) API
4
 https://www.beliefmedia.com.au/slqld-photographs-api
5
*/
6
 
7
function beliefmedia_slqld1418_photos($page = '', $number = '', $type = false, $search = false, $apikey = 'xxxxx') {
8
 
9
  if ($page == '') $page = '1';
10
  if ($number == '') $number = '20';
11
  if ($type === false) $type = 'browse';
12
 
13
  $type = ($type == 'browse') ? 'browse' : 'type=' . $type . '&search=' . str_replace(' ', '+', $search);
14
 
15
  $data = @file_get_contents('http://api.beliefmedia.com/australia/qld/slqld1418.json?apikey=' . $apikey . '&pg=' . $page . '&number=' . $number . '&' . $type);
16
  if ($data === false) return false;
17
 
18
  $data = json_decode($data, true);
19
  if ($data === false) return false;
20
 
21
  /* Likely return array of errors with code & message */
22
  if ($data['code'] != '200') return $data['message'];
23
 
24
 return (array) $data;
25
}

Considerations

The source data itself (as opposed to the content) was a little crappy. A note of the SLQLD download page reads "when working with this dataset (CSV) in EXCEL you may find some irregularities with some of the data fields." Instead, they recommend use of an alternate text file that contains malformed (but easily parsed) XML data. However, there were numerous inconsistencies between both sources meaning we ended up dealing with the former. Because of our manual corrections, there may be slight errors in a very small number of results (maybe less than 15).

If you're one of our new Queensland clients (we've just opened up an office on the Gold Coast), talk to your relationship manager about how this data might be used in your social strategy.

Ensure you cache data locally so you don't make repeated and unnecessary requests.

■ ■ ■

 
Download our complimentary 650-page guide on marketing for mortgage brokers. We'll show you exactly how we generate billions in volume for our clients.
Finance Guide, Cropped Top and Bottom
  Timezone: 1 · [ CHANGE ]

RELATED READING

Like this article?

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

Leave a comment