Access options and limits

This section contains information for developers who want to use the API in data visualization, online mapping, or complex applications.

Most of the resources are available through simple GET requests without extra authorization. However we reserve the right to throttle the API depending on demand.

We are currently implementing an authorization framework that will allow for more complex POST operations, quicker returns, as well as communication with the wider developer community.

Simple GET requests will be available and most likely sufficient for mid-size applications build on Ecoengine data.

Terms of Use

The terms of use are not finalized. Please consult the meta data linked to the resources in the /api/sources/ and follow the terms of the upstream providers. If there is no third party linked or mentioned, data is most likely in the Public Domain.

Warning

Please consult the documentation of the upstream data provider or contact the people listed in the meta data for permission in particular use cases. Thank you.

Note

Please let us know about your project before it goes into production or publication. This way we can make sure that the API serves your needs, that the licensing requirements are met, and we will be able to inform you about planned changes ahead of time.

Limits

We currently throttle our API at about 500 requests/minutes (for unauthorized GET requests).

Single requests should be limited to 1000 records (which is currently not enforced.) This will guarantee that you will not get timeout errors.

Warning

We reserve the right to reduce the throttling thresholds for unauthorized requests in the future. Please contact our developer team if your application needs more band-width.

Note

We strongly recommend to use paginated requests. Increase the ?page_size= parameter if you exceed 300 requests a minute. Please contact us if you need more than 1000 times 300 records per minute (from a single consumer).

CORS

CORS stands for Cross-origin Resource Sharing. This technology allows for access from all consumers including client-side JavaScript. It replaces the older JSONP approach. You can access the API directly in your JavaScript code.

Use this JSFiddle as a starting point http://jsfiddle.net/falk/h2fCj/1/

Performance Considerations

We hope that many users and developers will work with the Ecoengine API in the future. Following performance considerations can help to reduce traffic and increase the speed of your applications.

  1. Request only required data. Filter as much as possible and use the ?fields=, ?exclude=, ?extra= parameters to limit the size of the response.
  2. Use pagination. Issue many requests with small returns instead of downloading big chunks of data. Use list views to explore the data and issue additional requests to get the details for single items.
  3. Cache data locally to reduce the number of repeated request. You can easily save API to disk (An more convenient system to check whether content of a particular request has changed will be implemented soon).

Caching

All returns of our web service will be cached for about 24 hours. If you need an uncached return you could add a random string to the end of your URL.

E.g. https://ecoengine.berkeley.edu/api/observations/?q=lynx&ehdehdehde

Since this request will be cached as well you have to change this string whenever you want a fresh return.

The data in the API does not changes very quickly, updates happen over night.

Authorization

Most resources can be requested by simple GET requests and URL encoded query parameters.

For some special cases in which we will grant certain rights to consumers we will use Token Authentication.

Note

Please contact the developer team to request special access or performance for your application.

We will provide you a with a user/password log-in with which you can request an access token.

curl \
    -X POST https://ecoengine.berkeley.edu/api-token-auth/ \
    -H 'Content-Type: application/json' \
    -d '{"username": "yourusername", "password": "yourpassword"}'

The API will – when successfully authorized – return a response similar to this.

{ 'token' : '9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' }

In order to use this token add it to your request Header.

Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b

The word “Token” is required here. Another curl example:

curl \
    -X GET https://ecoengine.berkeley.edu/api/observations/ \
    -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'

Note that authentication is NOT required for the view in the example.