Could an open API be made available for TrapNZ, so that request could be made with a key. XML or JSON would be fine.
That would enable other uses to be made of trapping data. For example, I would like to be able to use the API to get trap data for my project and use it with other applications.
This post has some info on getting data ins as XML and other formats. An āAll trap recordsā layer has been added. It uses basic auth rather than a key, however.
There will be an API for public map feeds, and we plan to switch to using that for private feeds like the ones above. Weāll make an announcement when this becomes available.
Please could you clarify the way that the url needs to be entered for basic auth on something like Arcgis online?
Would it be in the form: https://username:password@trap.nz/wms/features/000000
Iām attempting this simply in a web browser and i get redirected to https://trap.nz/wms/features/0000000
and it returns:
<result>Access denied for user anonymous</result>
Hi @root
Many thanks - an open API with a key would enable other non GIS uses that people might think of. For example - Connecting trap data to google calendar. Connecting with project management systems etc. The key would be additional to projectID. Each key would be unique to a user.
Xero has great documentation and examples of how their API works as does Google. So far there are 20,000 other open APIās available and growing daily
No mind. The username/password prefix doesnāt seem to work, you need a client that can send basic authentication like QGIS (which is free vs Arcgis)
An API key as @mikepeters mentions would be handy too.
Hello, Iām working for a client that would like to display trap information on their website. Iāve seen the methods for using https://trap.nz/wms/features/, but Iām not sure how to obtain a username/password to use this service. Are there any updates on the availability of an open API for trap data? Is a paid one available? Thanks!
Hello,
I have done something with https://www.pestfreeporirua.org.nz/
See each suburb in the project directory.
This consumes the project summary data which is available as a json feed. Iām using Wordpress for the website and a table plugin to render the data into a table.
You have to enable āShare Summary Dataā on the project page in trap.nz and the you can use a URL including the project id to get the data in json form.
You donāt get any choice about what data is returned.
See this for the information on how to build the URL to obtain the data.
Hi there, for the username and password you just use your usual credentials for the website. You need to be at least a read-only member for each project you will be getting the wms data from.
There are some threads I started regarding getting data out of Trap.nz to make gis reports using qgis which have some information on providing credentials- one thing that you might get stuck on is that the website lets you login with your email address as your username, but the api only lets you use your username.
Hi @david.alderman sorry to bring up such an old post but the URL that you posted no longer works and i canāt find anyway to extract a json file. Are you still doing this?
Iām trying to display total counts for a project for each species? (ie 20 Rat, 50 Mice) etc
We didnāt fund hosting a website so my example map wonāt show. I still have the source code for the html page that loaded the hexmap and that would still work offline in a browser.
I opened it up just now and it looks like it no longer functions.
I can see if its an easy fix, I basically adapted the same javascript code that is used on the home page of trap.nz for the hexmap there but focused on the projects in my area rather than for the whole country.
Itās not for the map that iām after, iām more looking to extract the records in a ātotalā format, and have this sitting in a CSV file. Kind of like these stats, but so i can display them on our trapping website:
Just updating this thread to note that there are a couple of options currently.
You can get a map which you can embed in your own website that summarises catches with a hexagon heat map. Make sure your project has Share summary data ticked, then you can access the summary map at https://trap.nz/static/hexmap/?projects=[123]
where 123 is your project ID.
It looks like we havenāt documented this in the help yet, Iāve just made a task to get that updated.
Unofficially you can access the raw feed for this map using: https://trap.nz/project/trap-killcount.json?projects=123
We are currently working on a dedicated authenticated API to get data into and out of trap.nz which the app is transitioning over to using as we flesh it out. Eventually once the feature set is stable we will open that up to the public to enable integration with third party apps and integrations.
We also intend to continue to refine our authenticated and public reporting to enable a host of use cases from public consumer based reporting which can be used with a minimum of technical fuss and embedded in third party websites and shared on social media (like the project hex map above), Geoserver-based feeds for GIS applications (expanding on our current feed list above), and opening up authenticated JSON-based data feeds (initially read-only, but likely eventually with write capability).