Documentation

APIFarmer Agriculture API Documentation

Authentication

To access APIFarmer Agriculture API, you need to obtain an API key. You can get an API key by visiting our pricing page and subscribing to one of our three API plans. Once you have subscribed you will receive an email with your API key included. Come back to our documentation page after you received your API key. With your API key in hand, use the {YOUR_API_KEY} parameter with any valid API endpoint URL and set it to your access key.

api-key={YOUR_API_KEY}
https://api.apifarmer.com/api/v0/stat?api-key={YOUR_API_KEY}

API Base URL

The base URL for all API endpoints is:

https://api.apifarmer.com/v0/

Database Requests Usage

Each APIFarmer API subscription has a monthly database request package that allows you to access the database and consume the database request points.

  • Worker Bee — 20,000 DB requests/month
  • Honeycomb — 50,000 DB requests/month
  • Nectar — Unlimited

Each request to the APIFarmer database is an API call. Depending on which endpoint you are going to call, a different number is subtracted from your subscription monthly package. Upon reaching the max monthly calls you can choose to upgrade to a higher plan or to wait until the package renewal date.

You can always find your request statistics and current usage by calling this API:

https://api.apifarmer.com/api/v0/stat?api-key={YOUR_API_KEY}

Errors

If your API request is not successful, APIFarmer will return an error with an error message.

  • Rate limitNumber of monthly requests in your package is exceeded.
  • Not FoundRequested data was not found.
  • Invalid or expired API KeyWrong API key or expired.
  • Too Many RequestsExceeding the set limit of 600 API calls per minute.

Agriculture API Values Legend

This documentation table should help you understand Agriculture API terminologies.

Weather API

ParameterData TypeDescriptionExample Value
latitudeFloatLatitude coordinate of the location40.7128
longitudeFloatLongitude coordinate of the location-74.006
countryStringThe UN/LOCODE for the countryUS
cityStringThe UN/LOCODE for the cityUSNYC
postal_codeStringPostal code of the location10001
sunriseStringTime of sunrise in HH:MM format5:30
sunsetStringTime of sunset in HH:MM format20:15
timezoneStringTimezone of the locationUTC-5
last_observation_timeStringTime of the last weather observation in ISO 8601 format2024-05-28T14:00:00Z
temp_cFloatTemperature in Celsius22
temp_fFloatTemperature in Fahrenheit71.6
feelslike_cFloatFeels like temperature in Celsius21
feelslike_fFloatFeels like temperature in Fahrenheit69.8
windchill_cFloatWind chill temperature in Celsius20
windchill_fFloatWind chill temperature in Fahrenheit68
heatindex_cFloatHeat index temperature in Celsius24
heatindex_fFloatHeat index temperature in Fahrenheit75.2
dewpoint_cFloatDew point temperature in Celsius15
dewpoint_fFloatDew point temperature in Fahrenheit59
wind_speed_mphFloatWind speed in miles per hour10
wind_speed_kphFloatWind speed in kilometers per hour16.1
wind_directionIntegerWind direction in degrees270
humidityIntegerHumidity percentage60
gust_mphFloatWind gust speed in miles per hour15
gust_kphFloatWind gust speed in kilometers per hour24.1
rain_probabilityIntegerProbability of rain in percentage40
temperature_min_cFloatMinimum temperature in Celsius for the day15
temperature_min_fFloatMinimum temperature in Fahrenheit for the day59
temperature_max_cFloatMaximum temperature in Celsius for the day28
temperature_max_fFloatMaximum temperature in Fahrenheit for the day82.4
weather_descriptionStringShort description of the weather conditionsPartly cloudy
cloud_coverIntegerCloud cover percentage75
pressureFloatAtmospheric pressure in hPa1013.25
sea_level_pressureFloatSea level pressure in hPa1015.5
visibilityFloatVisibility in kilometers10
precipitationFloatPrecipitation amount in mm2.5
snowFloatSnow amount in mm0
uv_indexIntegerUV index7
air_quality_indexIntegerAir quality index42
solar_radFloatSolar radiation in W/m²250
last_updatedStringTime when data was last updated in ISO 8601 format2024-05-28T14:05:00Z

