LemonFree API 2.0 Documentation - Years Feed

Last Updated: January 21, 2014

Overview

The Years feed provides a list of vehicle years currently available on LemonFree.

Base URL

http://api.lemonfree.com/v2/years

Parameters

Parameter Type Occurrence Description
key string required Your API key
format Result Format optional Sets the format of the result.
If format is not specified the default format is xml.
make | make_id string | int required A specific make (or ID) that has been obtained by the makes feed.
Only make or make_id must be set. If both are specified an error will be returned.
model | model_id string | int required A specific model (or ID) that has been obtained by the models feed.
If used, make (or make_id) must also be specified.
Only model or model_id must be set. If both are specified an error will be returned.
trim | trim_id string | int optional A specific trim (or ID) that has been obtained by the trims feed.
If used, make (or make_id) and model (or model_id) must also be specified.
Only trim or trim_id must be set. If both are specified an error will be returned.
price_min Price optional 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 Price optional 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.
state State optional Limits the results to the specified state/province.
sort_by Sort optional Sorts the results by the specified value.
If sort_by is not specified the default sort order is by year.

Query Result Fields

Field Description
year The year
listing_count The number of listings with this year

Sample Results

XML

<?xml version="1.0" encoding="UTF-8"?>
<response xmlns:lf="http://api.lemonfree.com/ns/1.0">
    <lf:request_type>years</lf:request_type>
    <lf:request_params>
        <lf:attr name="feed">years</lf:attr>
        <lf:attr name="key">[YOUR API KEY]</lf:attr>
    </lf:request_params>
    <lf:response_code>0</lf:response_code>
    <lf:result>
        <lf:item>
            <lf:attr name="year">2012</lf:attr>
            <lf:attr name="listing_count">22531</lf:attr>
        </lf:item>
        <lf:item>
            <lf:attr name="year">2011</lf:attr>
            <lf:attr name="listing_count">196896</lf:attr>
        </lf:item>
        <lf:item>
            <lf:attr name="year">2010</lf:attr>
            <lf:attr name="listing_count">199692</lf:attr>
        </lf:item>
    </lf:result>
</response>    

JSON

{
    "response":{
        "request_type":"years",
        "request_params":{
            "feed":"years",
            "format":"json",
            "key":"[YOUR API KEY]"
        },
        "response_code":"0",
        "result":[
            {
                "year":"2012",
                "listing_count":"22531"
            },
            {
                "year":"2011",
                "listing_count":"196896"
            },
            {
                "year":"2010",
                "listing_count":"199692"
            }
        ]
    }
}    

Examples

Query LemonFree API URL to use
All years associated with Nissan Altima listings http://api.lemonfree.com/v2/years/?make=Nissan&model=Altima&key=[YOUR API KEY]
All years associated with Ford listings that are over $5,000 http://api.lemonfree.com/v2/years/?make=Ford&price_min=5000&price_max=9999999&key=[YOUR API KEY]
All years associated with 2000-2010 Ford Escort SE listings that are between $5,000 and $20,000 http://api.lemonfree.com/v2/years/?make=Ford&model=Escort&trim=SE&price_min=5000&price_max=20000&year_from=2000&year_to=2010&key=[YOUR API KEY]
All years associated with Toyota listings in Nebraska http://api.lemonfree.com/v2/years/?make=Toyota&state=NE&key=[YOUR API KEY]