New & Used Trucks & Cars For Sale Classifieds

Lemonfree API Beta Documentation 1.0

Overview

Overview The Lemonfree API provides you with easy access to our vehicle listings and related data. This data is available through a simple and easy to use REST-based system, and returns fully valid XML results. API Key

API Key

API Key Requests to the Lemonfree API require an API key. This key consists of a string of letters and numbers which is unique to each developer, and allows us to track your usage. Currently we are only offering limited API keys to individuals; once the beta stage is complete API keys will be available to the general public. Quotas

Quotas

Quotas The Lemonfree API uses per-user daily request quotas. Users are currently limited to 1000 daily requests per API key; each call to an API feed uses 1 request. All quotas are reset every day at 12 AM CST. Feeds

Feeds

Lemonfree currently provides 3 feeds for API users:

  • Makes
  • Models
  • Listings
  • Facts
To obtain a sample result for one of the feeds, just access the base URL without any parameter

Makes

The Makes feed provides access to all the vehicle makes currently available on Lemonfree.
Base URL: http://api.lemonfree.com/makes

Parameter Type Occurrence Description
key string required your API key

Models

The Models feed provides access to all vehicle models for a specific make currently available on Lemonfree.
Base URL: http://api.lemonfree.com/models

Parameter Type Occurrence Description
key string required your API key
make string required limits the results to a specific make

Listings

The Listings feed provides access to all vehicle listings on Lemonfree. It returns a maximum of 10 listings per call; if there are more than 10 results for a query, additional results can be obtained by specifying a page number in the query string.
Base URL: http://api.lemonfree.com/listings

Parameter Type Occurrence Description
key string required your API key
make string optional limits the results to a specific make (eg. Ford)
model string conditional limits the results to a specific model (eg. Mustang). If specified, make must also be specified.
year_from int conditional limits the results to a year range; year_from specifies the lower end of this range. If used, year_to must also be specified, and be greater than or equal to year_from.
year_to int conditional limits the results to a year range; year_to specifies the upper end of this range. If used, year_from must also be specified, and be less than or equal to year_to.
price_min int conditional limits the results to a price range; price_min specifies the lower end of this range. If used, price_max must also be specified, and be greater than or equal to price_min.
price_max int conditional limits the results to a price range; price_max specifies the upper end of this range. If used, price_min must also be specified, and be less than or equal to price_max.
mileage_min int conditional limits the results to a mileage range; mileage_min specifies the lower end of this range; If used, mileage_max must also be specified, and be greater than or equal to mileage_min.
mileage_max int conditional limits the results to a mileage range; mileage_max specifies the upper end of this range; If used, mileage_min must also be specified, and be less than or equal to mileage_max.
zip string optional limits the results to a particular location as defined by a zip/postal code. An area can be specified by including the distance parameter; if there is no distance, results will be limited to only the provided zip/postal code.
distance int conditional limits the results to an area around the provided zip/postal code; if distance is specified, zip must also be specified. If distance is specified and is 0, behaviour is the same as no distance. Min: 0. Max: 20. Default: 0.
page int optional specifies the number of the page of results to return; if there are no more results a response code of 3 will be returned (see response codes section). Min: 1. Default: 1.

Facts

The facts feed provides access to interesting and useful vehicle-related data available on Lemonfree.com.
Base URL: http://api.lemonfree.com/facts

Parameter Type Occurrence Description
key string required your API key
fact string required The type of fact being requested. Currently available values are: avg_price: find the average price on lemonfree.com for a year/make/model
year int required Year of the vehicle for which facts are requested
make string required Make of the vehicle for which facts are requested
model string required Model of the vehicle for which facts are requested

Feed Querying Example

This example uses the listings feed; the same syntax is used to query all other feeds.

Scenario:
I want a list of Ford Mustangs on Lemonfree from 1996 to 2001, and with a price between $10000 and $20000.

Query URL:
http://api.lemonfree.com/listings?key=[YOUR_KEY]&make=Ford&model=Mustang&year_from=1996&year_to=2001&price_min=10000&price_max=20000

Result:

