An iNaturalist API toolkit for Javascript
iNatJS provides a flexible wrapper for interfacing with the iNaturalist API.
- Runs API requests with a queueing system with rate-limiting to stay within iNaturalist API limits
- Supports authenticated API requests
- Supports API v1 and v2 (v2 allows for customizing the returned data fields)
- Constructs the url for the AJAX call, including any parameters
queueINatRequest({
method: 'GET',
apiVersion: "v1",
endpoint: "observations",
params: {
user_login: "mickley",
quality_grade: "needs_id"
},
success: function(data) {
console.log(data);
// do something with the data
},
error: function(xhr, status, error) {
// handle error
console.log(status + ' ' + xhr.status + ': ' + error);
}
});