Back to data catalog
Agriculture API
Summary of the other API's, relevant for agriculture.
OpenAPI Spec
Specification of all endpoints available in the agriculture api.
Github
Explore the source code behind the agriculture api.
More info
Data sources
This API aggregates data from our other APIs. It gives a summary of the most useful data for agriculture. Specifically it provides summerized data from deforestation, flood, soil and weather APIs.
Examples
Example 1
Retrieving summary of agricultural relevant data from all the APIs.
1import io.openepi.common.ApiException;
2import io.openepi.agriculture.api.Agriculture;
3import io.openepi.agriculture.model.ModelsSummmary;
4
5import java.math.BigDecimal;
6
7
8public class Main {
9 public static void main(String[] args) {
10 Agriculture api = new AgricultureApi();
11 try {
12 BigDecimal lon = new BigDecimal("30.06");
13 BigDecimal lat = BigDecimal.valueOf(-1.94);
14 ModelsSummary response = api.getSummary(lon, lat);
15 System.out.println(response);
16 } catch (ApiException e) {
17 System.err.println("Exception when calling AgricultureApi#getSummary");
18 e.printStackTrace();
19 }
20 }
21}
1const response = await fetch(
2 "https://api.openepi.io/agriculture/summary?" +
3 new URLSearchParams({
4 lon: "30.0619",
5 lat: "-1.9441",
6 })
7)
8console.log(await response.json())
9
1from httpx import Client
2
3with Client() as client:
4 response = client.get(
5 url="https://api.openepi.io/agriculture/summary",
6 params={"lon": 30.0619, "lat": -1.9441},
7 )
8
9 json = response.json()
10 print("Summary:", json)
11