<?xml version="1.0" encoding="UTF-8"?>
<response xmlns:lf="http://api.lemonfree.com/ns/1.0">
    <lf:request_type>listing</lf:request_type>
    <lf:response_code>0</lf:response_code>
    <lf:result type="listing" count="10">
        <lf:item id="33585487">
            <lf:attr name="title">Used 2001 Ford Mustang SVT Cobra Cobra</lf:attr>
            <lf:attr name="year">2001</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">18991</lf:attr>
            <lf:attr name="mileage">17424</lf:attr>
            <lf:attr name="auction">no</lf:attr>
            <lf:attr name="city">Dearborn</lf:attr>
            <lf:attr name="state">Michigan</lf:attr>
            <lf:attr name="image">http://images.lemonfree.com/33585487_1_thumb.jpg</lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33585487.html</lf:attr>
        </lf:item>
        <lf:item id="33582908">
            <lf:attr name="title">Used 2000 Ford Mustang GT</lf:attr>
            <lf:attr name="year">2000</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">10000</lf:attr>
            <lf:attr name="mileage">69000</lf:attr>
            <lf:attr name="auction">no</lf:attr>
            <lf:attr name="city">Apalachin</lf:attr>
            <lf:attr name="state">New York</lf:attr>
            <lf:attr name="image">http://images.lemonfree.com/33582908_1_thumb.jpg</lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33582908.html</lf:attr>
        </lf:item>
        <lf:item id="33569789">
            <lf:attr name="title">Used 1999 Ford Mustang SVT Cobra</lf:attr>
            <lf:attr name="year">1999</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">12328</lf:attr>
            <lf:attr name="mileage">40128</lf:attr>
            <lf:attr name="auction">no</lf:attr>
            <lf:attr name="city">Wesley Chapel</lf:attr>
            <lf:attr name="state">Florida</lf:attr>
            <lf:attr name="image">http://images.lemonfree.com/33569789_1_thumb.jpg</lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33569789.html</lf:attr>
        </lf:item>
        <lf:item id="33566001">
            <lf:attr name="title">Used 1999 Ford Mustang Saleen</lf:attr>
            <lf:attr name="year">1999</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">19900</lf:attr>
            <lf:attr name="mileage">59000</lf:attr>
            <lf:attr name="auction">no</lf:attr>
            <lf:attr name="city">Dallas</lf:attr>
            <lf:attr name="state">Texas</lf:attr>
            <lf:attr name="image"></lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33566001.html</lf:attr>
        </lf:item>
        <lf:item id="33557494">
            <lf:attr name="title">Ford : Mustang</lf:attr>
            <lf:attr name="year">1998</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">15900</lf:attr>
            <lf:attr name="mileage"></lf:attr>
            <lf:attr name="auction">yes</lf:attr>
            <lf:attr name="city">Sunny</lf:attr>
            <lf:attr name="state">Florida</lf:attr>
            <lf:attr name="image">http://images.lemonfree.com/33557494_1_thumb.jpg</lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33557494.html</lf:attr>
        </lf:item>
        <lf:item id="33557450">
            <lf:attr name="title">2000 S/C Saleen Mustang   # 210 Amazing Deal!!!</lf:attr>
            <lf:attr name="year">2000</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">14000</lf:attr>
            <lf:attr name="mileage">61108</lf:attr>
            <lf:attr name="auction">yes</lf:attr>
            <lf:attr name="city">Joplin</lf:attr>
            <lf:attr name="state">Missouri</lf:attr>
            <lf:attr name="image">http://images.lemonfree.com/33557450_1_thumb.jpg</lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33557450.html</lf:attr>
        </lf:item>
        <lf:item id="33557341">
            <lf:attr name="title">Ford : Mustang</lf:attr>
            <lf:attr name="year">1998</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">10995</lf:attr>
            <lf:attr name="mileage"></lf:attr>
            <lf:attr name="auction">yes</lf:attr>
            <lf:attr name="city">Kearny</lf:attr>
            <lf:attr name="state">New Jersey</lf:attr>
            <lf:attr name="image">http://images.lemonfree.com/33557341_1_thumb.jpg</lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33557341.html</lf:attr>
        </lf:item>
        <lf:item id="33537413">
            <lf:attr name="title">Used 2001 Ford Mustang GT</lf:attr>
            <lf:attr name="year">2001</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">10995</lf:attr>
            <lf:attr name="mileage">42514</lf:attr>
            <lf:attr name="auction">no</lf:attr>
            <lf:attr name="city">Michigan City</lf:attr>
            <lf:attr name="state">Indiana</lf:attr>
            <lf:attr name="image">http://images.lemonfree.com/33537413_1_thumb.jpg</lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33537413.html</lf:attr>
        </lf:item>
        <lf:item id="33495430">
            <lf:attr name="title">Ford : Mustang</lf:attr>
            <lf:attr name="year">1999</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">13900</lf:attr>
            <lf:attr name="mileage"></lf:attr>
            <lf:attr name="auction">yes</lf:attr>
            <lf:attr name="city">Amston</lf:attr>
            <lf:attr name="state">Connecticut</lf:attr>
            <lf:attr name="image">http://images.lemonfree.com/33495430_1_thumb.jpg</lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33495430.html</lf:attr>
        </lf:item>
        <lf:item id="33495414">
            <lf:attr name="title">Ford : Mustang</lf:attr>
            <lf:attr name="year">2001</lf:attr>
            <lf:attr name="make">FORD</lf:attr>
            <lf:attr name="model">MUSTANG</lf:attr>
            <lf:attr name="price">11000</lf:attr>
            <lf:attr name="mileage"></lf:attr>
            <lf:attr name="auction">yes</lf:attr>
            <lf:attr name="city">Naples</lf:attr>
            <lf:attr name="state">Florida</lf:attr>
            <lf:attr name="image">http://images.lemonfree.com/33495414_1_thumb.jpg</lf:attr>
            <lf:attr name="link">http://www.lemonfree.com/33495414.html</lf:attr>
        </lf:item>
    </lf:result>