Plant Database API

ParameterData TypeDescriptionExample Value
plant_idStringUnique internal identifier for the plantPLNT001
scientific_nameStringScientific name of the plantZea mays
symbolStringUSDA symbol for the plantZEAMX
common_nameStringCommon name of the plantCorn
familyStringFamily name of the plantPoaceae
genusStringGenus name of the plantZea
speciesStringSpecies name of the plantMays
durationStringLife duration of the plant (e.g., annual, perennial)Annual
kingdomStringKingdom classification of the plantPlantae
subkingdomStringSubkingdom classification of the plantTracheobionta
superdivisionStringSuperdivision classification of the plantSpermatophyta
divisionStringDivision classification of the plantMagnoliophyta
classStringClass classification of the plantLiliopsida
subclassStringSubclass classification of the plantCommelinidae
orderStringOrder classification of the plantPoales
growth_habitStringGrowth habit of the plant (e.g., tree, shrub, herb)Herb
native_statusStringNative status (e.g., native, introduced)Native
wetland_regionsStringWetland regions where the plant is commonly foundFACU
image_urlStringURL for an image of the planthttps://example.com/corn.jpg

Agriculture Commodity Prices API

ParameterData TypeDescriptionExample Value
commodityStringName of the commodityCorn
priceFloatCurrent price of the commodity (in USD)3.5
highFloatHighest price of the commodity for the day (in USD)3.6
lowFloatLowest price of the commodity for the day (in USD)3.4
openFloatOpening price of the commodity for the day (in USD)3.55
closeFloatClosing price of the commodity for the day (in USD)3.5
daily_changeFloatChange in price from open to close for the day (in USD)0.05
weekly_changeFloatChange in price over the past week (in USD)0.1
monthly_changeFloatChange in price over the past month (in USD)0.15
q1_changeFloatChange in price over the first quarter (in USD)0.2
q2_changeFloatChange in price over the second quarter (in USD)0.25
q3_changeFloatChange in price over the third quarter (in USD)0.3
q4_changeFloatChange in price over the fourth quarter (in USD)0.35
dateStringDate of the price data in YYYY-MM-DD2024-06-15
timeStringTime of the price data in HH:MM in UTC14:30
unitStringUnit of measurement for the priceUSD per bushel
currencyStringCurrency in which the price is denominatedUSD
symbolStringSymbol representing the commodityCORN

Farm Machinery and Equipment API

ParameterData TypeDescriptionExample Value
equipment_idStringUnique identifier for the equipmentFM001
manufacturerStringManufacturer of the equipmentJohn Deere
modelStringModel name or numberModel 9300
typeStringType of equipment (tractor, harvester, plow, etc.)Tractor
engine_power_hpFloatEngine power in horsepower150.5
horsepowerFloatHorsepower of the equipment160
fuel_capacity_litersFloatFuel capacity in liters250
weight_kgFloatWeight of the equipment in kilograms3500
dimensions_mmStringDimensions of the equipment (length x width x height)5000 x 2000 x 2500
operating_speed_kphFloatOperating speed in kilometers per hour25
featuresStringAdditional features or capabilitiesGPS navigation, AC
year_manufacturedIntegerYear the equipment was manufactured2023
price_usdFloatPrice of the equipment in USD45000
manualsArrayArray of URLs or paths to equipment manualshttps://example.com/manual.pdf , https://example.com/specs.pdf
warranty_infoStringWarranty information for the equipment3 years limited warranty
maintenance_scheduleStringRecommended maintenance schedule for the equipmentService every 200 hours
service_centersArrayArray of locations or contact details for service centersFarm Equipment Co. - Service Center A, Farm Equipment Co. - Service Center B
compatible_attachmentsArrayArray of compatible attachments or implementsPlow attachment, Seeder attachment
operational_videosArrayArray of URLs or paths to operational videoshttps://example.com/video1.mp4, https://example.com/video2.mp4

