Get All Crops
"Dive into the world of crops effortlessly with Aeromegh's crop data API."
Last updated
"Dive into the world of crops effortlessly with Aeromegh's crop data API."
Last updated
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.
To use the API, insert your API key in the Authorization header like this:
Replace <YOUR_API_KEY>
with your AeroGCS API key. Without it, you'll get a 401 Unauthorized error.
GET : Retrieves a list of all crops.
URL parameters are:
Parameter | Description | Optional | Example |
---|---|---|---|
Response Codes Explanation:
Examples of how you can call this API using curl, Node.js, and Python:
Note: Replace <API_KEY>
with the actual API_KEY provided by Aeromegh.
Example of API response in JSON format:
The following parameter is included in API response
Code | Details | Message |
---|---|---|
Parameter | Description | Example |
---|---|---|
searchString
Users can search by crop type.
Yes
fromDateTime
Start date and time in UTC.
Yes
2023-08-19T00:00:20.335Z
toDateTime
End date and time in UTC.
Yes
2024-05-07T23:59:20.335Z
orderBy
Field name to order by; default field is crop_type.
Yes
crop_type
orderType
Sorting order, either ASC or DESC; default is DESC.
Yes
DESC
pageSize
Number of records shown on each page.
Yes
15
pageNumber
Page number; must be greater than zero.
Yes
1
200
The request was successful.
"OK"
400
Request parameters missing.
"Request parameters missing"
500
Internal server error.
"Internal server error"
crop_type
The type of crop returned in the response
rice