</response>

Query Results

Common Result Fields

All feed results have the same basic structure, making it much less time consuming to use multiple feeds in your application. Feeds usedifferent attributes to describe the data returned; these attributes are detailed in the individual feed sections below. Here is a list of the common fields found in all results:
NOTE: Attributes enclosed in square brackets (ie. [attribute]) are only available for certain result types

Field Attributes Description
request_type none The type of request (or feed) that was made to obtain these results
response_code none The type of request (or feed) that was made to obtain these results
result type: The type of results being returned. Usually the same as the request_type field; however for feeds where there are different types of possible results (ie. facts feed), this attribute will indicate which type is being returned.
count: The number of items returned in this result.
A container for the individual result items.
item [id]: The ID of a specific result item (if applicable); usually included for use in other requests or feeds The item field contains the details about a specific result item. If multiple details are returned for a single item, each detail is enclosed in an attr field (described below); otherwise the detail is returned as a string inside the item field.
attr various The attr field contains an individual detail for a result item. This field is present if a result item contains more than one individual detail. Attributes for this field can vary depending on which feed was used; for possible values, see the individual feed sections below.

Listing Feed Attribute Values

Listing Feed Attribute Values Listing feed details all specify the attribute '''name''', which indicates which data that particular detail contains. Possible values for this attribute are:

Value Description
title Title of this vehicle listing
year Vehicle year
make Vehicle make
model Vehicle model
price Vehicle price / current bid (auction detail indicates which)
mileage Vehicle mileage
auction "yes" if the vehicle is an auction, "no" if it is a direct sale.
city City where the vehicle is located
state State where the vehicle is located
image Thumbnail image of the vehicle, if available
link URL to the details page for this vehicle on Lemonfree.com

Fact Feed Attribute Values

Value Description
avg_price The average price on Lemonfree.com for the given year/make/model. (only with avg_price request)
country Indicates which country (and currency) the average price relates to. (only with avg_price request)

Response Codes

Every result returned will have a response code field, and potentially an error message as well (contained in the response_err field). The following is a list of possible response codes and what error message (if any) they return.

Code Error Message Description
0 none This code indicates that the request was successful, and the response should contain valid results.
1 Invalid API key The API key specified in the request either does not exist, or the account it belongs to hasn't yet been validated.
2 Maximum daily quota reached The daily request quota associated with this API key has been reached
3 No data available The request made did not return any results
4 API service unavailable There was a problem communicating with the API server; usually only occurs if the API is undergoing maintenance.
©2007 LemonFree.Com
New & Used Trucks & Cars for Sale
LemonFree Home / Privacy Policy /Terms of Use / Sitemap