Endpoints
The SolarFarmer web API has a number of endpoints that you can use, depending on the task you want to do.
An endpoint is the point of entry in the communication between an API and a server. See https://en.wikipedia.org/wiki/Web_API for a bit of background information on web APIs.
About endpoint
The About
endpoint requires no inputs and returns the version number of the libraries used by the web API.
- See About Endpoint for its definition.
- See About Endpoint Tutorial for a tutorial on how to use it.
SolarPosition endpoint
The SolarPosition
endpoint returns the solar position (zenith and azimuth) for a given location (longitude, latitude
and elevation) and date and time.
- See SolarPosition Endpoint for its definition.
- See SolarPosition Endpoint Tutorial for a tutorial on how to use it.
ModelChain endpoint
The ModelChain
endpoint runs the energy calculation in a synchronous way. This means that you issue the POST http request and
wait for it to return with the calculation results.
It is used for 2D calculations.
- See ModelChain Endpoint for its definition.
- See ModelChain Endpoint Tutorial for a tutorial on how to use it.
ModelChainAsync endpoint
This 'ModelChainAsync' endpoint runs the energy calculation in an asynchronous way. This means that you issue the POST http request to start the calculation, which immediately returns with an Instance ID that identifies this specific calculation.
You then issue multiple GET http requests with this Instance ID to get the status of the running calculation. Once it has successfully finished you can obtain the results.
It takes longer than the synchronous endpoint but is more powerful and is intended to be used for all 3D calculations and complex 2D calculations.
- See ModelChainAsync Endpoint for its definition.
- See ModelChainAsync Endpoint Tutorial for a tutorial on how to use it.
Service endpoint
The Service
endpoint requires no inputs (though still needs authorization) and returns the services that the user has access to.
- See Service Endpoint for its definition.
- See Service Endpoint Tutorial for a tutorial on how to use it.
TerminateModelChainAsync endpoint
The TerminateModelChainAsync
endpoint is used to terminate a currently running calculation that was initiated with a
POST request to the ModelChainAsync
endpoint.
You may have erroneously started the calculation, or realised the parameters weren't correct so need to cancel it,
or it may be taking much longer than you expect. You can do this with the TerminateModelChainAsync
endpoint.
- See TerminateModelChainAsync Endpoint for its definition.
- See TerminateModelChainAsync Endpoint Tutorial for a tutorial on how to use it.