NAME
Museum::TePapa - an interface to the Te Papa museum API
VERSION
Version 0.02
SYNOPSIS
This provides handy methods for access the various endpoints of the Te Papa museum API. See https://data.tepapa.govt.nz/docs/index.html for information on them. You will need an API key, this doesn't handle the guest key mechanism.
use Museum::TePapa;
my $tepapa = Museum::TePapa->new( key => 'yoursecretkey' );
my $result = $tepapa->object_search( $query, { limit => 3 } );
my $result = $tepapa->place( $id, { ... parameters ... } );
my $result = $tepapa->taxon_related( $id, { ... parameters ... } );
# This provides results in batches through the callback
$tepapa->media_scroll( $callback, { ... parameters ... } );
METHODS
new
my $tepapa = Museum::TePapa->new( key => 'yoursecretkey' );
Create a new instance of the API interface.
agent_search( $query, { ... parameters ... } )
agent( $id, { ... parameters ... } )
agent_related( $id, { ... parameters ... } )
agent_scroll( $id, { ... parameters ... } )
category_search( $query, { ... parameters ... } )
category( $id, { ... parameters ... } )
category_related( $id, { ... parameters ... } )
category_scroll( $id, { ... parameters ... } )
document_search( $query, { ... parameters ... } )
document( $id, { ... parameters ... } )
document_related( $id, { ... parameters ... } )
document_scroll( $id, { ... parameters ... } )
fieldcollection_search( $query, { ... parameters ... } )
fieldcollection( $id, { ... parameters ... } )
fieldcollection_related( $id, { ... parameters ... } )
fieldcollection_scroll( $id, { ... parameters ... } )
group_search( $query, { ... parameters ... } )
group( $id, { ... parameters ... } )
group_related( $id, { ... parameters ... } )
group_scroll( $id, { ... parameters ... } )
media_search( $query, { ... parameters ... } )
media( $id, { ... parameters ... } )
media_related( $id, { ... parameters ... } )
media_scroll( $id, { ... parameters ... } )
object_search( $query, { ... parameters ... } )
object( $id, { ... parameters ... } )
object_related( $id, { ... parameters ... } )
object_scroll( $id, { ... parameters ... } )
place_search( $query, { ... parameters ... } )
place( $id, { ... parameters ... } )
place_related( $id, { ... parameters ... } )
place_scroll( $id, { ... parameters ... } )
taxon_search( $query, { ... parameters ... } )
taxon( $id, { ... parameters ... } )
taxon_related( $id, { ... parameters ... } )
taxon_scroll( $id, { ... parameters ... } )
topic_search( $query, { ... parameters ... } )
topic( $id, { ... parameters ... } )
topic_related( $id, { ... parameters ... } )
topic_scroll( $id, { ... parameters ... } )
search( $query, { ... parameters ... } )
search_scroll( $id, { ... parameters ... } )
All these methods map directly on to the API endpoints referenced in the API documentation, with some small naming differences. _search
puts the query into the q
parameter.
_scroll
has a different behaviour to the others: it requires a callback function. This callback will be called with every batch of data fetched. If it returns a true value, then the collection process will stop.
TODO
The advanced search interface isn't implemented, as it's a little different to the others and I don't need it.
AUTHOR
Robin Sheat, <rsheat at cpan.org>
BUGS
Please report any bugs or feature requests to bug-museum-tepapa at rt.cpan.org
, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Museum-TePapa. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Museum::TePapa
You can also look for information at:
Source Repository (report bugs here)
RT: CPAN's request tracker (or here)
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
This software is Copyright (c) 2023 by Robin Sheat.
This is free software, licensed under:
The GNU Affero General Public License, Version 3, November 2007