Finding Items to Buy
Topics
In the previous chapter, you learned how Amazon groups and catalogs items for sale. In the following sections, you learn how to use Product Advertising API operations to find those items.
Finding Vehicles and Vehicle Parts
You can find vehicles, parts for vehicles, and vehicles in which a specific part works
using the vehicle operations: VehiclePartLookup, VehiclePartSearch, and VehicleSearch.
Four quantities are used to find specific vehicles: year, make, model, and trim, for example, 2008 GMC Yukon Denali. Make is the maker of a car, such as Ford, General Motors, and Chevrolet. Model refers to the name of the car, for example, Mustang, Hummer, and Neon. Trim refers to the package of accessories included with the car. For example, some makers use trim names such as GL and DL to refer to accessory packages. An accessory package might include power seats, sunroof, and an upgraded sound system. Individual accessories are also referred to as VehicleOptions in Product Advertising API.
Finding a Vehicle
The VehicleSearch operation returns vehicles based on one or
more of the following parameters: year, make, model, and trim. Providing only a
year, for example, in a VehicleSearch request returns all of
the vehicles made in that year. Providing the year and make returns all of the
vehicles made in that year by that vehicle maker. By specifying more parameters, you
narrow your search results.
If you specify the year, make, model, and trim, VehicleSearch
also returns all of the VehicleOptions available for that car. These options have
identifiers that can be used in the other vehicle operations to further narrow
results.
Parts for a Vehicle
Once you have a year, make, and model for a car, you can use VehiclePartSearch to find the parts used in a specified vehicle, or
VehiclePartLookup to find out if a specified part works in
a vehicle.
VehiclePartSearch requires the year, make, and model of a
car. You can then restrict the parts found for a vehicle by BrowseNode, trim,
vehicle options, or brand.
Filters to Narrow Results
Year, make, and model go a long way in defining the vehicle parts that
interests you. There are, however, additional parameters that you can use in a
VehiclePartSearch request to refine your
results:
-
TrimId—A package of vehicle options, such as power steering and power seats
-
VehicleOptions—These are the individual vehicle options, some of which are combined into trim packages
VehicleOptions include
BedId, BodyStyleId, BrakesId, DriveTypeId, EngineId, MfrBodyCodeId, SpringTypesId, SteeringId, TransmissionId, andWheelbaseId -
BrowseNodeId —Browsenodes are groupings of products, for example, carburetors
The Automobile BrowseNode is used by default
-
Brand—The maker of an option
Brands do not have IDs
Using the PartBrowseNodeBinsSummary response group,
VehiclePartSearch returns a list of all BrowseNodes
that contain parts for the car. In successive requests, you supply the
BrowseNode of interest to list all of the parts contained in the BrowseNode. You
can also specify trim packages and options to further limit the parts returned.
You can use the PartBrandBinsSummary response group to
with a BrowseNode ID to return a list of all brands (manufacturers) that make
the part, and the number of car parts in the specified BrowseNode.
When you finally reach the level of filtering desired, you can use the
VehicleParts response group in a VehiclePartSearch request to return all of the parts (ASINs) for
the year, make, model, and BrowseNode (or brand). For additional information
about each car part, you use an ItemLookup request and
supply the ASIN of the car part. ItemLookup can take as
ItemIds up to ten comma-separated ASINs, as shown in
the following example:
http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&
Version=2008-08-18&Operation=ItemLookup&SubscriptionId=ID
&ItemId=B000BV9LGM,B000C0TAKO,B000C0WJUW,B000C2WLMG,B000C7A0S8,
B000CAXN7K,B000C0TAH2&ResponseGroup=Small
Paging Through Parts
The number of parts that can work with a vehicle can be far greater than the
ten (default) returned. So, you can use the VehiclePartSearch parameters Count,
FromItemId, and PartPageDirection with the VehicleParts
response group (only).
To page through car parts
-
In a
VehiclePartSearchrequest, use theVehiclePartsresponse group. -
Set the value of
FromItemIdto the ASIN where you want to start. -
Set the value of
PartPageDirectionto "Next" (default) or "Previous" to specify if you want the next ten or previous ten results. -
Set the value of
Countto an integer between 1 and 15, inclusive, where 10 is the default. This specifies the number of results returned in one response. -
Send the request.
Vehicles That a Part Works In
VehiclePartLookup returns the list of cars that a specified
part works in. The car part is specified by its ASIN. The same operation can
determine if a part works in a car specified by its year, make, and model. There are
times when the operation will need additional information, the trim or some option,
to determine if the part works in the car. The XML response specifies whether
additional information is needed.
Fitments are vehicles that accept specified vehicle parts. In other words, the specified vehicle parts work in (fit in) the vehicles.
Paging Through Fitments
You can page through fitments using VehiclePartLookup
with the Fitments response groups.
To page through fitments
-
In a
VehiclePartLookuprequest, use theFitmentsresponse group. -
Set the value of
FitmentCountto the number of fitments you want returned per page. The default is 25 and valid values are 1 to 200, inclusive. -
Set the value of
FitmentPageto the page number you want to start from.The default is 1. The page length is based on the value of
FitmentCount. For example, if you setFitmentCountto 50,FitmentPage2 would start at fitment 51. -
Send the request.