Home API South Australian First World War Photograph Collection API

South Australian First World War Photograph Collection API

0

The database of photographs made available in this article are an extract from a First War collection provided by the State Library of South Australia . Content includes portraits of soldiers, marches, camps, group shots, on location in the Dardanelles, and Western front, and activities on the home front. The relatively small collection of about 2100 images are available via an API, and this article describes its basic use.

A few have asked me (including my mother) why we’re making these collections available… and the answer is simple. While all databases will have an accompanying WordPress plugin to make the images available on a website, once all the relevant material is rationalized we’ll import them into a common data source so all images can be scheduled to social in batches. The databases simply provides a means to share engaging and compelling content. Once the project nears completion we’ll create a few standalone accounts to demonstrate the reach, appeal, and effectiveness that historical media provides. Every single thing we do is because it adds value to the marketing and social efforts of our clients.

The Result

The endpoint for all requests is as follows: https://api.beliefmedia.com/australia/sa/firstwar.json. Additional parameters are passed in the GET request to return relevant data.

To return results for a specific image ID (as obtained via a search or browse request) use firstwar.json?id=b20182235&apikey=xxxx. The returned JSON data unfolds as follows:

The category array returns each hierarchical menu reference as used by the State Library of South Australia. Those category string contains those same unique values to be used for internal searching and cataloging. The image array returns both the SLSA image download link and a reference to the file as made available in a downloadable zip file containing all images. The relevant reference on the SLSA website can be constructed from the record ID.

Browsing and Searching

Browsing refers to scrolling through paginated results while searching will only return rows that match a specific search term. To browse, use the following: firstwar.json?apikey=xxxx&pg=1&number=20. To search rows, you must explicitly instruct a search with type=search and add a search term; for example: firstwar.json?apikey=xxxx&type=search&search=hospital&number=30.

Both the search and browse JSON returns similar data. They both decode as follows (the following result was a search for “hospital”):

Sample PHP Functions

The following are the most basic of functions necessary to retrieve data. An API Key is provided to all clients and is available to others upon request.

Individual Result Data

Browsing & Searching

Considerations

  • Like all our recent API features, it’s new. If you encounter errors, please let us know.
  • The image collection (552MB) may be downloaded form our client area. The image path is returned in our JSON data and generally follows the following format: firstwar/{year}/{itemid}.jpg.

Shortt URL for this post: http://shor.tt/Ik4

LEAVE A REPLY

Please enter your comment!
Please enter your name here