Endpoint 1: Weather API

This endpoint allows you to obtain weather data conditions by using latitude and longitude of the desired location.

GET/weather/{lon}{lat}

Parameters

  • {lon} {lat} — Longitude and latitude coordinates of the location you’re trying to get weather data from.
  • {start_date} {end_date} — Start date and end date for historical weather data retrieval (date must be set in ISO 8601 format).
  • {forecast_date} — Date for weather forecast data retrieval (date must be set in ISO 8601 format).
  • {YOUR_API_KEY} — Your API key to make calls.

Example request for current weather conditions

https://api.apifarmer.com/api/v0/weather?api-key={YOUR_API_KEY}&lat=40.7128&lon=-74.006

Example response for current weather conditions

{
  "data": {
    "latitude": 40.7128,
    "longitude": -74.006,
    "country": "US",
    "city": "USNYC",
    "sunrise": "5:30",
    "sunset": "20:15",
    "timezone": "UTC-5",
    "temp_c": 22,
    "feelslike_c": 21,
    "windchill_c": 20,
    "heatindex_c": 24,
    "dewpoint_c": 15,
    "wind_speed_kph": 16.1,
    "wind_direction": 270,
    "humidity": 60,
    "gust_kph": 24.1,
    "rain_probability": 40,
    "temperature_min_c": 15,
    "temperature_max_c": 28,
    "weather_description": "Partly cloudy",
    "cloud_cover": 75,
    "pressure": 1013.25,
    "sea_level_pressure": 1015.5,
    "visibility": 10,
    "precipitation": 2.5,
    "snow": 0,
    "uv_index": 7,
    "air_quality_index": 42,
    "solar_rad": 250,
    "last_updated": "2024-05-28T14:05:00Z"
  },
  "meta": {
    "duration": 0.00246942,
    "endpoint": "/api/v0/weather",
    "success": true
  }
}

Example request for historical weather conditions

https://api.apifarmer.com/api/v0/weather?api-key={YOUR_API_KEY}&lat=40.7128&lon=-74.006&start_date=2023-01-01T00:00:00Z&end_date=2023-06-01T00:00:00Z

Example response for historical weather conditions

{
  "data": {
    "start_date": "2023-01-01T00:00:00Z",
    "end_date": "2023-06-01T00:00:00Z",
    "latitude": 40.7128,
    "longitude": -74.006,
    "country": "US",
    "city": "USNYC",
    "sunrise": "5:30",
    "sunset": "20:15",
    "timezone": "UTC-5",
    "temp_c": 22,
    "feelslike_c": 21,
    "windchill_c": 20,
    "heatindex_c": 24,
    "dewpoint_c": 15,
    "wind_speed_kph": 16.1,
    "wind_direction": 270,
    "humidity": 60,
    "gust_kph": 24.1,
    "rain_probability": 40,
    "temperature_min_c": 15,
    "temperature_max_c": 28,
    "weather_description": "Partly cloudy",
    "cloud_cover": 75,
    "pressure": 1013.25,
    "sea_level_pressure": 1015.5,
    "visibility": 10,
    "precipitation": 2.5,
    "snow": 0,
    "uv_index": 7,
    "air_quality_index": 42,
    "solar_rad": 250,
    "last_updated": "2024-05-28T14:05:00Z"
  },
  "meta": {
    "duration": 0.00246942,
    "endpoint": "/api/v0/weather",
    "success": true
  }
}

Example request for forecast weather data

https://api.apifarmer.com/api/v0/weather?api-key={YOUR_API_KEY}&lat=40.7128&lon=-74.006&forecast_date=2023-06-16T14:00:00Z

Example response for forecast weather data

