LemonFree API 2.0 Documentation - Trims Feed

Last Updated: January 21, 2014

Overview

The Trims feed provides access to all vehicle trims for individual models or for a specific model year.

Base URL

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

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.
If used, model (or model_id) must also be specified.
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.
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 trim name.

Query Result Fields

Field Description
trim_id The ID of the trim
trim The name of the trim
model_id The ID of the model associated with this trim
model The name of the model associated with this trim
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, model, and trim

Sample Results

XML

<?xml version="1.0" encoding="UTF-8"?>
<response xmlns:lf="http://api.lemonfree.com/ns/1.0">
    <lf:request_type>trims</lf:request_type>
    <lf:request_params>
        <lf:attr name="feed">trims</lf:attr>
        <lf:attr name="key">[YOUR API KEY]</lf:attr>
        <lf:attr name="make">HONDA</lf:attr>
        <lf:attr name="model">ACCORD</lf:attr>
    </lf:request_params>
    <lf:response_code>0</lf:response_code>
    <lf:result>
        <lf:item>
            <lf:attr name="trim_id">348</lf:attr>
            <lf:attr name="trim">EX</lf:attr>
            <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">1661</lf:attr>
        </lf:item>
        <lf:item>
            <lf:attr name="trim_id">354</lf:attr>
            <lf:attr name="trim">LX</lf:attr>
            <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">344</lf:attr>
        </lf:item>
        <lf:item>
            <lf:attr name="trim_id">2052</lf:attr>
            <lf:attr name="trim">Special Edition</lf:attr>
            <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">48</lf:attr>
        </lf:item>
    </lf:result>
</response>    

JSON

{
    "response":{
        "request_type":"trims",
        "request_params":{
            "feed":"trims",
            "format":"json",
            "key":"[YOUR API KEY]",
            "make":"HONDA",
            "model":"ACCORD"
        },
        "response_code":"0",
        "result":[
            {
                "trim_id":"348",
                "trim":"EX",
                "model_id":"95",
                "model":"Accord",
                "make_id":"10",
                "make":"Honda",
                "listing_count":"1661"
            },
            {
                "trim_id":"354",
                "trim":"LX",
                "model_id":"95",
                "model":"Accord",
                "make_id":"10",
                "make":"Honda",
                "listing_count":"344"
            },
            {
                "trim_id":"2052",
                "trim":"Special Edition",
                "model_id":"95",
                "model":"Accord",
                "make_id":"10",
                "make":"Honda",
                "listing_count":"48"
            }
        ]
    }
}    

Examples

Query LemonFree API URL to use
All Chevrolet Cavalier trims http://api.lemonfree.com/v2/trims/?make=Chevrolet&model=Cavalier&key=[YOUR API KEY]
All Ford Mustang trims sorted by count http://api.lemonfree.com/v2/trims/?make=Ford&model=Mustang&sort_by=count&key=[YOUR API KEY]
All Ford Mustang trims of listings that are over $5,000 http://api.lemonfree.com/v2/trims/?make=Ford&model=Mustang&price_min=5000&price_max=9999999&key=[YOUR API KEY]
All Ford Escort trims of of 2000-2010 listings that are between $5,000 and $20,000 http://api.lemonfree.com/v2/trims/?make=Ford&model=Escort&price_min=5000&price_max=20000&year_from=2000&year_to=2010&key=[YOUR API KEY]
All Toyota Corolla trims of listings in California http://api.lemonfree.com/v2/trims/?make=Toyota&model=Corolla&state=CA&key=[YOUR API KEY]