Farmland Sales

Ag-Analytics® Farmland Sales API provides users with easy and fast access to filter and find land for sale, complete with the sales and geographic data components to get a detailed description of that land’s value. The data of this service is derived and sourced through a partnership with FarmlandFinder (https://www.farmlandfinder.com).

In this version of Farmland Sales API, each parcel/land has a full description of the entire sale/transaction. Multiple parcel/land record can belong to one transaction. In geographic attribute, each result record gives the detailed description of a certain land/parcel itself, while the attribute in ‘sales’ may carry the information for the transaction/sale other than this parcel/land.

Request

LEGAL NOTICE: USERS MAY NOT PUBLICLY DISCLOSE OR RESELL THESE DATA. USERS MAY NOT DISPLAY OR REDISTRIBUTE THE DATA IN BULK. THE DATA COLLECTION IS CONFIDENTIAL. USERS MUST DELETE THESE DATA UPON THE TERMINATION OF THEIR SUBSCRIPTION. USERS MAY NOT CONTINUE TO USE THE DATA AFTER SUBSCRIPTION HAS EXPIRED. THESE DATA MAY ONLY BE USED FOR WEB APPLICATIONS, INTERNAL BUSINESS PURPOSES AND OTHER RESEARCH PURPOSES ONLY, AND MAY NOT BE REDISTRIBUTED, RESOLD, OR RELICENSED. YOU AGREE TO HOLD AG-ANALYTICS TECHNOLOGY COMPANY LLC. HARMLESS FROM YOUR USE OR MISUSE OF THIS API OR DATA, AND YOU ACCEPT ALL LIABILITY FROM USING THIS API. SUBJECT TO ALL OTHER AG-ANALYTICS TERMS AT https://analytics.ag/Home/Terms. ANY DISPLAY OF THESE DATA OR DERIVATIVES, SUCH AS LIMITED DISPLAYS IN WEB INTERFACES OF INDIVIDUAL RECORDS OR REPORTS, MUST INCLUDE A NOTATION 'POWERED BY AG-ANALYTICS' AND THE TRIANGLE 'AG' LOGO OF AG-ANALYTICS. BY REGISTERING FOR A KEY AND/OR USING THIS API OR DATA, YOU AGREE TO THESE TERMS.





Click on Documentation to review the request and response parameters.
Click the Jupyter Notebook Static Sample to view a static rendition of this APIs Jupyter Notebook.
Click the Jupyter Notebook Github Repo to access the Jupyter Notebook .ipynb files and
instructions needed in order to run this APIs Jupyter Notebook.

Request Example

{
'State': "Michigan",
'County' : "Houghton",
'Bounding_Box': '{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":
[[[-88.6,47.04],[-88.54,47.04],[-88.54,47.1],[-88.6,47.1],[-88.6,47.04]]]}}',
'StartDate': '2019-08-08',
'EndDate': '2020-01-01',
'Status' : 'Sold'
}

Request Parameters

Parameter Data Type Required? Default Options Description
State Text Yes - - State of interest. Title cased.
Ex. “Michigan” or “Ohio”
County Text No - - List of State of interest. Title cased.
Ex. “Osceola” or “Polk”
Note: This parameter will be valid only if the
State parameter is provided
Bounding_box Text Yes - GeoJSON Area of interest in GeoJSON format.
Note: Please provide at least one parameter
selected from ‘State’, ‘County’, and
‘Bounding_box’
Status Text Yes - ‘Sold’, ‘For
Sale’,
‘Expired
Listing’
Sale Condition of the property.
StartDate Text Conditional - 'yyyy-mm-dd' Searching starting date of the property Sale
Date. In format 'yyyy-mm-dd'
Note: Required only if Status is ‘Sold’
EndDate Integer Conditional - 'yyyy-mm-dd' Searching end date of the property Sale Date.
In format 'yyyy-mm-dd'
Note: Required only if Status is ‘Sold’

Response Example