{
  "data": {
    "forecast_date": "2023-06-16T14:00:00Z",
    "latitude": 40.7128,
    "longitude": -74.006,
    "country": "US",
    "city": "USNYC",
    "sunrise": "5:30",
    "sunset": "20:15",
    "timezone": "UTC-5",
    "temp_c": 22,
    "feelslike_c": 21,
    "windchill_c": 20,
    "heatindex_c": 24,
    "dewpoint_c": 15,
    "wind_speed_kph": 16.1,
    "wind_direction": 270,
    "humidity": 60,
    "gust_kph": 24.1,
    "rain_probability": 40,
    "temperature_min_c": 15,
    "temperature_max_c": 28,
    "weather_description": "Partly cloudy",
    "cloud_cover": 75,
    "pressure": 1013.25,
    "sea_level_pressure": 1015.5,
    "visibility": 10,
    "precipitation": 2.5,
    "snow": 0,
    "uv_index": 7,
    "air_quality_index": 42,
    "solar_rad": 250,
    "last_updated": "2024-05-28T14:05:00Z"
  },
  "meta": {
    "duration": 0.00246942,
    "endpoint": "/api/v0/weather",
    "success": true
  }
}

Endpoint 2: Plant Database API

This endpoint gives you a list of plants based on your search parameter, such as: ID, common name, scientific name, symbol.

GET/plant

The next endpoint gives you access to plant details and characteristics based on your search parameter.

GET/plant_details

The following endpoint gives you growth requirements for a specified plant:

GET/plant_growth

Finally, this last plant endpoint retrieves plant reproduction and suitability/use data:

GET/plant_reproduction

Parameters

  • {plant_id} — Unique internal plant ID.
  • {scientific_name} — Scientific name of the plant.
  • {common_name} — Common name of the plant.
  • {symbol} — Symbol for the plant.
  • {YOUR_API_KEY} — Your API key to make calls.

Example request for plant list retrieval

https://api.apifarmer.com/api/v0/plant?api-key={YOUR_API_KEY}&{scientific_name}=Penstemon

Example response for plant list retrieval

{
  "data": [
    {
      "plant_id": "01PD",
      "scientific_name": "Penstemon digitalis",
      "symbol": "PEDI",
      "common_name": "Foxglove beardtongue"
    },
    {
      "plant_id": "01PG",
      "scientific_name": "Penstemon grandiflorus",
      "symbol": "PEGR",
      "common_name": "Large beardtongue"
    },
    {
      "plant_id": "01PH",
      "scientific_name": "Penstemon heterophyllus",
      "symbol": "PEHE",
      "common_name": "Foothill beardtongue"
    }
  ],
  "meta": {
    "duration": 0.00246942,
    "endpoint": "/api/v0/plant",
    "success": true
  }
}

Example request for plant details and characteristics retrieval

https://api.apifarmer.com/api/v0/plant_details?api-key={YOUR_API_KEY}&{scientific_name}=Penstemon%20digitalis

Example response for plant details and characteristics retrieval

