Using the Old Bailey API

About the OB API demonstrator

A Javascript demonstrator version of the Old Bailey API is now available at

This webpage allows the server-side API to be queried and the results refined and passed to both Zotero and Voyuer.  It is currently running at its final public position, but has not been advertised on the wider Old Bailey site. Further functionality, including a ‘more like this’, and an integrated graphing facility are in the process of being implemented.  Developers might be interested in the technical details of the API.

Instructions for using the API Demonstrator

The API demonstrator allows a user to generate results in much the same way as the original site does – by searching on keyword, date range, crime, verdict, gender, etc. But with the Demonstrator, these result sets can then be explored – either through modifying the query (undrilling), or through breaking down the results by any of the available sub-categories of tagged data, and by all words in each trial.  Once the result set has been generated, it can then be bundled up and exported (either as full texts, or as a query string) to either Zotero or Voyuer.  In terms of search functionality, the most important difference between the API and the extant search facilities, is first, that it allows a search by ‘trial’ (and hence a collection of well-defined text objects), rather than by ‘offence’ or ‘defendant’, as is the case on the original site; and it allows you to explore the result sets, before exporting to Zotero (for weeding), or to Voyuer for further linguistic analysis.

For example, you can use the API to find all trials where the word ‘Commonwealth’ appears, or ‘foul disease’; or to select out inter-gender assaults for specific analysis; and to then explore these results by ‘undrilling’ the results, or breaking them down further.

Building a Query

Using the API Demonstrator interface, you can build a query very much as you would on the advanced search pages of the Old Bailey site itself; and have access to all the categories of tagged data associated with each trial through the pull down menus associated with the search boxes (see the About this Project/Markup for a list of the categories of information available, and also the search help texts available through the main Search Page).  You might, for instance, be interested in sexual crimes committed by men on women during the 1740s (please note the file names are in reverse data order – YearMonthDay, so 17451203; and field labels are in a shortened form – defgen = defendant gender, etc.).  The results of this particular query would look like this:

In total this query returns 37 trials (you can specify the upper limit for export at 10, 50, or 100 trials, but the site allows up to 1000 trials to be exported, by modifying the query URL).  Note that the user has clicked on trial t17410828-63 to get the text of the trial in the lower right hand corner of the screen.

These results can now be explored in detail either by choosing ‘undrill’ in relation to specific query components, or by using ‘break down’ to identify relevant sub-sets of relevant trials.  The choices available for ‘undrill’ in this instance include all the elements that composed the original query:

You can also break down the results by either trial text or any of the main categories of tagged data associated with all the trials in the search results.  Choosing to break down by ‘keywords’ generates an ordered list of all words in the results (excluding stop words), and allows you to further ‘drill’ the results to refine them; selecting perhaps only those trials where the word ‘father’ was present (13 trials in this example).

The ‘Break Down By’ box also gives you access to the following categories of data that replicate the choices available from the main query form:

Once you have satisfied yourself that the results you have generated reflect on the topic and issue you are researching, you can then export the results either to Zotero for ‘weeding’, or as part of a library of either texts or queries; or to Voyuer for more detailed linguistic analysis and visualisation.

You currently have three options:  to export your results as a ‘Query URL’, a ‘Zip Url’ or to bundle 10, 50 or 100 trials and ‘Send to Voyeur’.  As the labels suggest, selecting a ‘Query URL’ will return the current query string; the ‘Zip URL’ will return a Zip file that includes all the results currently being shown; and ‘Send to Voyeur’ will export the full text of all trial results (up to 10, 50 or 100 trials) to the Voyeur web tool.

To explore what you can do with these materials once they have been exported, see:

Using Old Bailey results in Zotero

Analysing Trial results in Voyeur

In the near future the Old Bailey API will be presented in style consistent with the rest of the site, and advertised through internal links.  A ‘more like this’ function and a graphing facility will also be made available.