{"Listing_id": "4A7A9075-BFF8-42C4-BE12-1D7C8778794F",
"Entry_Updated": "0019-08-01 00:00:00",
"Avg_CSR2": 10.0952,
"CRP": "None",
"Total_Acres": 1327.0,
"Tillable_Acres": 1204.0,
"Percent_Tillable": 90.0,
"CRP_Acres": "None",
"Sale_Price": "600000.0000",
"Price_Acre": "6051.0000",
"Status": "For Sale",
"Sale_Condition": "Listing",
"Listing_Agent": "Michigan Land Brokers",
"Buyer": "None",
"Sale_Date": "None",
"Taxes_total": "None",
"Assessed_Land": "None",
"Broker_URL": "http://www.google.com",
"parcels": [{
"Parcel_ID": "sdfahdkfhlala87r9238",
"Parcel": "1", "Acres": 20.1,
"Shape": "POLYGON((-88.6 47.04,-88.54 47.04,-88.54 47.1,-88.6 47.1,-88.6 47.04))",
"GeoJSON": "{\"type\":\"Feature\", \"properties\":{}, \"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-88.95973205566405,46.68995749641134],[-88.76678466796875,46.68995749641134],[-88.76678466796875,46.7981792512332],[-88.95973205566405,46.7981792512332],[-88.95973205566405,46.68995749641134]]]}}",
"State": "Michigan",
"County": "Houghton",
"lat_center": 47.04,
"lng_center": -88.6,
"range": "34W",
"sect": "26",
"twnshp": "54N",
"county_name": "Houghton",
"state_name": "Michigan",
"STATEFP": "26",
"FIPS": "26061"}]}

Response Parameter Table in Documentation



To Test API

API testing requires a user token which can either be purchased
through a plan or with the free trial version. Quota restrictions apply.



Call API

Request

Request URL

Request headers

  • (optional)
    string
  • string

Request body

Request Example displayed in JSON format

State=Michigan&County=Houghton&Bounding_Box=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-88.6%2C47.04%5D%2C%5B-88.54%2C47.04%5D%2C%5B-88.54%2C47.1%5D%2C%5B-88.6%2C47.1%5D%2C%5B-88.6%2C47.04%5D%5D%5D%7D%7D

Responses

200 OK

Farmland Sales POST Response

Representations

{"Listing_id": "4A7A9075-BFF8-42C4-BE12-1D7C8778794F", "Entry_Updated": "0019-08-01 00:00:00", "Avg_CSR2": 10.0952, "CRP": "None", "Total_Acres": 1327.0, "Tillable_Acres": 1204.0, "Percent_Tillable": 90.0, "CRP_Acres": "None", "Sale_Price": "600000.0000", "Price_Acre": "6051.0000", "Status": "For Sale", "Sale_Condition": "Listing", "Listing_Agent": "Michigan Land Brokers", "Buyer": "None", "Sale_Date": "None", "Taxes_total": "None", "Assessed_Land": "None", "Broker_URL": "http://www.google.com", "parcels": [{"Parcel_ID": "sdfahdkfhlala87r9238", "Parcel": "1", "Acres": 20.1, "Shape": "POLYGON((-88.6 47.04,-88.54 47.04,-88.54 47.1,-88.6 47.1,-88.6 47.04))", "GeoJSON": "{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-88.95973205566405,46.68995749641134],[-88.76678466796875,46.68995749641134],[-88.76678466796875,46.7981792512332],[-88.95973205566405,46.7981792512332],[-88.95973205566405,46.68995749641134]]]}}", "State": "Michigan", "County": "Houghton", "lat_center": 47.04, "lng_center": -88.6, "range": "34W", "sect": "26", "twnshp": "54N", "county_name": "Houghton", "state_name": "Michigan", "STATEFP": "26", "FIPS": "26061"}]}

Code samples

@ECHO OFF

curl -v -X POST "https://ag-analytics.azure-api.net/farmland-sales/"
-H "Content-Type: application/x-www-form-urlencoded"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://ag-analytics.azure-api.net/farmland-sales/?" + queryString;

            HttpResponseMessage response;

            // Request body
            byte[] byteData = Encoding.UTF8.GetBytes("{body}");

            using (var content = new ByteArrayContent(byteData))
            {
               content.Headers.ContentType = new MediaTypeHeaderValue("< your content type, i.e. application/json >");
               response = await client.PostAsync(uri, content);
            }

        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://ag-analytics.azure-api.net/farmland-sales/");


            URI uri = builder.build();
            HttpPost request = new HttpPost(uri);
            request.setHeader("Content-Type", "application/x-www-form-urlencoded");
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
        };
      
        $.ajax({
            url: "https://ag-analytics.azure-api.net/farmland-sales/?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "POST",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://ag-analytics.azure-api.net/farmland-sales/";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"POST"];
    // Request headers
    [_request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://ag-analytics.azure-api.net/farmland-sales/');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Content-Type' => 'application/x-www-form-urlencoded',
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_POST);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Content-Type': 'application/x-www-form-urlencoded',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('ag-analytics.azure-api.net')
    conn.request("POST", "/farmland-sales/?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Content-Type': 'application/x-www-form-urlencoded',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('ag-analytics.azure-api.net')
    conn.request("POST", "/farmland-sales/?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://ag-analytics.azure-api.net/farmland-sales/')


request = Net::HTTP::Post.new(uri.request_uri)
# Request headers
request['Content-Type'] = 'application/x-www-form-urlencoded'
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body