LemonFree API 2.0 Documentation - Models Feed

Last Updated: January 21, 2014

Overview

The Models feed provides access to all vehicle models for a specific make currently available on LemonFree.

Base URL

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

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.
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.
year_from Year optional 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 Year optional 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.
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 model name.

Query Result Fields

Field Description
model_id The ID of the model
model The name of the model
make_id The ID of the make associated with this model
model The name of the make associated with this model
listing_count The number of listings with this make and model

Sample Results

XML

<?xml version="1.0" encoding="UTF-8"?>
<response xmlns:lf="http://api.lemonfree.com/ns/1.0">
    <lf:request_type>models</lf:request_type>
    <lf:request_params>
        <lf:attr name="feed">makes</lf:attr>
        <lf:attr name="key">[YOUR API KEY]</lf:attr>
        <lf:attr name="make">HONDA</lf:attr>
    </lf:request_params>
    <lf:response_code>0</lf:response_code>
    <lf:result>
        <lf:item>
            <lf:attr name="model_id">95</lf:attr>
            <lf:attr name="model">Accord</lf:attr>
            <lf:attr name="make_id">10</lf:attr>
            <lf:attr name="make">Honda</lf:attr>
            <lf:attr name="listing_count">47728</lf:attr>
        </lf:item>
        <lf:item>
            <lf:attr name="model_id">96</lf:attr>
            <lf:attr name="model">Civic</lf:attr>
            <lf:attr name="make_id">10</lf:attr>
            <lf:attr name="make">Honda</lf:attr>
            <lf:attr name="listing_count">50569</lf:attr>
        </lf:item>
        <lf:item>
            <lf:attr name="model_id">297</lf:attr>
            <lf:attr name="model">Fit</lf:attr>
            <lf:attr name="make_id">10</lf:attr>
            <lf:attr name="make">Honda</lf:attr>
            <lf:attr name="listing_count">5337</lf:attr>
        </lf:item>
    </lf:result>
</response>    

JSON

{
    "response":{
        "request_type":"makes",
        "request_params":{
            "feed":"makes",
            "format":"json",
            "key":"[YOUR API KEY]",
            "make":"HONDA"
        },
        "response_code":"0",
        "result":[
            {
                "model_id":"95",
                "model":"Accord",
                "make_id":"10",
                "make":"Honda",
                "listing_count":"47728"
            },
            {
                "model_id":"96",
                "model":"Civic",
                "make_id":"10",
                "make":"Honda",
                "listing_count":"50569"
            },
            {
                "model_id":"297",
                "model":"Fit",
                "make_id":"10",
                "make":"Honda",
                "listing_count":"5337"
            }
        ]
    }
}    

Examples

Query LemonFree API URL to use
All Chevrolet models http://api.lemonfree.com/v2/models/?make=Chevrolet&key=[YOUR API KEY]
All models belonging to make_id = 11 http://api.lemonfree.com/v2/models/?make_id=11&key=[YOUR API KEY]
All Ford models sorted by count http://api.lemonfree.com/v2/models/?make=Ford&sort_by=count&key=[YOUR API KEY]
All Ford models of listings that are over $5,000 http://api.lemonfree.com/v2/models/?make=Ford&price_min=5000&price_max=9999999&key=[YOUR API KEY]
All Ford models of 2000-2010 listings that are between $5,000 and $20,000 http://api.lemonfree.com/v2/models/?make=Ford&price_min=5000&price_max=20000&year_from=2000&year_to=2010&key=[YOUR API KEY]
All Toyota models of listings in North Carolina http://api.lemonfree.com/v2/models/?make=Toyota&state=NC&key=[YOUR API KEY]