Wiki
Clone wikidocumentation / API
HuNI API
About
Access to data via the HuNI API is under the same terms as via the HuNI Lab frontend application. Please refer the HuNI Lab data policy.
HuNI harvests a summary of selected records from a range of partner sites and indexes them via Apache Solr. The resulting amalgameted and indexed data set is referred to as 'the HuNI aggregate'. The source agency codes and counts of records can be seen on the HuNI data status page.
Access the HuNI Solr search service at https://huni.huni.net.au/solr/select.
Here are some resources to get started with Solr searches;
HuNI Solr Store API
The HuNI Lab utilises the Solr search service as the API to return records for its search and retrieve functions. Note that Solr allows you to specify a JSONP callback function to enable cross site integration of JSON data from the Solr service.
/solr/select
Return one or more collections based on a Solr query.
- Return the record having the docid
AWAP\*\*\*concept\*\*\*AWE2134
as JSON wrapped in a JSONP function call tomyJavascriptCallback
- /solr/select?rows=1&q=docid:AWAP***concept***AWE2134&wt=json&json.wrf=myJavascriptCallback - Search for "attended Monash University" and return the second 15 rows as XML - /solr/select?q=attended+Monash+University&rows=15&start=16&wt=xml
- Search for "sheep" in the Bonza data set returning the first set of results as JSON - /solr/select?q=(text:sheep%20OR%20text_rev:sheep)%20AND%20(sourceAgencyCode:Bonza)&wt=json
- Return the first set of "Place" records as CSV - /solr/select?q=entityType:Place&wt=csv
Public Lab REST API
The HuNI REST API code is in the /huniteam/huni-backend repo. The full set of endpoints public and private (require a login) can be found in WebApp.pm.
All data from queries to the public Lab REST API is returned as JSON.
Record
The record query allows retrieving information relating to a record.
/vlab/record/collection
Return the lists of collection(s) associated with one or more records as an associative array keyed by docid.
Parameters:
d
(docid) - string - required
/vlab/record/collection?d={docid}[&d={docid} ... ]
/vlab/record/{docid}/collection
Return the collections associated with a record as an associative array keyed by docid.
URL argument:
docid
- string - required
/vlab/record/{docid}/collection
/vlab/record/link
Return the links associated with one or more docids as a list of link pairs including from and to docids.
Parameters:
d
(docid) - string - required
/vlab/record/link?d={docid}[&d={docid} ... ]
Link
Link queries return information about links between documents.
/vlab/link/{linkid}
URL argument:
linkid
- integer - required
/vlab/link/{linkid}
Public Collections
Public collection queries return information about public collections.
/vlab/publication
Return a list of public collections including a record count.
Parameters:
n
(number of records to return) - integer - optionalp
(page of records to return if specifying n) - integer - optionalq
(search string applied to collection names) - integer - optional
/vlab/publication?n={count}&p={page}&q={search string}
/vlab/publication/{collectionid}
Return public collection data and a list of records collected within it referenced by docid.
Url arguments:
collectionid
- integer - required
/vlab/publication/{collectionid}
HuNI Data Service (Harvest) API
The HuNI data service is responsible for harvesting from partner feeds, storing the harvested aggregate data, and transforming it for ingest into the HuNI data stores. It provides an API into the aggregate data store for reporting on harvest status and for returning stored documents.
Updated