{
  "data": {
    "plant_id": "01PD",
    "scientific_name": "Penstemon Digitalis",
    "symbol": "PEDI",
    "common_name": "Foxglove beardtongue",
    "family": "Scrophulariaceae Juss",
    "genus": "Penstemon Schmidel",
    "species": "Penstemon digitalis Nutt. ex Sim",
    "duration": "Perennial",
    "kingdom": "Plantae - Plants",
    "subkingdom": "Tracheobionta - Vascular plants",
    "superdivision": "Spermatophyta - Seed plants",
    "division": "Magnoliophyta - Flowering plants",
    "class": "Magnoliopsida - Dicotyledons",
    "subclass": "Asteridae",
    "order": "Scrophulariales",
    "growth_habit": "Forb/herb",
    "native_status": "CAN I, L48 N",
    "wetland_regions": "Atlantic and Gulf Coastal Plain FAC, Eastern Mountains and Piedmont FAC, Great Plains FACW, Midwest FAC, Northcentral & Northeast FAC",
    "active_growth_period": "Spring and Summer",
    "bloat": "None",
    "cn_ratio": "High",
    "coppice_potential": "No",
    "fall_conspicuous": "No",
    "fire_resistant": "No",
    "flower_color": "Purple",
    "flower_conspicuous": "Yes",
    "foliage_color": "Red",
    "foliage_porosity_summer": "Porous",
    "foliage_porosity_winter": "Porous",
    "foliage_texture": "Fine",
    "fruit_seed_color": "Brown",
    "fruit_seed_conspicuous": "No",
    "growth_form": "Rhizomatous",
    "growth_rate": "Moderate",
    "height_mature_ft": 4.0,
    "known_allelopath": "No",
    "leaf_retention": "No",
    "lifespan": "Moderate",
    "low_growing_grass": "No",
    "nitrogen_fixation": "None",
    "resprout_ability": "No",
    "shape_and_orientation": "Erect",
    "toxicity": "None"
  },
  "meta": {
    "duration": 0.00246942,
    "endpoint": "/api/v0/plant_details",
    "success": true
  }
}

Example request for plant growth requirements retrieval

https://api.apifarmer.com/api/v0/plant_growth?api-key={YOUR_API_KEY}&{scientific_name}=Penstemon%20digitalis

Example response for plant growth requirements retrieval

{
  "data": {
    "plant_id": "01PD",
    "scientific_name": "Penstemon Digitalis",
    "symbol": "PEDI",
    "common_name": "Foxglove beardtongue",
    "adapted_to_coarse_textured_soils": "Yes",
    "adapted_to_fine_textured_soils": "Yes",
    "adapted_to_medium_textured_soils": "Yes",
    "cold_stratification_required": "No",
    "drought_tolerance": "High",
    "fertility_requirement": "Medium",
    "fire_tolerance": "Medium",
    "frost_free_days_minimum": "110",
    "planting_density_per_acre_maximum": 4800,
    "planting_density_per_acre_minimum": 2700,
    "root_depth_minimum_inches": 8,
    "salinity_tolerance": "Medium",
    "shade_tolerance": "Tolerant",
    "moisture_use": "Low",
    "pH_maximum": 7.0,
    "pH_minimum": 5.5,
    "temperature_minimum_f": -38
  },
  "meta": {
    "duration": 0.00246942,
    "endpoint": "/api/v0/plant_growth",
    "success": true
  }
}

Example request for plant reproduction and suitability/use data retrieval

https://api.apifarmer.com/api/v0/plant_reproduction?api-key={YOUR_API_KEY}&{scientific_name}=Penstemon%20digitalis

Example response for plant reproduction and suitability/use data retrieval

{
  "data": {
    "plant_id": "01PD",
    "scientific_name": "Penstemon Digitalis",
    "symbol": "PEDI",
    "common_name": "Foxglove beardtongue",
    "bloom_period": "Late Spring",
    "commercial_availability": "Routinely Available",
    "fruit_seed_abundance": "Medium",
    "fruit_seed_period_begin": "Summer",
    "fruit_seed_period_end": "Summer",
    "fruit_seed_persistence": "No",
    "propagated_by_bare_root": "No",
    "propagated_by_bulb": "No",
    "propagated_by_container": "Yes",
    "propagated_by_corm": "No",
    "propagated_by_cuttings": "No",
    "propagated_by_seed": "Yes",
    "propagated_by_sod": "No",
    "propagated_by_sprigs": "Yes",
    "propagated_by_tubers": "No",
    "seed_per_pound": 400000,
    "seed_spread_rate": "Slow",
    "seedling_vigor": "Medium",
    "small_grain": "No",
    "vegetative_spread_rate": "Moderate",
    "berry_nut_seed_product": "No",
    "christmas_tree_product": "No",
    "fodder_product": "Yes",
    "lumber_product": "No",
    "naval_store_product": "No",
    "nursery_stock_product": "No",
    "palatable_browse_animal": "Medium",
    "palatable_graze_animal": "Low",
    "palatable_human": "No",
    "post_product": "No",
    "pulpwood_product": "No",
    "veneer_product": "No",
    "protein_potential": "Low"
  },
  "meta": {
    "duration": 0.00246942,
    "endpoint": "/api/v0/plant_reproduction",
    "success": true
  }
}

