Get All Crops

"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.

Method

GET : Retrieves a list of all crops.

HTTP Request

https://ags.aeromegh.com/Aeromegh/getAllCrops?searchString={searchString}&fromDateTime={fromDateTime}&toDateTime={toDateTime}&orderBy={orderBy}&orderType={orderType}&pageSize={pageSize}&pageNumber={pageNumber}

URL Parameters

URL parameters are:

HTTP Response

Response Codes Explanation:

Code Snippet

Examples of how you can call this API using curl, Node.js, and Python:

curl --location 'https://ags.aeromegh.com/Aeromegh/getAllCrops?searchString=&fromDateTime=2023-08-19T00%3A00%3A20.335Z&toDateTime=2024-05-07T23%3A59%3A20.335Z&orderBy=crop_type&orderType=DESC&pageSize=15&pageNumber=1' \
--header 'Authorization: Bearer <API_KEY>'

Note: Replace <API_KEY> with the actual API_KEY provided by Aeromegh.

API Response

Example of API response in JSON format:

{
    "allCrops": [
        {
            "crop_type": "rice"
        },
        {
            "crop_type": "jawar"
        }
    ]
}

API Response Parameter

The following parameter is included in API response

Last updated