"Dive into the world of crops effortlessly with Aeromegh's crop data API."
This API provides programmatic access to crop data, including types and quantities, with secure API key authentication. Explore the endpoints below for details on parameters and responses.
Authentication
To use the API, insert your API key in the Authorization header like this:
Authorization: Bearer <YOUR_API_KEY>
Replace <YOUR_API_KEY> with your AeroGCS API key. Without it, you'll get a 401 Unauthorized error.
//Please install 'axios' module first//Set your API key before making the requestconstaxios=require('axios');let config = { method:'get', maxBodyLength:Infinity, url: 'https://ags.aeromegh.com/Aeromegh/getAllCrops?searchString=&fromDateTime=2023-08-19T00:00:20.335Z&toDateTime=2024-05-07T23:59:20.335Z&orderBy=crop_type&orderType=DESC&pageSize=15&pageNumber=1',
headers: { 'Authorization':'Bearer <API_KEY>' }};axios.request(config).then((response) => {console.log(JSON.stringify(response.data));}).catch((error) => {console.log(error);});
//Please install 'requests' package first//Set your API key before making the requestimport requestsurl = "https://ags.aeromegh.com/Aeromegh/getAllCrops?searchString=&fromDateTime=2023-08-19T00:00:20.335Z&toDateTime=2024-05-07T23:59:20.335Z&orderBy=crop_type&orderType=DESC&pageSize=15&pageNumber=1"
payload ={}headers ={'Authorization':'Bearer <API_KEY>'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)
Note: Replace <API_KEY> with the actual API_KEY provided by Aeromegh.