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.69% (5.89%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.69% (5.89%*) • Investment IO: 5.74% (6.40%*) • Investment PI: 5.49% (6.27%*)

Sydney Photograph Collection (Pre 1885) API

Sydney Photograph Collection (Pre 1885) API

One of the databases the State Library of NSW makes available is a small collection of photographs taken in Sydney prior to 1885. We've integrated it into our social media and marking platform so the images might be sent to social by our clients. Powered by one our numerous APIs, the data can also be used with a simple WordPress plugin that renders the entire collection into your website as paginated results. It's one of the smallest datasets we make make available (our platform provides access to about 12 billion items of media).

The Result

API endpoint: http://api.beliefmedia.com/australia/sydney/sydney.json.

The API returns paginated results based on the parameters used. The API will accept apikey, pg, number, and type (browse or search).

A basic response will return JSON data that unfolds as follows:

1
<?php 
2
Array
3
(
4
    [code] => 200
5
    [status] => 200
6
    [message] => OK
7
    [source] => State Library of New South Wales, Album 412050 (Sydney Pre 1885)
8
    [page] => 1
9
    [number] => 20
10
    [pages] => 53
11
    [total] => 1054
12
    [results] => Array
13
        (
14
            [0] => Array
15
                (
16
                    [itemid] => 412069
17
                    [title] => Sydney - photographs of streets, public buildings, views in the Harbour, suburbs etc., chiefly pre 1885
18
                    [caption] => The City Bank [corner of King & George Streets, Sydney, ca. 1870s]
19
                    [creator] => NULL
20
                    [albumnumber] => 412050
21
                    [dateofwork] => [ca. 1870s]
22
                    [collectionitemlink] => http://acms.sl.nsw.gov.au/item/itemdetailpaged.aspx?itemid=412050
23
                    [digitalitemlink] => http://acms.sl.nsw.gov.au/item/itemdetailpaged.aspx?itemid=412069
24
                    [digitalordernumber] => a089002
25
                    [thumbnaillink] => http://acms.sl.nsw.gov.au/_DAMt/image/18/122/a089002t.jpg
26
                    [highreslink] => http://acms.sl.nsw.gov.au/_DAMx/image/18/122/a089002h.jpg
27
                )
28
 
29
            [1] => Array
30
                (
31
                    [itemid] => 412070
32
                    [title] => Sydney - photographs of streets, public buildings, views in the Harbour, suburbs etc., chiefly pre 1885
33
                    [caption] => Bank of Australasia, George Street, Sydney [ca. 1870s]
34
                    [creator] => NULL
35
                    [albumnumber] => 412050
36
                    [dateofwork] => [ca. 1870s]
37
                    [collectionitemlink] => http://acms.sl.nsw.gov.au/item/itemdetailpaged.aspx?itemid=412050
38
                    [digitalitemlink] => http://acms.sl.nsw.gov.au/item/itemdetailpaged.aspx?itemid=412070
39
                    [digitalordernumber] => a089003
40
                    [thumbnaillink] => http://acms.sl.nsw.gov.au/_DAMt/image/18/122/a089003t.jpg
41
                    [highreslink] => http://acms.sl.nsw.gov.au/_DAMx/image/18/122/a089003h.jpg
42
                )
43
 
44
                [ ... SNIP ... ]
45
 
46
            [19] => Array
47
                (
48
                    [itemid] => 412173
49
                    [title] => Sydney - photographs of streets, public buildings, views in the Harbour, suburbs etc., chiefly pre 1885
50
                    [caption] => St Andrew's Cathedral & Town Hall, [Sydney, after 1874]
51
                    [creator] => NULL
52
                    [albumnumber] => 412050
53
                    [dateofwork] => [after 1874]
54
                    [collectionitemlink] => http://acms.sl.nsw.gov.au/item/itemdetailpaged.aspx?itemid=412050
55
                    [digitalitemlink] => http://acms.sl.nsw.gov.au/item/itemdetailpaged.aspx?itemid=412173
56
                    [digitalordernumber] => a089060
57
                    [thumbnaillink] => http://acms.sl.nsw.gov.au/_DAMt/image/18/122/a089060t.jpg
58
                    [highreslink] => http://acms.sl.nsw.gov.au/_DAMx/image/18/122/a089060h.jpg
59
                )
60
 
61
        )
62
 
63
)

Searching the small archive by the limited caption text requires the parameter of type=search&search=search_term. Individual results are returned by passing only the itemid.

Sample PHP Function

A simple function that might be used to retrieve the data is as follows:

1
<?php 
2
/*
3
 Sydney Photograph Collection (Pre 1885) API
4
 https://www.beliefmedia.com.au/sydney-photograph-collection-1885
5
*/
6
 
7
function beliefmedia_slnsw_sydney_photos($page = '', $number = '', $search = false, $apikey = '123456') {
8
 
9
  if ($page == '') $page = '1';
10
  if ($number == '') $number = '20';
11
  $type = ($search !== false) ? 'search&search=' . $search : 'browse';
12
 
13
  $data = file_get_contents('http://api.beliefmedia.com/australia/sydney/sydney.json?apikey=' . $apikey . '&pg=' . $page . '&number=' . $number . '&type=' . $type);
14
  if ($data === false) return false;
15
 
16
  $data = json_decode($data, true);
17
  if ($data === false) return false;
18
 
19
  /* Likely return array of errors with code & message */
20
  if ($data['code'] != '200') return $data['message'];
21
 
22
 return (array) $data;
23
}

To play with the data, use the following:

1
echo '
2
<pre>' . print_r(beliefmedia_slnsw_sydney_photos(), true) . '</pre>
3
 
4
';

Considerations

  • If you're a current of former client and would like the WordPress plugin installed that will create a browsable archive of the images, please make contact with us.
  • While the API references images hosted on the SLNSW server, we have an archive of them all available for download (341MB). The file names are altered to itemid-thumb.jpg (thumbnail) and itemid-full.jpg (full size).
  • This data source is one of many that is available from within the client area for scheduling to social.

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