Endpoint 3: Agriculture Commodity Prices API

This endpoint allows you to gather real-time data on various commodities such as food, metal, and livestock commodities.

GET/commodities

Example request

https://api.apifarmer.com/api/v0/commodities?api-key={YOUR_API_KEY}

See the Agriculture Commodity Prices API values legend above for the full list of response fields, such as commodity, price, daily_change, unit and symbol.

Endpoint 4: Farm Machinery and Equipment API

This endpoint gives you a vast repository of farm machinery data, technical details, specifications, usage guidelines, operating manuals, maintenance recommendations and more for agricultural & farm equipment.

GET/farm_machinery

Example request

https://api.apifarmer.com/api/v0/farm_machinery?api-key={YOUR_API_KEY}

See the Farm Machinery and Equipment API values legend above for the full list of response fields, such as manufacturer, model, engine_power_hp and maintenance_schedule.

Endpoint 5: Agriculture Input Validator API

This endpoint allows you to bring a new level of standardization for your agriculture data, ensure accuracy and relevance and get rid of any manual data entry errors.

GET/agriculture_input

Example request

https://api.apifarmer.com/api/v0/agriculture_input?api-key={YOUR_API_KEY}

Frequently Asked Questions

How do I start using APIFarmer Agriculture API?

To get started, simply visit our pricing page and choose the API plan that best fits your needs. Click “Get API Key” and follow the instructions. After completing the payment, you will receive an API key and Agriculture API documentation to integrate APIFarmer with your application via email. Additionally, if you have any questions, you can always contact us for assistance and support.

Is there a contract or a commitment required to subscribe to APIFarmer?

No, there is no contract and commitment required. You can cancel your APIFarmer subscription anytime without any penalties and fees, because we believe in providing flexibility of our Agriculture API solutions to our customers. Therefore, you have the freedom to choose the API plan that suits your business needs without any long-term obligations.

How do I integrate APIFarmer APIs with my application?

To integrate APIFarmer APIs with your application, you can use our documentation and code examples as a guide. We provide detailed documentation for each of our APIs, including endpoint URLs, request and response formats, and sample code in multiple programming languages. To get started, sign up for an account and choose one of our API solutions, such as the Plant Database API key. By following the provided documentation and code examples, you can easily authenticate your API requests using the provided API key. Once authenticated, you can start making API calls using HTTP and HTTPS protocols.

And if you have any questions you can contact us via email and through our support email support@apifarmer.com.

What happens if I exceed my monthly API request limit?

If you exceed your monthly API request limit, you will receive an error message indicating that you have reached your limit. At this point, you have several options to consider. Firstly, you can choose to upgrade to a higher API plan, such as the Nectar API plan, which offers higher request limits to accommodate your needs. Alternatively, you can also purchase additional APIFarmer API requests to cover the overage — the overage charges will be billed to your account at the rate specified in your plan. To ensure a seamless experience with our Agriculture API or other products, we highly recommend closely monitoring your API usage.

Can I upgrade or downgrade my Pro API plan anytime?

Certainly! We understand that your business needs may evolve over time. Therefore, you have the flexibility to upgrade or downgrade your API plan anytime according to your changing requirements. To make the switch, simply log into your account and select the new API plan you wish to switch to. The changes will take effect immediately, and you will be charged the prorated amount for the remaining days of the month. If you choose to upgrade to a higher APIFarmer solution, such as the Honeycomb API Plan or Nectar API Plan, you will gain access to additional features and higher request limits. On the other hand, if you decide to downgrade, your request limits will be adjusted accordingly to align with the chosen plan.