EcoStac.ai API
Most of the functionality of the EcoStac app is also available for programmatic use through our API. Please refere to the API docs for the full set of available endpoints.
API tokens
To access the API, you will need to generate an API token. To do so, please navigate to the app Settings (bottom button in the left-most sidebar) and then to "Token". From there, click on the "New Token" button to generate a token. Once it has generated, copy the token and store it securely. You can then use the generated token as a Bearer token in an Authorization header to authenticate any requests against the API.
You will only be able to view your API token's value once.
Please make sure to store it securely.
Our API tokens have indefinite lifetimes by default.
You can set your token to expire after an arbitrary amount of time by requesting against the token expiry endpoint
Additionally, if you suspect that your token might be compromised, make sure to delete the token by requesting against the token deletion endpoint.
API usage
For most common tasks, like farm management, sampling designs and reporting, you should be able to reproduce the workflows described in the guides by reading the relevant parts of the API docs.
API usage is subject to stricter rate limiting than app usage.
You can view the current state of your limits by requesting against https://api.ecostac.ai/limits/status
with your API token.
Carbon Estimation Areas (CEAs)
The only part of the the API with functionality not already exposed in the app are the CEA management endpoints. CEAs are non-editable objects which ensure that immutable farm geometry is linked to certain sensitive operations like sampling design creation or report generation. They reflect the state of your farm's geometry at the time of performing the operation.
You will see references to CEA parameters in the API docs.
For example when creating a sampling design or a report, you may either submit the required geometry definitions (i.e. those pulled from your farm areas), or just a cea_id
to reuse geometry from an existing CEA. If you submit geometry definitions equivalent to an existing CEA, it will not be recreated. You will instead recieve a reference to the existing CEA in responses from the API.